Hi,

I am getting a method_missing error when I run my application in the
production environment unless I set config.cache_classes = false in
config/environments/production.rb. This happens in Rails 2.2.2 but not
in Rails 2.1.0. The method that is missing is one I used to have
before I edited by hand the migration that creates the table
associated with the object (I know you are discouraged to do this, but
I had started with a very simple model and thought it would be cleaner
to have the bulk of the data defined in the first migration). I wonder
if this has anything to do with the issue.

To be more specific, I changed this

  def self.up
    create_table :clients do |t|
      t.string :name, :null=>false
      t.text :office_address
      t.text :home_address

      t.timestamps
    end
    add_index(:clients, :name, :unique=>true)
  end

into

  def self.up
    create_table :clients do |t|
      t.string :last_name, :null=>false
      t.string :first_name, :null=>false
      t.text :office_address
      t.text :home_address
      <bunch of other fields>

      t.timestamps
    end
    add_index(:clients, :last_name, :unique=>true)
  end

I then ran "rake db:migrate VERSION=0" and then "rake db:migrate"

All worked fine in both development and production environments in
Rails 2.1.0, but broke in Rails 2.2.2/production with the message
"undefined method `name' for #<Client:0xb72d361c>"

>From what I can tell, with the object cache enabled, Rails thinks that
the Client object still has a method called name (which it used to
have). I wonder how persistent is the object cache (I'd imagine not
across server restarts) or if the source of this problem is elsewhere.

Any help will be appreciated,

Luis

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to