In Rails,
The "validates" keyword in Rails takes a parameter that allows you to do this:
validates :your_validator, :presence => true, :on => :create
You can also pass an array there:
validates :your_validator, :presence => true, :on => [:create, :update]
In Padrino,
I believe padrino using datamapper - DM has contextual validations. So, you could do a contextual validation.
validates :image, :presence => true, :when => [:custom]
Then while saving, you can do this:
post.save(:custom)
# OR
post.valid?(:custom)
The context :custom can be used in different places.
new?
existed! Anyways great its a great ORM, thanks for it! – Valedictorian