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

Ansible warning on jinja2 braces on when -

Parsing a protocol message from Go by Java -

javascript - Replicate keyboard event with html button -