Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
class Lawyer < ActiveRecord::Base
def extracted?
!source.blank?
end
with_options :unless => :extracted? do |lawyer|
lawyer.validates_presence_of :oab,
:phones,
:address,
:day_of_birth,
:email
lawyer.validates_associated :phones,
:address,
:nextels,
:cities
end
end
l = Lawyer.new
l.source = "whatever"
l.valid? # returns true
l.address = Address.new
l.valid? # returns false
l.save validate:false
l.reload
l.valid? # returns true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.