Argument Error: The scope body needs to be callable

前端 未结 4 1028
南方客
南方客 2020-12-24 01:24

I\'m working through the \'Ruby On Rails 3 Essential Training\' and have received a problem when using name scopes. When finding records and using queries withing the Rails

4条回答
  •  礼貌的吻别
    2020-12-24 02:07

    I got the same error , while before my solution I had a space between where and ( like below

    scope :registered , -> { where ( place_id:  :place_id , is_registered: :true ) }
    

    after i removed the space between where and ( like below i made my page working

    scope :registered , -> { where( place_id:  :place_id , is_registered: :true ) }
    

提交回复
热议问题