diff --git a/lib/commentable_methods.rb b/lib/commentable_methods.rb index c1bdc7f..b801bfe 100644 --- a/lib/commentable_methods.rb +++ b/lib/commentable_methods.rb @@ -17,13 +17,13 @@ def define_role_based_inflection(role) def define_role_based_inflection_3(role) has_many "#{role.to_s}_comments".to_sym, - has_many_options(role).merge(:conditions => { role: role.to_s }) + **has_many_options(role).merge(:conditions => { role: role.to_s }) end def define_role_based_inflection_4(role) has_many "#{role.to_s}_comments".to_sym, -> { where(role: role.to_s) }, - has_many_options(role) + **has_many_options(role) end def has_many_options(role) @@ -53,9 +53,9 @@ def acts_as_commentable(*args) comment_roles.each do |role| define_role_based_inflection(role) end - has_many :all_comments, { :as => :commentable, :dependent => :destroy, class_name: 'Comment' }.merge(join_options) + has_many :all_comments, **{ :as => :commentable, :dependent => :destroy, class_name: 'Comment' }.merge(join_options) else - has_many :comments, {:as => :commentable, :dependent => :destroy}.merge(join_options) + has_many :comments, **{:as => :commentable, :dependent => :destroy}.merge(join_options) end comment_types.each do |role|