Konstantin Gredeskoul
2006-May-20 01:13 UTC
[Rails] acts_as_paranoid overrides ActiveRecord::Base??
Guys, I am trying to figure out what exactly does this line do at the end of "acts_as_paranoid" plugin? ActiveRecord::Base.send :include, Caboose::Acts::Paranoid::ActiveRecord My problem: I have some classes that I use acts_as_paranoid, and others with tagging support. Classes declared as taggable, throw error, which appears to be in the acts_as_paranoid version of the "find" method, however it''s not supposed to override Base for this class at all (this particular class is not "paranoid"). So it looks like just having "acts_as_paranaoid.rb" in my lib directory overrides Base for all cases, hence my suspicion about the above line...>> b = Book.find(1)=> #<Book:0x277bff4 @attributes={"date_published"=>nil, "dimensions"=>nil, "title"=>"Title", "id"=>"1", "subtitle"=>nil, "pages"=>"343", "author_description"=>nil}>>> b.tagsArgumentError: Unknown key(s): from from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/core_ext/hash/keys.rb:48:in `assert_valid_keys'' from ./script/../config/../config/../lib/acts_as_paranoid.rb:66:in `validate_find_options'' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/base.rb:376:in `find'' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/associations/has_many_through_association.rb:54:in `find_target'' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/associations/association_proxy.rb:116:in `load_target'' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/associations/association_proxy.rb:109:in `method_missing'' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/associations/has_many_through_association.rb:47:in `method_missing'' from /usr/local/lib/ruby/1.8/irb.rb:298:in `output_value'' from /usr/local/lib/ruby/1.8/irb.rb:151:in `eval_input'' from /usr/local/lib/ruby/1.8/irb.rb:259:in `signal_status'' from /usr/local/lib/ruby/1.8/irb.rb:147:in `eval_input'' from /usr/local/lib/ruby/1.8/irb.rb:146:in `eval_input'' from /usr/local/lib/ruby/1.8/irb.rb:70:in `start'' from /usr/local/lib/ruby/1.8/irb.rb:69:in `start'' from /usr/local/bin/irb:13 Any pointers are welcome! Thanks, Konstantin -- Posted via http://www.ruby-forum.com/.
> I am trying to figure out what exactly does this line do at the end of > "acts_as_paranoid" plugin? > > ActiveRecord::Base.send :include, Caboose::Acts::Paranoid::ActiveRecordThat adds the paranoid mixin to AR::Base. Here''s your error message...> ArgumentError: Unknown key(s): from > fromfrom: /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/core_ext/hash/keys.rb:48:in> `assert_valid_keys'' > from > ./script/../config/../config/../lib/acts_as_paranoid.rb:66:in > `validate_find_options''Try updating acts as paranoid: (notice there''s no validate_find_options method call in the latest) http://svn.techno-weenie.net/projects/plugins/acts_as_paranoid/lib/caboose/acts/paranoid.rb -- Rick Olson http://techno-weenie.net
Reasonably Related Threads
- Problem with acts_as_paranoid: "ArgumentError: Unknown key(s): group"
- acts_as_paranoid Unknown key(s): with_deleted
- acts_as_paranoid --> undefined method `constrain' for class `Class'
- acts_as_paranoid and :include
- Will acts_as_paranoid work with attachment_fu?