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,
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 effort that cannot find
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?