You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: