I have a ActiveRecord query for example like this:
@result = stuff.limit(10)
where stuff is a active record query with where clauses, order by,
Pass parameters in Rails scope
Definition of scope
scope :name_of_scope, ->(parameter_name) {condition whatever you want to put in scope}
Calling Method
name_of_scope(parameter_name)