I Have a Model
module Interspire
class InterspireLead < ActiveRecord::Base
before_create :update_contactable
def update_contactable
self.contactable = false #contactable datatype is boolean
end
end
end
But when i create a object.
a = Interspire::InterspireLead.create(:email => "abc@gmail.com")
a.valid?
#=> true
a.errors.full_messages
#=>[]
a.save
#=> ROLLBACK
How to fix this erorrs?
Aucun commentaire:
Enregistrer un commentaire