I have a 'validate_on_create' statement in one of my controllers, which I would like all my seed data to leave. What are some solutions, so leave the recognition made in my BJ file. My current solution Every time I run Rack DB, it is certifying: seeds Is anything more clever?
Did you assume that the validate_on_create method to add a feature to the model?
Example:
Class MyModel & lt; ActiveRecord :: Base attr_accessor: skip_on_create_validation def validate_on_create until skip_on_create_validation # Validation End End Mymodel.create (# skip_on_create_validation = & gt; true, ......)
Comments
Post a Comment