In rails, I have a migration to modify production data to fit the new validation rules. There are several errors, so I have two different migrations (they can be one, but still two aspects that are performed separately), one of them does not work, because the other check is not met and vice versa
validation is new in type model
validates_uniqueness_of :job_id , :scope => [:day, :time, :user_id , :overtime, :comments] , :message => "Duplicate Entry, Please check your data" validates_uniqueness_of :job_id , :scope => [:day, :user_id, :comments] , :message => "Has 2 Entires for same job on same day with same comment"
- this is a completely new look and the other just changed from 24 to 8 and added a bit of overtime
validates_numericality_of :time, :greater_than => 0, :less_than_or_equal_to => 8 validates_numericality_of :overtime, :greater_than_or_equal_to => 0, :less_than_or_equal_to => 16
I tried reordering migrations, and I got the opposite result.
Is there a way besides updating the database and then updating this file to get around this? or is that what i should do?
loosecannon
source share