ruby - Rails: Scoped association resulting in error -


this question has answer here:

in model have following scoped association:

customer.rb:38

has_many :payment_informations, class_name: 'customer::paymentinformation', dependent: :destroy, -> { order(position: :asc) } 

error:

syntax error, unexpected '\n', expecting =>

--

what doing wrong here? error occurs when scoping asscoiation.

try

has_many :payment_informations, -> { order(position: :asc) }, class_name: 'customer::paymentinformation', dependent: :destroy 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -