Class: SpreeCmCommissioner::OperatorGuestJsonGzips::Create
- Inherits:
-
Object
- Object
- SpreeCmCommissioner::OperatorGuestJsonGzips::Create
- Includes:
- Spree::ServiceModule::Base
- Defined in:
- app/services/spree_cm_commissioner/operator_guest_json_gzips/create.rb
Instance Method Summary collapse
-
#call(exportable:, role: nil, force_create: false, options: {}) ⇒ Object
role: nil = unrestricted (full event); a Spree::Role (check_in type) scopes the file to that role's tickets (see User#check_in_role_for).
Instance Method Details
#call(exportable:, role: nil, force_create: false, options: {}) ⇒ Object
role: nil = unrestricted (full event); a Spree::Role (check_in type) scopes the file to that
role's tickets (see User#check_in_role_for). One role, one export.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/services/spree_cm_commissioner/operator_guest_json_gzips/create.rb', line 10 def call(exportable:, role: nil, force_create: false, options: {}) unless force_create recent_export = find_recent_export(exportable, role) return success(recent_export) if recent_export end export = build_export(exportable, role, ) if export.save success(export) else failure(export, export.errors..to_sentence) end end |