On 5 Mar 2009, at 14:37, luis wrote:

>
> This happens when trying to save the Client object, here is the stack
> trace

Looks like you still have a validation against name.

Fred
>
>
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activerecord-2.2.2/lib/active_record/attribute_methods.rb:260:in
> `method_missing'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activerecord-2.2.2/lib/active_record/validations.rb:398:in `send'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activerecord-2.2.2/lib/active_record/validations.rb:398:in
> `validates_each'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activerecord-2.2.2/lib/active_record/validations.rb:397:in `each'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activerecord-2.2.2/lib/active_record/validations.rb:397:in
> `validates_each'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activesupport-2.2.2/lib/active_support/callbacks.rb:182:in `call'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activesupport-2.2.2/lib/active_support/callbacks.rb:182:in
> `evaluate_method'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activesupport-2.2.2/lib/active_support/callbacks.rb:166:in `call'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `run'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `each'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `send'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `run'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activesupport-2.2.2/lib/active_support/callbacks.rb:277:in
> `run_callbacks'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activerecord-2.2.2/lib/active_record/validations.rb:1029:in
> `valid_without_callbacks?'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activerecord-2.2.2/lib/active_record/callbacks.rb:286:in `valid?'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activerecord-2.2.2/lib/active_record/validations.rb:1008:in
> `save_without_dirty'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activerecord-2.2.2/lib/active_record/dirty.rb:79:in
> `save_without_transactions'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activerecord-2.2.2/lib/active_record/transactions.rb:179:in `send'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activerecord-2.2.2/lib/active_record/transactions.rb:179:in
> `with_transaction_returning_status'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activerecord-2.2.2/lib/active_record/connection_adapters/
> postgresql_adapter.rb:550:in `transaction'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activerecord-2.2.2/lib/active_record/transactions.rb:129:in
> `transaction'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activerecord-2.2.2/lib/active_record/transactions.rb:138:in
> `transaction'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activerecord-2.2.2/lib/active_record/transactions.rb:178:in
> `with_transaction_returning_status'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activerecord-2.2.2/lib/active_record/transactions.rb:146:in `save'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activerecord-2.2.2/lib/active_record/transactions.rb:158:in
> `rollback_active_record_state!'
> /usr/local/encap/ruby-1.8.7-p72/lib/ruby/gems/1.8/gems/
> activerecord-2.2.2/lib/active_record/transactions.rb:146:in `save'
> app/models/client.rb:12:in `save'
> app/controllers/clients_controller.rb:14:in `create'
>
> On Mar 5, 3:33 am, Frederick Cheung <frederick.che...@gmail.com>
> wrote:
>> On Mar 5, 4:24 am, luis <luistav...@yahoo.com> wrote:
>>
>>
>>
>>> 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>"
>>
>> When does this error occur - what's the stack trace ?
>>
>> Fred
>>
>>
>>
>>> 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