GithubHelp home page GithubHelp logo

Comments (4)

kevgo avatar kevgo commented on July 25, 2024

Strange, that code has been working for a long time. Do you have a unit test to reproduce the failure?

from cache-machine.

einzige avatar einzige commented on July 25, 2024

I thought the problem is what we use polymorphic association:
https://github.com/partyearth/cache-machine/blob/development/spec/lib/cache_machine_spec.rb#L104

from cache-machine.

einzige avatar einzige commented on July 25, 2024

I can not understand:
NoMethodError (undefined method klass' for nil:NilClass): activesupport (3.0.7) lib/active_support/whiny_nil.rb:48:inmethod_missing'
activerecord (3.0.7) lib/active_record/reflection.rb:346:in source_reflection' activerecord (3.0.7) lib/active_record/reflection.rb:346:incollect'
activerecord (3.0.7) lib/active_record/reflection.rb:346:in source_reflection' activerecord (3.0.7) lib/active_record/reflection.rb:407:inderive_class_name'
activerecord (3.0.7) lib/active_record/reflection.rb:121:in class_name' activerecord (3.0.7) lib/active_record/reflection.rb:162:inklass'
/home/szinin/.rvm/gems/ruby-1.8.7-p334@pe/bundler/gems/cache-machine-15233080c651/lib/cache-machine.rb:180:in hook_cache_machine_on' /home/szinin/.rvm/gems/ruby-1.8.7-p334@pe/bundler/gems/cache-machine-15233080c651/lib/cache-machine.rb:158:inhas_many'
lib/active_record/log_machine.rb:74:in `has_many'

case (reflection = (target_class = self).reflect_on_association association_id)
when ActiveRecord::Reflection::ThroughReflection
   # ERROR HERE
  reflection.klass.after_save { target_class.delete_association_cache_on self, association_id }
  ...

How reflection can be nil if when block catched it as ActiveRecord::Reflection::ThroughReflection?

from cache-machine.

einzige avatar einzige commented on July 25, 2024

That was an association error in external repo.

from cache-machine.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.