I thought I had things set up right but now I'm not certain. I
installed the acts_as_paranoid plugin, added acts_as_paranoid just
under my class definition:
class Foo < ActiveRecord::Base
acts_as_paranoid
.
.
.
end
...and added "require_gem 'acts_as_paranoid'" to the bottom of my
environment.rb.
The problem is when I run my unit tests I get a mess of errors similar
to this one:
Every unit test fails with this "undefined method `scoped_methods='
for Foo:Class" error. This is my first time working with AAP so I'm
not sure what's going on. Any advice and suggestions are appreciated.
The gem is ancient! My rubyforge script broke a long time ago, (gems
are such a pain to push automatically), and then this neat new 'rails
plugin' feature came out, and I haven't looked back since
Thanks for the tips. I removed the require_gem line from
environment.rb but now I'm getting a method_missing error:
/usr/bin/ruby -Ilib:test "/usr/lib64/ruby/gems/1.8/gems/rake-0.7.1/lib/
rake/rake_test_loader.rb" "test/unit/foo_test.rb" "test/unit/
foo_result_test.rb" "test/unit/foo_searchterm_test.rb"
/usr/lib64/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/
base.rb:1129:in `method_missing': undefined local variable or method
`acts_as_paranoid' for Foo:Class (NameError)
from /home/jfrankovitz/svn/working/incubator/scaffolded/
code_alerts/config/../app/models/foo.rb:2
from /usr/lib64/ruby/vendor_ruby/1.8/rubygems/
custom_require.rb:27:in `gem_original_require'
from /usr/lib64/ruby/vendor_ruby/1.8/rubygems/
custom_require.rb:27:in `require'
from /usr/lib64/ruby/gems/1.8/gems/activesupport-1.3.1/lib/
active_support/dependencies.rb:147:in `require'
from /usr/lib64/ruby/gems/1.8/gems/activerecord-1.14.4/lib/
active_record/fixtures.rb:463:in `require_fixture_classes'
from /usr/lib64/ruby/gems/1.8/gems/activerecord-1.14.4/lib/
active_record/fixtures.rb:459:in `each'
from /usr/lib64/ruby/gems/1.8/gems/activerecord-1.14.4/lib/
active_record/fixtures.rb:459:in `require_fixture_classes'
from /usr/lib64/ruby/gems/1.8/gems/activerecord-1.14.4/lib/
active_record/fixtures.rb:454:in `fixtures'
from ./test/unit/foo_test.rb:4
from /usr/lib64/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/
rake_test_loader.rb:5:in `load'
from /usr/lib64/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/
rake_test_loader.rb:5
from /usr/lib64/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/
rake_test_loader.rb:5:in `each'
from /usr/lib64/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/
rake_test_loader.rb:5
rake aborted!
Command failed with status (1): [/usr/bin/ruby -Ilib:test "/usr/lib64/
ruby/...]