Class: AbuseReportsFinder
- Inherits:
-
Object
- Object
- AbuseReportsFinder
- Defined in:
- app/finders/abuse_reports_finder.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(params = {}) ⇒ AbuseReportsFinder
constructor
A new instance of AbuseReportsFinder.
Constructor Details
#initialize(params = {}) ⇒ AbuseReportsFinder
Returns a new instance of AbuseReportsFinder.
6 7 8 |
# File 'app/finders/abuse_reports_finder.rb', line 6 def initialize(params = {}) @params = params end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
4 5 6 |
# File 'app/finders/abuse_reports_finder.rb', line 4 def params @params end |
Instance Method Details
#execute ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'app/finders/abuse_reports_finder.rb', line 10 def execute reports = AbuseReport.all reports = reports.by_user(params[:user_id]) if params[:user_id].present? reports.with_order_id_desc .with_users .page(params[:page]) end |