Pass instance to I18n when translating error #14141

Closed
wants to merge 1 commit into from

4 participants

@printercu

It'll allow to do like this:

# inside model that has .title
validates_numericality_of :quantity, greater_then: 0,
  title: ->(h) { h[:instance].title }

with translations

errors:
  models:
    my_model:
      greater_then: of %{title} must be greater than %{count}
@printercu

closed with #24119

@printercu printercu closed this Apr 10, 2016
@printercu printercu reopened this Apr 10, 2016
@prathamesh-sonpatki
Ruby on Rails member

@printercu Can this be closed now after #24119?

@printercu printercu closed this Apr 10, 2016
@printercu

Yep, occasionally reopened

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment