Skip to content

Commit

Permalink
Merge pull request #940 from iiwo/refactor/simplify_relation_options
Browse files Browse the repository at this point in the history
simplify relation options syntax
  • Loading branch information
seuros authored Oct 29, 2019
2 parents f8a3dc2 + 8728849 commit 6b38c65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/acts_as_taggable_on/tagging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Tagging < ::ActiveRecord::Base #:nodoc:
belongs_to :tag, class_name: '::ActsAsTaggableOn::Tag', counter_cache: ActsAsTaggableOn.tags_counter
belongs_to :taggable, polymorphic: true

belongs_to :tagger, {polymorphic: true}.tap {|o| o.merge!(optional: true) }
belongs_to :tagger, { polymorphic: true, optional: true }

scope :owned_by, ->(owner) { where(tagger: owner) }
scope :not_owned, -> { where(tagger_id: nil, tagger_type: nil) }
Expand Down

0 comments on commit 6b38c65

Please sign in to comment.