Skip to content

Commit

Permalink
From mbleigh#720, fixes tagger for Rails 5
Browse files Browse the repository at this point in the history
  • Loading branch information
shlomizadok committed May 13, 2016
1 parent dde41a4 commit 45dcb6c
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 @@ -13,7 +13,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
belongs_to :tagger, {polymorphic: true}.tap {|o| o.merge!(optional: true) if ActsAsTaggableOn::Utils.active_record5? }

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

0 comments on commit 45dcb6c

Please sign in to comment.