Currently, the last bit of the Usage section reads:
To define validation blocks just use the respective group validation method, like so
class Person < ActiveRecord::Base
validation_group :name do
validates_presence_of :first_name
validates_presence_of :last_name
end
validate_name {|r| # something custom on save }
validate_name_on_create {|r| # something custom on create }
validate_name_on_update {|r| # something custom on update }
end
But unless I am seriously mistaken, it should be more like:
To define validation blocks just include a custom 'validate' method within the validation group, like so
class Person < ActiveRecord::Base
validation_group :name do
validates_presence_of :first_name
validates_presence_of :last_name
validate {|r| # something custom on save }
validate_on_create {|r| # something custom on create }
validate_on_update {|r| # something custom on update }
end
end
Currently, the last bit of the Usage section reads:
To define validation blocks just use the respective group validation method, like so
But unless I am seriously mistaken, it should be more like:
To define validation blocks just include a custom 'validate' method within the validation group, like so