2019-01-28 07:19:53 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class UsersStarProjectsFinder
|
|
|
|
include CustomAttributesFilter
|
|
|
|
|
|
|
|
attr_accessor :params
|
|
|
|
|
|
|
|
def initialize(params = {})
|
|
|
|
@params = params
|
|
|
|
end
|
|
|
|
|
|
|
|
def execute
|
|
|
|
stars = UsersStarProject.all.order_id_desc
|
|
|
|
stars = by_search(stars)
|
|
|
|
|
|
|
|
stars
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def by_search(items)
|
2019-01-28 12:51:49 -05:00
|
|
|
params[:search].present? ? items.search(params[:search]) : items
|
2019-01-28 07:19:53 -05:00
|
|
|
end
|
|
|
|
end
|