diff --git a/lib/acts_as_taggable_on/taggable/core.rb b/lib/acts_as_taggable_on/taggable/core.rb index 645a563c3..83d4a198b 100644 --- a/lib/acts_as_taggable_on/taggable/core.rb +++ b/lib/acts_as_taggable_on/taggable/core.rb @@ -275,7 +275,7 @@ def tag_list_cache_on(context) variable_name = "@#{context.to_s.singularize}_list" if instance_variable_get(variable_name) instance_variable_get(variable_name) - elsif cached_tag_list_on(context) && self.class.caching_tag_list_on?(context) + elsif cached_tag_list_on(context) && ensure_included_cache_methods! && self.class.caching_tag_list_on?(context) instance_variable_set(variable_name, ActsAsTaggableOn.default_parser.new(cached_tag_list_on(context)).parse) else instance_variable_set(variable_name, ActsAsTaggableOn::TagList.new(tags_on(context).map(&:name))) @@ -418,6 +418,10 @@ def save_tags private + def ensure_included_cache_methods! + self.class.columns + end + # Filters the tag lists from the attribute names. def attributes_for_update(attribute_names) tag_lists = tag_types.map {|tags_type| "#{tags_type.to_s.singularize}_list"}