Looking for a solution how to write translation record in I18n yml file for the following case:
class SomeClass < ActiveRecord::Base
validate: stock_avail
def stock_avail
# errors is an instance of ActiveModel::Errors
errors.add(:quantity, I18n.t('validation.stock_exceeded'))
# how to write a translation for :quantity part ?
end
end
errors.add
is documented here.
How and where can I write translation for :quantity
attribute of error message ?
Thanks.