Skip to content

Commit

Permalink
association options
Browse files Browse the repository at this point in the history
  • Loading branch information
waymondo committed Oct 11, 2024
1 parent ccd7f21 commit 0f5955f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/hoardable/has_one.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ def has_one(*args)
options = args.extract_options!
hoardable = options.delete(:hoardable)
name = args.first
association = super(*args, **options)[name]
return unless hoardable || (association&.options[:class_name].match?(/RichText$/))
association_options = super(*args, **options)[name]&.options
return unless hoardable || (association_options && association_options[:class_name].match?(/RichText$/))

class_eval <<-RUBY, __FILE__, __LINE__ + 1
def #{name}
Expand Down

0 comments on commit 0f5955f

Please sign in to comment.