I'm using the has_scope gem.
I want to scope the last x number of items in an array of Articles in my database
something like this:
scope :last_few_items, -> num { Article.last(num) }
so in my querystring I could say www.bla.com?last_few_items=2 to return the last 2 items of an array
but all the examples I see for has_scope use this syntax:
scope :scope_name, -> vartopass { where(attribute_val: vartopass)}
wher 'attribute_val' are all attributes from my database... so I'm not really sure how to get what I want... aside from making a new route and a new controller that defines @articles = Article.last(2) or something like that