We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With sexy validations in Rails less redundant validations are possible.
validates :foo, :presence_on_step_or_active => {:step => :first} def active? ... end # populate with current step in controller attr_accessor :wicked_step
class PresenceOnStepOrActiveValidator < ActiveModel::Validator def validate(record) if options[:step] == record.wicked_step || record.active? record.errors.add_on_blank(options[:attributes]) end end end
wicked_step could possibly be put in a more accessible place and be set in the setup_wizard before filter.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
With sexy validations in Rails less redundant validations are possible.
wicked_step could possibly be put in a more accessible place and be set in the setup_wizard before filter.
The text was updated successfully, but these errors were encountered: