From d6c8d812251dc234b30ae8131898906fe0f6882b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Honza=20Min=C3=A1rik?= Date: Thu, 9 Mar 2017 12:13:20 +0100 Subject: [PATCH] Fixed Rails 5.1 deprecation message, has_many needs String value for class_name argument --- lib/acts_as_taggable_on/taggable/core.rb | 4 ++-- lib/acts_as_taggable_on/tagger.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/acts_as_taggable_on/taggable/core.rb b/lib/acts_as_taggable_on/taggable/core.rb index 645a563c3..22218f994 100644 --- a/lib/acts_as_taggable_on/taggable/core.rb +++ b/lib/acts_as_taggable_on/taggable/core.rb @@ -25,11 +25,11 @@ def initialize_acts_as_taggable_on_core # the associations tag_taggings & tags are always returned in created order has_many context_taggings, -> { includes(:tag).order(taggings_order).where(context: tags_type) }, as: :taggable, - class_name: ActsAsTaggableOn::Tagging, + class_name: 'ActsAsTaggableOn::Tagging', dependent: :destroy has_many context_tags, -> { order(taggings_order) }, - class_name: ActsAsTaggableOn::Tag, + class_name: 'ActsAsTaggableOn::Tag', through: context_taggings, source: :tag end diff --git a/lib/acts_as_taggable_on/tagger.rb b/lib/acts_as_taggable_on/tagger.rb index a1ade9369..2232776a7 100644 --- a/lib/acts_as_taggable_on/tagger.rb +++ b/lib/acts_as_taggable_on/tagger.rb @@ -20,12 +20,12 @@ def acts_as_tagger(opts={}) has_many :owned_taggings, owned_taggings_scope, opts.merge( as: :tagger, - class_name: ::ActsAsTaggableOn::Tagging, + class_name: '::ActsAsTaggableOn::Tagging', dependent: :destroy ) has_many :owned_tags, -> { distinct }, - class_name: ::ActsAsTaggableOn::Tag, + class_name: '::ActsAsTaggableOn::Tag', source: :tag, through: :owned_taggings end