Class: Spree::UsersNotConvertedReport
- Defined in:
- app/reports/spree/users_not_converted_report.rb
Defined Under Namespace
Classes: Result
Constant Summary collapse
- DEFAULT_SORTABLE_ATTRIBUTE =
:user_email
- HEADERS =
{ user_email: :string, signup_date: :date }
- SEARCH_ATTRIBUTES =
{ start_date: :users_created_from, end_date: :users_created_till, email_cont: :email }
- SORTABLE_ATTRIBUTES =
[:user_email, :signup_date]
Constants inherited from Report
Instance Attribute Summary
Attributes inherited from Report
#current_page, #paginate, #records_per_page, #reporting_period, #search, #sortable_attribute, #sortable_type, #total_records
Instance Method Summary collapse
- #paginated? ⇒ Boolean
- #paginated_report_query ⇒ Object
- #record_count_query ⇒ Object
- #report_query ⇒ Object
Methods inherited from Report
#active_record_sort, deeplink, #deeplink_properties, #generate, #get_results, #header_sorted?, #initialize, #name, #pagination_required?, #set_sortable_attributes, #time_scale_columns, #time_scale_columns_to_s, #time_scale_selects, #total_pages
Constructor Details
This class inherits a constructor from Spree::Report
Instance Method Details
#paginated? ⇒ Boolean
8 9 10 |
# File 'app/reports/spree/users_not_converted_report.rb', line 8 def paginated? true end |
#paginated_report_query ⇒ Object
22 23 24 25 26 |
# File 'app/reports/spree/users_not_converted_report.rb', line 22 def paginated_report_query report_query .limit(records_per_page) .offset(current_page) end |
#record_count_query ⇒ Object
28 29 30 |
# File 'app/reports/spree/users_not_converted_report.rb', line 28 def record_count_query Spree::Report::QueryFragments.from_subquery(report_query).project(Arel.star.count) end |
#report_query ⇒ Object
32 33 34 35 36 37 38 39 40 41 |
# File 'app/reports/spree/users_not_converted_report.rb', line 32 def report_query Spree::User .where(created_at: reporting_period) .where(Spree::User.arel_table[:email].matches(email_search)) .left_joins(:spree_orders) .where(spree_orders: { completed_at: nil, number: nil }) .select( "spree_users.email as user_email", "spree_users.created_at as signup_date") end |