Created
February 9, 2011 15:54
-
-
Save Electron-libre/818693 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def integrity | |
if time_credit? | |
errors.add(:base, I18n.t(:establishment_cost_empty, :scope => [:models, :destinations, :integrity])) unless establishment_cost? | |
elsif establishment_cost? | |
errors.add(:base, I18n.t(:time_credit_empty, :scope => [:models, :destinations, :integrity])) unless time_credit? | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
unless (time_credit? && cost_empty?) || !(time_credit? || cost_empty?)
field_in_error = time_credit.empt? ? :time_credit : :cost_empty
errors.add(field_in_error, I18n.t(field_in_error, :scope => ...))
end