Answers for "rails scope that runs method"

1

rails scopes

class Book < ApplicationRecord
  scope :costs_more_than, ->(amount) { where("price > ?", amount) }
end
Posted by: Guest on April-21-2021

Code answers related to "rails scope that runs method"

Browse Popular Code Answers by Language