-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
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
enabling validations #42
Comments
I concur. It's sort of a big deal for us because we are seeding data as a migration process from an old system - so we can find any bad data naturally. |
Agree. Just bump into that problem. I cannot use before_validation callbacks to process some properties :( |
@svyatov , @DaveSanders @adamwong246 , as a work around I am using this https://gist.github.com/PratheepV/504f39176ee43032b5ec Thanks, |
Another way is to create # Reason: seed_fu has no validations and there is no option to turn it on.
# But when using seeds on production/stages we want to be sure that generated data are correct.
module SeedFuValidations
def seed(*args)
super.each(&:validate!)
end
def seed_once(*args)
super.each(&:validate!)
end
end
ActiveRecord::Base.extend(SeedFuValidations) |
It would be great to set this as switch in configuration :). |
I noticed that using seed(), validations are skipped. Is there any way to override this? I want my validations to run on seed().
The text was updated successfully, but these errors were encountered: