Class: Workarea::Admin::Discounts::OrderTotalViewModel
- Inherits:
-
Workarea::Admin::DiscountViewModel
- Object
- ApplicationViewModel
- Workarea::Admin::DiscountViewModel
- Workarea::Admin::Discounts::OrderTotalViewModel
- Defined in:
- app/view_models/workarea/admin/discounts/order_total_view_model.rb
Instance Method Summary collapse
Methods inherited from Workarea::Admin::DiscountViewModel
#amount_type_options, #application_options, #code_list_options, #compatible_discounts, #excluded_categories, #excluded_products, #insights, #max_applications_options, #order_total_operator_options, #promo_code_options, #rules_summary, #selected_application_option, #selected_promo_code_option, #slug, #timeline, #workflow_params, wrap
Methods included from CommentableViewModel
#comment_count, #comments, #has_comments?, #new_comments_for?, #subscribed_users
Instance Method Details
#condition_options ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/view_models/workarea/admin/discounts/order_total_view_model.rb', line 5 def [ [ t('workarea.admin.pricing_discounts.options.for_everyone'), nil ], [ t('workarea.admin.pricing_discounts.options.when_order_total'), 'order_total' ], [ t('workarea.admin.pricing_discounts.options.when_user_is_tagged'), 'user_tag' ], [ t('workarea.admin.pricing_discounts.options.when_in_segment'), 'segments' ] ] end |
#selected_condition_option ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'app/view_models/workarea/admin/discounts/order_total_view_model.rb', line 26 def selected_condition_option if order_total? 'order_total' elsif user_tag? 'user_tag' elsif active_segment_ids.present? 'segments' end end |