I’m getting a very bizarre error:
NameError in LandlordsController#search
uninitialized constant Landlord
RAILS_ROOT: /var/rails/rental/public/…/config/…
Application Trace | Framework Trace | Full Trace
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:100:in
const_missing' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:131:in
const_missing’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:133:in
send' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:133:in
const_missing’
#{RAILS_ROOT}/app/controllers/landlords_controller.rb:38:in `search’
Here is the call in the landlords_controller.rb file:
def search
@landlords = Landlord.find(:all, :order=>‘company_name’,
:conditions => [“company_id = ? AND active = 1”,
@session[‘user’].company_id])
end
Landlord is a model class, that is defined in landlord.rb in the models
directory.
The really bizarre part is this: I made a duplicate of the application
directory and the copies are identical. When running in one of the app
directorys, the application runs fine. In the other directory, it give
the error. This same behavior occurs when using both lighttpd and
webrick
Ruby: 1.8.2
Rails: 1.1.6
MySQL: 4.1
Any ideas/help would be greatly appreciated.
Thanks,