When I run rspec on a specific file:
rspec spec/models/my_namespace/my_model_spec.rb
I run into an error because rspec appears not to load app/models/my_namespace.rb, which contains the declaration of self.table_name_prefix
. In fact, if I use pry and run MyNamepsace.table_name_prefix # => NoMethodError: undefined method ``table_name_prefix'
.
When I try to query the db from Rails console (no rspec), it works, though: MyNamespace::MyModel.where(foo:'bar') # => [...]
Any idea what the problem or fix is?
Rails 3.2.14, Ruby 1.9.3, Debian
table_name_prefix
appears not even to be defined on the module.spec_helper
?