Can someone please help us with this error?
It's blocking basic functionality of our application

On Aug 31, 7:31 am, Ritvvij <[email protected]> wrote:
> Hi,
>
> We are facing a very weird situation. We do not face the problem in
> our local but face it on the web service where we hosted. Seems like
> the kinda of issues we have in java where either code stayed in cache
> and not clearing even after server restart or ear deployment issues,
> etc.
>
> Our model is as follows. User can have one contact. The contact
> sometimes should have country and state mandatory.
>
> class User < ActiveRecord::Base
>   has_one :contact, :as => :contactable
>
> class Contact < ActiveRecord::Base
>   belongs_to :contactable, :polymorphic => true
>   attr_accessor :validate_country, :validate_state
>   validates_presence_of :country, :if => "validate_country"
>   validates_presence_of :state, :if => "validate_state"
>
> We are not calling @user.contact.validate_country = true anywhere but
> when doing @user.save on creation, we get an error that cannot find
> function validate_country.
>
> We also tried some varieties of code.
>   attr_accessor "validate_country", "validate_state"
>   attr_accessible :validate_country, :validate_state
>   attr_accessible "validate_country", "validate_state"
>
> Can anything think of something?
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to