Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `caching_tag_list_on?' #432

Closed
aaronchi opened this issue Dec 11, 2013 · 20 comments · Fixed by #806
Closed

undefined method `caching_tag_list_on?' #432

aaronchi opened this issue Dec 11, 2013 · 20 comments · Fixed by #806
Assignees

Comments

@aaronchi
Copy link

Since #403 was applied, I'm getting an error rendering a tag_list because the caching_xxx_on? method_on method has not been added. This is rails 4.0.2 working against the acts-as-taggable-on master. It seems that using base.connected? doesn't work reliably on initialization and causes errors later if these methods have not been defined.

Stacktrace is not very interesting but here it is:

Showing /Users/aaron/sites/mixxter/app/views/admin/sites/_form.html.erb where line #5 raised:

undefined method `caching_tag_list_on?' for #<Class:0x007fc65e0ea6d8>
Extracted source (around line #5):

    wrapper: :bootstrap3_horizontal, defaults: {column_html: {class: "controls col-sm-9"}, label_html: {class: "col-sm-3"} },
    html: {class: "form-horizontal", role: "form"} do |f| %>
    <%= f.input :name %>
    <%= f.input :tag_list %>
    <%= f.input :description, input_html: {class: 'auto'} %>

    <div class="form-group">

Trace of template inclusion: app/views/admin/sites/edit.html.erb, app/views/admin/sites/show.html.erb

Rails.root: /Users/aaron/sites/mixxter

Application Trace | Framework Trace | Full Trace
app/views/admin/sites/_form.html.erb:5:in `block in _app_views_admin_sites__form_html_erb__4128459791633110155_70244962879300'
app/views/admin/sites/_form.html.erb:1:in `_app_views_admin_sites__form_html_erb__4128459791633110155_70244962879300'
app/views/admin/sites/edit.html.erb:9:in `_app_views_admin_sites_edit_html_erb___2528484288122667039_70244963004780'
app/views/admin/sites/show.html.erb:1:in `_app_views_admin_sites_show_html_erb___3959670009797880860_70244963057000'
app/controllers/application_controller.rb:88:in `set_timezone'
@ghost ghost assigned bf4 Dec 11, 2013
@bf4
Copy link
Collaborator

bf4 commented Dec 11, 2013

Thanks. Would you mind also pasting the ref for the gem from your Gemfile.lock?

@aaronchi
Copy link
Author

GIT
  remote: git://github.com/mbleigh/acts-as-taggable-on.git
  revision: 8f7a830445d0bb3febcafe7558455c695c67b59b
  specs:
    acts-as-taggable-on (2.4.2.pre)
      rails (>= 3, < 5)

@bf4
Copy link
Collaborator

bf4 commented Dec 11, 2013

Also Ruby engine/version, app server, how you specify acts_as_taggable in your model, and if you're using the model directly in the view or some kind of presenter. Does the stacktrace really not include the gem or the model? Try clicking 'full trace'

@aaronchi
Copy link
Author

Sorry. Thought this would be easy to reproduce. Ruby is 2.0.0p353

Model is just using acts_as_ordered_taggable

Here's the full stack trace:

activerecord (4.0.2) lib/active_record/dynamic_matchers.rb:22:in `method_missing'
/Users/aaron/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/acts-as-taggable-on-6ad1eb68470b/lib/acts_as_taggable_on/acts_as_taggable_on/core.rb:250:in `tag_list_cache_on'
/Users/aaron/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/acts-as-taggable-on-6ad1eb68470b/lib/acts_as_taggable_on/acts_as_taggable_on/core.rb:259:in `tag_list_on'
/Users/aaron/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/acts-as-taggable-on-6ad1eb68470b/lib/acts_as_taggable_on/acts_as_taggable_on/core.rb:44:in `tag_list'
simple_form (3.0.1) lib/simple_form/form_builder.rb:521:in `file_method?'
simple_form (3.0.1) lib/simple_form/form_builder.rb:507:in `default_input_type'
simple_form (3.0.1) lib/simple_form/form_builder.rb:477:in `find_input'
simple_form (3.0.1) lib/simple_form/form_builder.rb:111:in `input'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `block in capture'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:200:in `with_output_buffer'
actionpack (4.0.2) lib/action_view/helpers/capture_helper.rb:38:in `capture'
actionpack (4.0.2) lib/action_view/helpers/form_helper.rb:435:in `form_for'
simple_form (3.0.1) lib/simple_form/action_view_extensions/form_helper.rb:22:in `block in simple_form_for'
simple_form (3.0.1) lib/simple_form/action_view_extensions/form_helper.rb:41:in `with_simple_form_field_error_proc'
simple_form (3.0.1) lib/simple_form/action_view_extensions/form_helper.rb:21:in `simple_form_for'
actionpack (4.0.2) lib/action_view/template.rb:143:in `block in render'
activesupport (4.0.2) lib/active_support/notifications.rb:161:in `instrument'
actionpack (4.0.2) lib/action_view/template.rb:141:in `render'
actionpack (4.0.2) lib/action_view/renderer/partial_renderer.rb:306:in `render_partial'
actionpack (4.0.2) lib/action_view/renderer/partial_renderer.rb:279:in `block in render'
actionpack (4.0.2) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (4.0.2) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.0.2) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.0.2) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.0.2) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionpack (4.0.2) lib/action_view/renderer/partial_renderer.rb:278:in `render'
actionpack (4.0.2) lib/action_view/renderer/renderer.rb:47:in `render_partial'
actionpack (4.0.2) lib/action_view/helpers/rendering_helper.rb:27:in `render'
actionpack (4.0.2) lib/action_view/template.rb:143:in `block in render'
activesupport (4.0.2) lib/active_support/notifications.rb:161:in `instrument'
actionpack (4.0.2) lib/action_view/template.rb:141:in `render'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:49:in `block (2 levels) in render_template'
actionpack (4.0.2) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (4.0.2) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.0.2) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.0.2) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.0.2) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:48:in `block in render_template'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:56:in `render_with_layout'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:47:in `render_template'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:17:in `render'
actionpack (4.0.2) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionpack (4.0.2) lib/action_view/renderer/renderer.rb:23:in `render'
actionpack (4.0.2) lib/action_view/helpers/rendering_helper.rb:24:in `render'
actionpack (4.0.2) lib/action_view/template.rb:143:in `block in render'
activesupport (4.0.2) lib/active_support/notifications.rb:161:in `instrument'
actionpack (4.0.2) lib/action_view/template.rb:141:in `render'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:49:in `block (2 levels) in render_template'
actionpack (4.0.2) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (4.0.2) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.0.2) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.0.2) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.0.2) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:48:in `block in render_template'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:56:in `render_with_layout'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:47:in `render_template'
actionpack (4.0.2) lib/action_view/renderer/template_renderer.rb:17:in `render'
actionpack (4.0.2) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionpack (4.0.2) lib/action_view/renderer/renderer.rb:23:in `render'
actionpack (4.0.2) lib/abstract_controller/rendering.rb:127:in `_render_template'
actionpack (4.0.2) lib/action_controller/metal/streaming.rb:219:in `_render_template'
actionpack (4.0.2) lib/abstract_controller/rendering.rb:120:in `render_to_body'
actionpack (4.0.2) lib/action_controller/metal/rendering.rb:33:in `render_to_body'
actionpack (4.0.2) lib/action_controller/metal/renderers.rb:26:in `render_to_body'
actionpack (4.0.2) lib/abstract_controller/rendering.rb:97:in `render'
actionpack (4.0.2) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:41:in `block (2 levels) in render'
activesupport (4.0.2) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/Users/aaron/.rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/benchmark.rb:296:in `realtime'
activesupport (4.0.2) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:41:in `block in render'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
activerecord (4.0.2) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:40:in `render'
meta-tags (1.5.0) lib/meta_tags/controller_helper.rb:28:in `render_with_meta_tags'
/Users/aaron/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/wiselinks-34e3a0163824/lib/wiselinks/rendering.rb:34:in `render_with_wiselinks'
actionpack (4.0.2) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
actionpack (4.0.2) lib/action_controller/metal/responder.rb:233:in `default_render'
actionpack (4.0.2) lib/action_controller/metal/responder.rb:161:in `to_html'
responders (1.0.0) lib/responders/flash_responder.rb:104:in `to_html'
actionpack (4.0.2) lib/action_controller/metal/responder.rb:154:in `respond'
actionpack (4.0.2) lib/action_controller/metal/responder.rb:147:in `call'
actionpack (4.0.2) lib/action_controller/metal/mime_responds.rb:330:in `respond_with'
inherited_resources (1.4.1) lib/inherited_resources/actions.rb:13:in `show'
actionpack (4.0.2) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.0.2) lib/abstract_controller/base.rb:189:in `process_action'
actionpack (4.0.2) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.0.2) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (4.0.2) lib/active_support/callbacks.rb:464:in `block in _run__153512773054198576__process_action__callbacks'
activesupport (4.0.2) lib/active_support/callbacks.rb:212:in `block in _conditional_callback_around_74'
activesupport (4.0.2) lib/active_support/core_ext/time/zones.rb:45:in `use_zone'
activesupport (4.0.2) lib/active_support/callbacks.rb:211:in `_conditional_callback_around_74'
activesupport (4.0.2) lib/active_support/callbacks.rb:413:in `_run__153512773054198576__process_action__callbacks'
activesupport (4.0.2) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.2) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (4.0.2) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.0.2) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.0.2) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.0.2) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.0.2) lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
activerecord (4.0.2) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.0.2) lib/abstract_controller/base.rb:136:in `process'
actionpack (4.0.2) lib/abstract_controller/rendering.rb:44:in `process'
actionpack (4.0.2) lib/action_controller/metal.rb:195:in `dispatch'
actionpack (4.0.2) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.0.2) lib/action_controller/metal.rb:231:in `block in action'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:80:in `call'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:48:in `call'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:680:in `call'
omniauth (1.1.4) lib/omniauth/strategy.rb:184:in `call!'
omniauth (1.1.4) lib/omniauth/strategy.rb:164:in `call'
htmlcompressor (0.0.7) lib/htmlcompressor/rack.rb:36:in `call'
meta_request (0.2.8) lib/meta_request/middlewares/app_request_handler.rb:13:in `call'
rack-contrib (1.1.0) lib/rack/contrib/response_headers.rb:17:in `call'
meta_request (0.2.8) lib/meta_request/middlewares/headers.rb:16:in `call'
meta_request (0.2.8) lib/meta_request/middlewares/meta_request_handler.rb:13:in `call'
bullet (4.7.1) lib/bullet/rack.rb:12:in `call'
jquery-fileupload-rails (0.4.1) lib/jquery/fileupload/rails/middleware.rb:14:in `_call'
jquery-fileupload-rails (0.4.1) lib/jquery/fileupload/rails/middleware.rb:10:in `call'
mobvious (0.3.2) lib/mobvious/manager.rb:25:in `call'
jquery-fileupload-rails (0.4.1) lib/jquery/fileupload/rails/middleware.rb:14:in `_call'
jquery-fileupload-rails (0.4.1) lib/jquery/fileupload/rails/middleware.rb:10:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/flash.rb:241:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/cookies.rb:486:in `call'
activerecord (4.0.2) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.0.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.0.2) lib/active_support/callbacks.rb:373:in `_run__4361206340012291434__call__callbacks'
activesupport (4.0.2) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.2) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/reloader.rb:64:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
bugsnag (1.6.4) lib/bugsnag/rack.rb:36:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.2) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.2) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.2) lib/rails/rack/logger.rb:20:in `call'
quiet_assets (1.0.2) lib/quiet_assets.rb:18:in `call_with_quiet_assets'
actionpack (4.0.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.2) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
dragonfly (1.0.1) lib/dragonfly/cookie_monster.rb:9:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
sentry-raven (0.7.1) lib/raven/rack.rb:47:in `call'
railties (4.0.2) lib/rails/engine.rb:511:in `call'
railties (4.0.2) lib/rails/application.rb:97:in `call'
railties (4.0.2) lib/rails/railtie/configurable.rb:30:in `method_missing'
rack (1.5.2) lib/rack/deflater.rb:25:in `call'
/Users/aaron/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:145:in `handle'
/Users/aaron/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:99:in `rescue in block (2 levels) in start'
/Users/aaron/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:96:in `block (2 levels) in start'
/Users/aaron/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:86:in `each'
/Users/aaron/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:86:in `block in start'
/Users/aaron/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:66:in `loop'
/Users/aaron/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:66:in `start'
/Users/aaron/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:13:in `run'
/Users/aaron/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/bin/nack_worker:4:in `<main>'

@bf4
Copy link
Collaborator

bf4 commented Dec 11, 2013

Thanks. (I'm just looking at the code.. haven't tried running it, yet)

@seuros
Copy link
Collaborator

seuros commented Dec 16, 2013

+1 having the same issue.

@bf4
Copy link
Collaborator

bf4 commented Dec 16, 2013

I see this issue has been around in other repos, as well, spree/spree#3690 heartcombo/devise#1339 I'll try to look at it tonight.

@bf4
Copy link
Collaborator

bf4 commented Dec 17, 2013

I believe you , but I've been unable to duplicate this, and hence, test it

@seuros
Copy link
Collaborator

seuros commented Dec 17, 2013

  1. in model : acts_as_ordered_taggable_on :foos
  2. add in table : cached_foo_list column
  3. ...

@bf4
Copy link
Collaborator

bf4 commented Dec 17, 2013

@seuros Thanks, done that.. still no dice.. I'm happy to accept a PR that doesn't break the tests or change behavior.

@bf4
Copy link
Collaborator

bf4 commented Dec 17, 2013

I can mimick the notion in rails console, though, so that's something

@seuros
Copy link
Collaborator

seuros commented Dec 17, 2013

Try in console

@bf4
Copy link
Collaborator

bf4 commented Dec 17, 2013

Looks like better hooks for adding methods based on the first time attributes are reflected from the database would be in https://github.com/rails/rails/blob/master/activerecord/lib/active_record/model_schema.rb#L318

Thoughts? @tenderlove @fxn @jonleighton @SamSaffron Anything is appreciated

Looks like the below is only in Rails 4

      # This is a hook for use by modules that need to do extra stuff to
      # attributes when they are initialized. (e.g. attribute
      # serialization)
      def initialize_attributes(attributes, options = {}) #:nodoc:
        attributes
      end

but Rails 3 and 4 both have this,

     def columns
        @columns ||= connection.schema_cache.columns(table_name).map do |col|
          col = col.dup
          col.primary = (col.name == primary_key)
          col
        end
      end

so that we could

def self.columns
  @acts_as_taggable_on_columns ||= begin
      db_columns = super
      if hash_tag_cache_columns?
         send :include, ActsAsTaggableOn::Taggable::Cache::InstanceMethods
         extend ActsAsTaggableOn::Taggable::Cache::ClassMethods

        class_eval do
          before_save :save_cached_tag_list
        end

         initialize_acts_as_taggable_on_cache
      end
      db_columns
  end
end

def self.has_tag_cache_columns?
    tag_types.any? {|context| column_names.include?("cached_#{context.to_s.singularize}_list") }
end

bf4 added a commit to bf4/acts-as-taggable-on that referenced this issue Dec 19, 2013
bf4 added a commit that referenced this issue Dec 22, 2013
[#432][#403][#433][#422] Fix checking for column cache until db connects
@bf4
Copy link
Collaborator

bf4 commented Dec 29, 2013

Closing as fixed

@bf4 bf4 closed this as completed Dec 29, 2013
@kris
Copy link

kris commented Sep 1, 2016

This isn't fixed, unfortunately. I've come across this doing a Rails 4->5 migration and have noticed something interesting. I added some logger calls to the ActiveRecord::Base.columns monkey patch and found that it's being called sporadically. I'm not 100% sure why, but this is what I see in Rails console:

Article.last.tag_list raises an exception about the missing method
a = Article.last; a.tag_list will work.

I'm not sure why this is the issue, but it's what I am seeing, and can repeat 100% locally.

@courtenay
Copy link

It may be related to calling the (missing) method on the activemodel relation (foo.last.tag_list or foo.person.tag_list) as opposed to the final object (foo.person ; foo.person.tag_list )

@digerata
Copy link

digerata commented Feb 10, 2017

I'm seeing this as well, Rails 4 -> 5 upgrade. What I've found is after the error happens, going back to the console in development and calling foo.person.tag_list directly will work and the error no longer happens for that session.

Our actual usage is person.tag_list.present? and this raises the exception. Reload the page and sometimes it works, sometimes it doesn't.

@digerata
Copy link

Gemfile version:

acts-as-taggable-on (4.0.0)

Stack Trace:

Completed 500 Internal Server Error in 716ms (ActiveRecord: 91.1ms)

NoMethodError - undefined method `caching_tag_list_on?' for #<Class:0x007fa6abba7eb8>:
  activerecord (5.0.0) lib/active_record/dynamic_matchers.rb:21:in `method_missing'
  attr_encrypted (3.0.3) lib/attr_encrypted.rb:295:in `method_missing'
  attr_encrypted (3.0.3) lib/attr_encrypted/adapters/active_record.rb:129:in `method_missing_with_attr_encrypted'
  acts-as-taggable-on (4.0.0) lib/acts_as_taggable_on/taggable/core.rb:286:in `tag_list_cache_on'
  acts-as-taggable-on (4.0.0) lib/acts_as_taggable_on/taggable/core.rb:295:in `tag_list_on'
  acts-as-taggable-on (4.0.0) lib/acts_as_taggable_on/taggable/core.rb:39:in `specialization_list'
  app/views/jobs/summary/_specialization.html.erb:6:in `_app_views_jobs_summary__specialization_html_erb__715560487591950680_70176910023640'
  actionview (5.0.0) lib/action_view/template.rb:158:in `block in render'
  activesupport (5.0.0) lib/active_support/notifications.rb:166:in `instrument'
  actionview (5.0.0) lib/action_view/template.rb:348:in `instrument'
  actionview (5.0.0) lib/action_view/template.rb:156:in `render'
  actionview (5.0.0) lib/action_view/renderer/partial_renderer.rb:343:in `render_partial'
  actionview (5.0.0) lib/action_view/renderer/partial_renderer.rb:311:in `block in render'
  actionview (5.0.0) lib/action_view/renderer/abstract_renderer.rb:42:in `block in instrument'
  activesupport (5.0.0) lib/active_support/notifications.rb:164:in `block in instrument'
  activesupport (5.0.0) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
  activesupport (5.0.0) lib/active_support/notifications.rb:164:in `instrument'
  actionview (5.0.0) lib/action_view/renderer/abstract_renderer.rb:41:in `instrument'
  actionview (5.0.0) lib/action_view/renderer/partial_renderer.rb:310:in `render'
  actionview (5.0.0) lib/action_view/renderer/renderer.rb:47:in `render_partial'
  actionview (5.0.0) lib/action_view/renderer/renderer.rb:21:in `render'
  actionview (5.0.0) lib/action_view/helpers/rendering_helper.rb:32:in `render'
  app/views/jobs/_row.html.erb:16:in `_app_views_jobs__row_html_erb__2748290585986942527_70176916820720'
  actionview (5.0.0) lib/action_view/template.rb:158:in `block in render'
  activesupport (5.0.0) lib/active_support/notifications.rb:166:in `instrument'
  actionview (5.0.0) lib/action_view/template.rb:348:in `instrument'
  actionview (5.0.0) lib/action_view/template.rb:156:in `render'
  actionview (5.0.0) lib/action_view/renderer/partial_renderer.rb:343:in `render_partial'
  actionview (5.0.0) lib/action_view/renderer/partial_renderer.rb:311:in `block in render'
  actionview (5.0.0) lib/action_view/renderer/abstract_renderer.rb:42:in `block in instrument'
  activesupport (5.0.0) lib/active_support/notifications.rb:164:in `block in instrument'
  activesupport (5.0.0) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
  activesupport (5.0.0) lib/active_support/notifications.rb:164:in `instrument'
  actionview (5.0.0) lib/action_view/renderer/abstract_renderer.rb:41:in `instrument'
  actionview (5.0.0) lib/action_view/renderer/partial_renderer.rb:310:in `render'
  actionview (5.0.0) lib/action_view/renderer/renderer.rb:47:in `render_partial'
  actionview (5.0.0) lib/action_view/renderer/renderer.rb:21:in `render'
  actionview (5.0.0) lib/action_view/helpers/rendering_helper.rb:32:in `render'
  app/views/super/dashboard/index.html.erb:7:in `block in _app_views_super_dashboard_index_html_erb__2839787348230277349_70176916693820'
  activerecord (5.0.0) lib/active_record/relation/delegation.rb:38:in `each'
  app/views/super/dashboard/index.html.erb:6:in `_app_views_super_dashboard_index_html_erb__2839787348230277349_70176916693820'
  actionview (5.0.0) lib/action_view/template.rb:158:in `block in render'
  activesupport (5.0.0) lib/active_support/notifications.rb:166:in `instrument'
  actionview (5.0.0) lib/action_view/template.rb:348:in `instrument'
  actionview (5.0.0) lib/action_view/template.rb:156:in `render'
  actionview (5.0.0) lib/action_view/renderer/template_renderer.rb:54:in `block (2 levels) in render_template'
  actionview (5.0.0) lib/action_view/renderer/abstract_renderer.rb:42:in `block in instrument'
  activesupport (5.0.0) lib/active_support/notifications.rb:164:in `block in instrument'
  activesupport (5.0.0) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
  activesupport (5.0.0) lib/active_support/notifications.rb:164:in `instrument'
  actionview (5.0.0) lib/action_view/renderer/abstract_renderer.rb:41:in `instrument'
  actionview (5.0.0) lib/action_view/renderer/template_renderer.rb:53:in `block in render_template'
  actionview (5.0.0) lib/action_view/renderer/template_renderer.rb:61:in `render_with_layout'
  actionview (5.0.0) lib/action_view/renderer/template_renderer.rb:52:in `render_template'
  actionview (5.0.0) lib/action_view/renderer/template_renderer.rb:14:in `render'
  actionview (5.0.0) lib/action_view/renderer/renderer.rb:42:in `render_template'
  actionview (5.0.0) lib/action_view/renderer/renderer.rb:23:in `render'
  actionview (5.0.0) lib/action_view/rendering.rb:103:in `_render_template'
  actionpack (5.0.0) lib/action_controller/metal/streaming.rb:217:in `_render_template'
  actionview (5.0.0) lib/action_view/rendering.rb:83:in `render_to_body'
  actionpack (5.0.0) lib/action_controller/metal/rendering.rb:52:in `render_to_body'
  actionpack (5.0.0) lib/action_controller/metal/renderers.rb:144:in `render_to_body'
  actionpack (5.0.0) lib/abstract_controller/rendering.rb:26:in `render'
  actionpack (5.0.0) lib/action_controller/metal/rendering.rb:36:in `render'
  actionpack (5.0.0) lib/action_controller/metal/instrumentation.rb:44:in `block (2 levels) in render'
  activesupport (5.0.0) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
  /Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/benchmark.rb:308:in `realtime'
  activesupport (5.0.0) lib/active_support/core_ext/benchmark.rb:12:in `ms'
  actionpack (5.0.0) lib/action_controller/metal/instrumentation.rb:44:in `block in render'
  actionpack (5.0.0) lib/action_controller/metal/instrumentation.rb:87:in `cleanup_view_runtime'
  activerecord (5.0.0) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
  actionpack (5.0.0) lib/action_controller/metal/instrumentation.rb:43:in `render'
  remotipart (1.3.1) lib/remotipart/render_overrides.rb:16:in `render_with_remotipart'
  actionpack (5.0.0) lib/action_controller/metal/implicit_render.rb:36:in `default_render'
  actionpack (5.0.0) lib/action_controller/metal/basic_implicit_render.rb:4:in `block in send_action'
  actionpack (5.0.0) lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
  actionpack (5.0.0) lib/abstract_controller/base.rb:188:in `process_action'
  actionpack (5.0.0) lib/action_controller/metal/rendering.rb:30:in `process_action'
  actionpack (5.0.0) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
  activesupport (5.0.0) lib/active_support/callbacks.rb:126:in `call'
  activesupport (5.0.0) lib/active_support/callbacks.rb:506:in `block (2 levels) in compile'
  activesupport (5.0.0) lib/active_support/callbacks.rb:455:in `call'
  activesupport (5.0.0) lib/active_support/callbacks.rb:101:in `__run_callbacks__'
  activesupport (5.0.0) lib/active_support/callbacks.rb:750:in `_run_process_action_callbacks'
  activesupport (5.0.0) lib/active_support/callbacks.rb:90:in `run_callbacks'
  actionpack (5.0.0) lib/abstract_controller/callbacks.rb:19:in `process_action'
  actionpack (5.0.0) lib/action_controller/metal/rescue.rb:20:in `process_action'
  actionpack (5.0.0) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
  activesupport (5.0.0) lib/active_support/notifications.rb:164:in `block in instrument'
  activesupport (5.0.0) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
  activesupport (5.0.0) lib/active_support/notifications.rb:164:in `instrument'
  actionpack (5.0.0) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
  actionpack (5.0.0) lib/action_controller/metal/params_wrapper.rb:248:in `process_action'
  activerecord (5.0.0) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (5.0.0) lib/abstract_controller/base.rb:126:in `process'
  actionview (5.0.0) lib/action_view/rendering.rb:30:in `process'
  actionpack (5.0.0) lib/action_controller/metal.rb:190:in `dispatch'
  actionpack (5.0.0) lib/action_controller/metal.rb:262:in `dispatch'
  actionpack (5.0.0) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
  actionpack (5.0.0) lib/action_dispatch/routing/route_set.rb:32:in `serve'
  actionpack (5.0.0) lib/action_dispatch/journey/router.rb:39:in `block in serve'
  actionpack (5.0.0) lib/action_dispatch/journey/router.rb:26:in `serve'
  actionpack (5.0.0) lib/action_dispatch/routing/route_set.rb:725:in `call'
  omniauth (1.3.1) lib/omniauth/strategy.rb:186:in `call!'
  omniauth (1.3.1) lib/omniauth/strategy.rb:164:in `call'
  bullet (5.4.2) lib/bullet/rack.rb:10:in `call'
  remotipart (1.3.1) lib/remotipart/middleware.rb:32:in `call'
  warden (1.2.6) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.6) lib/warden/manager.rb:34:in `call'
  rack (2.0.1) lib/rack/etag.rb:25:in `call'
  rack (2.0.1) lib/rack/conditional_get.rb:25:in `call'
  rack (2.0.1) lib/rack/head.rb:12:in `call'
  rack (2.0.1) lib/rack/session/abstract/id.rb:222:in `context'
  rack (2.0.1) lib/rack/session/abstract/id.rb:216:in `call'
  actionpack (5.0.0) lib/action_dispatch/middleware/cookies.rb:613:in `call'
  activerecord (5.0.0) lib/active_record/migration.rb:552:in `call'
  actionpack (5.0.0) lib/action_dispatch/middleware/callbacks.rb:38:in `block in call'
  activesupport (5.0.0) lib/active_support/callbacks.rb:97:in `__run_callbacks__'
  activesupport (5.0.0) lib/active_support/callbacks.rb:750:in `_run_call_callbacks'
  activesupport (5.0.0) lib/active_support/callbacks.rb:90:in `run_callbacks'
  actionpack (5.0.0) lib/action_dispatch/middleware/callbacks.rb:36:in `call'
  actionpack (5.0.0) lib/action_dispatch/middleware/executor.rb:12:in `call'
  actionpack (5.0.0) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
  better_errors (2.1.1) lib/better_errors/middleware.rb:84:in `protected_app_call'
  better_errors (2.1.1) lib/better_errors/middleware.rb:79:in `better_errors_call'
  better_errors (2.1.1) lib/better_errors/middleware.rb:57:in `call'
  actionpack (5.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call'
  actionpack (5.0.0) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
  railties (5.0.0) lib/rails/rack/logger.rb:36:in `call_app'
  railties (5.0.0) lib/rails/rack/logger.rb:24:in `block in call'
  activesupport (5.0.0) lib/active_support/tagged_logging.rb:70:in `block in tagged'
  activesupport (5.0.0) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (5.0.0) lib/active_support/tagged_logging.rb:70:in `tagged'
  railties (5.0.0) lib/rails/rack/logger.rb:24:in `call'
  sprockets-rails (3.2.0) lib/sprockets/rails/quiet_assets.rb:13:in `call'
  actionpack (5.0.0) lib/action_dispatch/middleware/request_id.rb:24:in `call'
  rack (2.0.1) lib/rack/method_override.rb:22:in `call'
  rack (2.0.1) lib/rack/runtime.rb:22:in `call'
  activesupport (5.0.0) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
  actionpack (5.0.0) lib/action_dispatch/middleware/executor.rb:12:in `call'
  actionpack (5.0.0) lib/action_dispatch/middleware/static.rb:136:in `call'
  rack (2.0.1) lib/rack/sendfile.rb:111:in `call'
  hirefire-resource (0.3.12) lib/hirefire/middleware.rb:41:in `call'
  rack-cors (0.4.0) lib/rack/cors.rb:80:in `call'
  railties (5.0.0) lib/rails/engine.rb:522:in `call'
  puma (3.6.0) lib/puma/configuration.rb:225:in `call'
  puma (3.6.0) lib/puma/server.rb:578:in `handle_request'
  puma (3.6.0) lib/puma/server.rb:415:in `process_client'
  puma (3.6.0) lib/puma/server.rb:275:in `block in run'
  puma (3.6.0) lib/puma/thread_pool.rb:116:in `block in spawn_thread'

@ProGM
Copy link
Contributor

ProGM commented Feb 20, 2017

I made a PR to fix this (#806). Please try it and let me know if it works for you 👍

gem "acts_as_taggable_on", git: 'https://github.com/ProGM/acts-as-taggable-on.git', branch: 'fix-caching-tag-list-on-bug'

@digerata
Copy link

I can confirm your PR fixes this problem. Thanks, Piero! 👍

seuros added a commit that referenced this issue May 3, 2017
tekniklr pushed a commit to tekniklr/acts-as-taggable-on that referenced this issue Mar 19, 2021
tekniklr pushed a commit to tekniklr/acts-as-taggable-on that referenced this issue Mar 19, 2021
tekniklr pushed a commit to tekniklr/acts-as-taggable-on that referenced this issue Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants