solidus_core 2.4.2 → 2.5.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +1 -5
- data/Rakefile +23 -6
- data/app/helpers/spree/base_helper.rb +15 -10
- data/app/helpers/spree/checkout_helper.rb +1 -1
- data/app/helpers/spree/products_helper.rb +2 -2
- data/app/mailers/spree/carton_mailer.rb +2 -2
- data/app/mailers/spree/order_mailer.rb +4 -4
- data/app/mailers/spree/reimbursement_mailer.rb +2 -2
- data/app/mailers/spree/test_mailer.rb +1 -1
- data/app/models/concerns/spree/adjustment_source.rb +17 -11
- data/app/models/concerns/spree/calculated_adjustments.rb +2 -2
- data/app/models/spree/ability.rb +1 -1
- data/app/models/spree/address.rb +7 -0
- data/app/models/spree/adjustment.rb +6 -2
- data/app/models/spree/calculator.rb +1 -1
- data/app/models/spree/calculator/flexi_rate.rb +1 -0
- data/app/models/spree/calculator/free_shipping.rb +2 -0
- data/app/models/spree/calculator/percent_on_line_item.rb +6 -6
- data/app/models/spree/calculator/percent_per_item.rb +2 -0
- data/app/models/spree/calculator/returns/default_refund_amount.rb +4 -4
- data/app/models/spree/calculator/shipping/flat_percent_item_total.rb +1 -0
- data/app/models/spree/calculator/shipping/flat_rate.rb +1 -0
- data/app/models/spree/calculator/shipping/flexi_rate.rb +1 -0
- data/app/models/spree/calculator/shipping/per_item.rb +1 -0
- data/app/models/spree/calculator/shipping/price_sack.rb +1 -0
- data/app/models/spree/classification.rb +1 -1
- data/app/models/spree/customer_return.rb +1 -1
- data/app/models/spree/inventory_unit.rb +8 -2
- data/app/models/spree/log_entry.rb +0 -11
- data/app/models/spree/order.rb +31 -16
- data/app/models/spree/order_contents.rb +0 -14
- data/app/models/spree/order_shipping.rb +0 -5
- data/app/models/spree/order_updater.rb +0 -4
- data/app/models/spree/payment.rb +6 -1
- data/app/models/spree/payment/processing.rb +4 -4
- data/app/models/spree/payment_method.rb +8 -3
- data/app/models/spree/payment_method/credit_card.rb +1 -1
- data/app/models/spree/payment_method/store_credit.rb +4 -4
- data/app/models/spree/price.rb +7 -1
- data/app/models/spree/product.rb +34 -6
- data/app/models/spree/product/scopes.rb +2 -2
- data/app/models/spree/promotion.rb +1 -2
- data/app/models/spree/promotion/actions/create_adjustment.rb +3 -2
- data/app/models/spree/promotion/actions/create_item_adjustments.rb +7 -8
- data/app/models/spree/promotion/actions/free_shipping.rb +1 -1
- data/app/models/spree/promotion/rules/taxon.rb +25 -24
- data/app/models/spree/promotion_action.rb +7 -1
- data/app/models/spree/promotion_chooser.rb +1 -1
- data/app/models/spree/promotion_code.rb +3 -3
- data/app/models/spree/promotion_handler/coupon.rb +8 -29
- data/app/models/spree/promotion_rule.rb +1 -1
- data/app/models/spree/refund.rb +3 -3
- data/app/models/spree/reimbursement.rb +1 -1
- data/app/models/spree/return_authorization.rb +2 -2
- data/app/models/spree/return_item.rb +3 -3
- data/app/models/spree/return_item/eligibility_validator/base_validator.rb +2 -2
- data/app/models/spree/return_item/eligibility_validator/inventory_shipped.rb +1 -1
- data/app/models/spree/return_item/eligibility_validator/no_reimbursements.rb +1 -1
- data/app/models/spree/return_item/eligibility_validator/order_completed.rb +1 -1
- data/app/models/spree/return_item/eligibility_validator/rma_required.rb +1 -1
- data/app/models/spree/return_item/eligibility_validator/time_since_purchase.rb +1 -1
- data/app/models/spree/shipment.rb +16 -6
- data/app/models/spree/shipping_method.rb +7 -0
- data/app/models/spree/shipping_rate.rb +6 -6
- data/app/models/spree/shipping_rate_tax.rb +2 -2
- data/app/models/spree/stock/availability_validator.rb +2 -2
- data/app/models/spree/stock/estimator.rb +9 -1
- data/app/models/spree/stock/inventory_unit_builder.rb +1 -2
- data/app/models/spree/stock/inventory_validator.rb +2 -2
- data/app/models/spree/stock/package.rb +1 -1
- data/app/models/spree/stock/simple_coordinator.rb +2 -2
- data/app/models/spree/stock_item.rb +6 -0
- data/app/models/spree/stock_location.rb +2 -2
- data/app/models/spree/store_credit.rb +19 -12
- data/app/models/spree/store_credit_category.rb +1 -1
- data/app/models/spree/store_credit_event.rb +7 -1
- data/app/models/spree/tax/shipping_rate_taxer.rb +1 -1
- data/app/models/spree/tax_calculator/shipping_rate.rb +12 -3
- data/app/models/spree/tax_rate.rb +10 -3
- data/app/models/spree/taxon.rb +14 -4
- data/app/models/spree/taxonomy.rb +1 -1
- data/app/models/spree/unit_cancel.rb +1 -1
- data/app/models/spree/variant.rb +33 -1
- data/app/models/spree/variant/price_selector.rb +1 -1
- data/app/models/spree/variant/pricing_options.rb +1 -1
- data/app/models/spree/variant/scopes.rb +1 -1
- data/app/models/spree/variant/vat_price_generator.rb +1 -1
- data/app/views/spree/carton_mailer/shipped_email.html.erb +6 -6
- data/app/views/spree/carton_mailer/shipped_email.text.erb +6 -6
- data/app/views/spree/order_mailer/cancel_email.html.erb +5 -5
- data/app/views/spree/order_mailer/cancel_email.text.erb +5 -5
- data/app/views/spree/order_mailer/confirm_email.html.erb +9 -9
- data/app/views/spree/order_mailer/confirm_email.text.erb +9 -9
- data/app/views/spree/order_mailer/inventory_cancellation_email.html.erb +3 -3
- data/app/views/spree/order_mailer/inventory_cancellation_email.text.erb +3 -3
- data/app/views/spree/promotion_code_batch_mailer/promotion_code_batch_errored.text.erb +1 -1
- data/app/views/spree/promotion_code_batch_mailer/promotion_code_batch_finished.text.erb +1 -1
- data/app/views/spree/reimbursement_mailer/reimbursement_email.html.erb +5 -5
- data/app/views/spree/reimbursement_mailer/reimbursement_email.text.erb +5 -5
- data/app/views/spree/shared/_error_messages.html.erb +2 -2
- data/app/views/spree/test_mailer/test_email.html.erb +2 -2
- data/app/views/spree/test_mailer/test_email.text.erb +2 -2
- data/config/initializers/assets.rb +3 -1
- data/config/locales/en.yml +44 -48
- data/db/default/spree/store_credit.rb +1 -1
- data/db/default/spree/stores.rb +7 -8
- data/db/migrate/20160101010000_solidus_one_four.rb +4 -46
- data/db/migrate/20170317035819_add_lft_and_rgt_indexes_to_taxons.rb +6 -0
- data/db/migrate/20170319191942_remove_order_id_from_inventory_units.rb +28 -0
- data/db/migrate/20170608074534_rename_bogus_gateways.rb +4 -2
- data/db/migrate/20170831201542_remove_default_tax_from_spree_zones.rb +1 -1
- data/lib/generators/spree/custom_user/custom_user_generator.rb +11 -22
- data/lib/generators/spree/install/install_generator.rb +10 -5
- data/lib/spree/app_configuration.rb +103 -5
- data/lib/spree/core.rb +3 -2
- data/lib/spree/core/active_merchant_dependencies.rb +11 -0
- data/lib/spree/core/controller_helpers/auth.rb +3 -1
- data/lib/spree/core/controller_helpers/common.rb +3 -7
- data/lib/spree/core/engine.rb +18 -100
- data/lib/spree/core/environment.rb +3 -3
- data/lib/spree/core/importer/order.rb +0 -1
- data/lib/spree/core/permalinks.rb +9 -15
- data/lib/spree/core/product_filters.rb +5 -3
- data/lib/spree/core/role_configuration.rb +23 -7
- data/lib/spree/core/search/base.rb +16 -13
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/paranoia_deprecations.rb +19 -0
- data/lib/spree/permission_sets.rb +0 -4
- data/lib/spree/permitted_attributes.rb +0 -3
- data/lib/spree/preferences/preferable.rb +70 -34
- data/lib/spree/preferences/preferable_class_methods.rb +22 -0
- data/lib/spree/testing_support/authorization_helpers.rb +2 -0
- data/lib/spree/testing_support/common_rake.rb +0 -1
- data/lib/spree/testing_support/dummy_app.rb +100 -0
- data/lib/spree/testing_support/dummy_app/assets/javascripts/spree/backend/all.js +10 -0
- data/lib/spree/testing_support/dummy_app/assets/javascripts/spree/frontend/all.js +10 -0
- data/lib/spree/testing_support/dummy_app/assets/stylesheets/spree/backend/all.css +9 -0
- data/lib/spree/testing_support/dummy_app/assets/stylesheets/spree/frontend/all.css +9 -0
- data/lib/spree/testing_support/dummy_app/database.yml +31 -0
- data/lib/spree/testing_support/dummy_app/migrations.rb +35 -0
- data/lib/spree/testing_support/dummy_app/rake_tasks.rb +60 -0
- data/lib/spree/testing_support/dummy_app/views/layouts/application.html.erb +1 -0
- data/lib/spree/testing_support/factories.rb +1 -1
- data/lib/spree/testing_support/factories/address_factory.rb +2 -2
- data/lib/spree/testing_support/factories/adjustment_factory.rb +2 -2
- data/lib/spree/testing_support/factories/adjustment_reason_factory.rb +1 -1
- data/lib/spree/testing_support/factories/calculator_factory.rb +1 -1
- data/lib/spree/testing_support/factories/carton_factory.rb +1 -1
- data/lib/spree/testing_support/factories/country_factory.rb +1 -1
- data/lib/spree/testing_support/factories/credit_card_factory.rb +1 -1
- data/lib/spree/testing_support/factories/customer_return_factory.rb +2 -2
- data/lib/spree/testing_support/factories/image_factory.rb +1 -1
- data/lib/spree/testing_support/factories/inventory_unit_factory.rb +13 -4
- data/lib/spree/testing_support/factories/line_item_factory.rb +1 -1
- data/lib/spree/testing_support/factories/option_type_factory.rb +1 -1
- data/lib/spree/testing_support/factories/option_value_factory.rb +1 -1
- data/lib/spree/testing_support/factories/order_factory.rb +5 -1
- data/lib/spree/testing_support/factories/order_promotion_factory.rb +1 -1
- data/lib/spree/testing_support/factories/payment_factory.rb +1 -1
- data/lib/spree/testing_support/factories/payment_method_factory.rb +1 -1
- data/lib/spree/testing_support/factories/price_factory.rb +1 -1
- data/lib/spree/testing_support/factories/product_factory.rb +1 -1
- data/lib/spree/testing_support/factories/product_option_type_factory.rb +1 -1
- data/lib/spree/testing_support/factories/product_property_factory.rb +1 -1
- data/lib/spree/testing_support/factories/promotion_category_factory.rb +1 -1
- data/lib/spree/testing_support/factories/promotion_code_factory.rb +2 -2
- data/lib/spree/testing_support/factories/promotion_factory.rb +1 -1
- data/lib/spree/testing_support/factories/property_factory.rb +1 -1
- data/lib/spree/testing_support/factories/refund_factory.rb +1 -1
- data/lib/spree/testing_support/factories/refund_reason_factory.rb +1 -1
- data/lib/spree/testing_support/factories/reimbursement_factory.rb +1 -1
- data/lib/spree/testing_support/factories/reimbursement_type_factory.rb +1 -1
- data/lib/spree/testing_support/factories/return_authorization_factory.rb +1 -1
- data/lib/spree/testing_support/factories/return_item_factory.rb +1 -1
- data/lib/spree/testing_support/factories/return_reason_factory.rb +1 -1
- data/lib/spree/testing_support/factories/role_factory.rb +1 -1
- data/lib/spree/testing_support/factories/shipment_factory.rb +1 -2
- data/lib/spree/testing_support/factories/shipping_category_factory.rb +1 -1
- data/lib/spree/testing_support/factories/shipping_method_factory.rb +2 -2
- data/lib/spree/testing_support/factories/shipping_rate_factory.rb +1 -1
- data/lib/spree/testing_support/factories/state_factory.rb +1 -7
- data/lib/spree/testing_support/factories/stock_item_factory.rb +1 -1
- data/lib/spree/testing_support/factories/stock_location_factory.rb +1 -1
- data/lib/spree/testing_support/factories/stock_movement_factory.rb +1 -1
- data/lib/spree/testing_support/factories/stock_package_factory.rb +1 -1
- data/lib/spree/testing_support/factories/store_credit_category_factory.rb +1 -1
- data/lib/spree/testing_support/factories/store_credit_event_factory.rb +1 -1
- data/lib/spree/testing_support/factories/store_credit_factory.rb +1 -1
- data/lib/spree/testing_support/factories/store_credit_type_factory.rb +2 -2
- data/lib/spree/testing_support/factories/store_credit_update_reason_factory.rb +1 -1
- data/lib/spree/testing_support/factories/store_factory.rb +1 -1
- data/lib/spree/testing_support/factories/tax_category_factory.rb +1 -2
- data/lib/spree/testing_support/factories/tax_rate_factory.rb +1 -1
- data/lib/spree/testing_support/factories/taxon_factory.rb +1 -1
- data/lib/spree/testing_support/factories/taxonomy_factory.rb +1 -1
- data/lib/spree/testing_support/factories/user_factory.rb +4 -10
- data/lib/spree/testing_support/factories/variant_factory.rb +1 -1
- data/lib/spree/testing_support/factories/variant_property_rule_condition_factory.rb +1 -1
- data/lib/spree/testing_support/factories/variant_property_rule_factory.rb +1 -1
- data/lib/spree/testing_support/factories/variant_property_rule_value_factory.rb +1 -1
- data/lib/spree/testing_support/factories/zone_factory.rb +2 -4
- data/lib/spree/testing_support/flash.rb +2 -2
- data/lib/spree/testing_support/order_walkthrough.rb +9 -9
- data/lib/spree/testing_support/preferences.rb +4 -0
- data/lib/spree/testing_support/sequences.rb +3 -12
- data/solidus_core.gemspec +12 -8
- data/spec/helpers/base_helper_spec.rb +19 -3
- data/spec/helpers/products_helper_spec.rb +1 -1
- data/spec/lib/calculated_adjustments_spec.rb +20 -0
- data/spec/lib/i18n_spec.rb +4 -69
- data/spec/lib/search/base_spec.rb +1 -0
- data/spec/lib/search/variant_spec.rb +4 -4
- data/spec/lib/spree/core/controller_helpers/pricing_spec.rb +6 -6
- data/spec/lib/spree/core/importer/order_spec.rb +2 -2
- data/spec/lib/spree/core/role_configuration_spec.rb +6 -9
- data/spec/lib/spree/core/testing_support/factories/order_factory_spec.rb +12 -8
- data/spec/lib/spree/core/testing_support/factories/reimbursement_factory_spec.rb +1 -1
- data/spec/lib/spree/core/testing_support/factories/store_credit_category_factory_spec.rb +1 -1
- data/spec/mailers/carton_mailer_spec.rb +3 -7
- data/spec/mailers/order_mailer_spec.rb +7 -11
- data/spec/mailers/reimbursement_mailer_spec.rb +1 -5
- data/spec/mailers/test_mailer_spec.rb +0 -4
- data/spec/models/spree/ability_spec.rb +2 -1
- data/spec/models/spree/address_spec.rb +32 -19
- data/spec/models/spree/app_configuration_spec.rb +1 -1
- data/spec/models/spree/calculator/distributed_amount_spec.rb +1 -1
- data/spec/models/spree/calculator/percent_on_line_item_spec.rb +8 -10
- data/spec/models/spree/calculator/percent_per_item_spec.rb +4 -4
- data/spec/models/spree/calculator/refunds/default_refund_amount_spec.rb +10 -3
- data/spec/models/spree/classification_spec.rb +19 -0
- data/spec/models/spree/credit_card_spec.rb +1 -1
- data/spec/models/spree/customer_return_spec.rb +17 -6
- data/spec/models/spree/distributed_amounts_handler_spec.rb +1 -1
- data/spec/models/spree/exchange_spec.rb +1 -1
- data/spec/models/spree/inventory_unit_spec.rb +3 -7
- data/spec/models/spree/line_item_spec.rb +6 -6
- data/spec/models/spree/option_value_spec.rb +11 -6
- data/spec/models/spree/order/callbacks_spec.rb +2 -2
- data/spec/models/spree/order/checkout_spec.rb +31 -31
- data/spec/models/spree/order/risk_assessment_spec.rb +9 -9
- data/spec/models/spree/order_contents_spec.rb +1 -9
- data/spec/models/spree/order_inventory_spec.rb +2 -2
- data/spec/models/spree/order_mutex_spec.rb +3 -1
- data/spec/models/spree/order_shipping_spec.rb +7 -4
- data/spec/models/spree/order_spec.rb +36 -13
- data/spec/models/spree/order_taxation_spec.rb +7 -7
- data/spec/models/spree/order_updater_spec.rb +6 -4
- data/spec/models/spree/payment/cancellation_spec.rb +1 -1
- data/spec/models/spree/payment_create_spec.rb +2 -2
- data/spec/models/spree/payment_method/store_credit_spec.rb +13 -13
- data/spec/models/spree/payment_spec.rb +23 -4
- data/spec/models/spree/preferences/preferable_spec.rb +44 -0
- data/spec/models/spree/preferences/statically_configurable_spec.rb +1 -0
- data/spec/models/spree/price_spec.rb +6 -4
- data/spec/models/spree/product/scopes_spec.rb +1 -1
- data/spec/models/spree/product_spec.rb +49 -9
- data/spec/models/spree/promotion/actions/create_adjustment_spec.rb +13 -3
- data/spec/models/spree/promotion/actions/create_item_adjustments_spec.rb +146 -134
- data/spec/models/spree/promotion/actions/create_quantity_adjustments_spec.rb +6 -6
- data/spec/models/spree/promotion/rules/taxon_spec.rb +14 -14
- data/spec/models/spree/promotion_code_spec.rb +31 -19
- data/spec/models/spree/promotion_handler/coupon_spec.rb +42 -17
- data/spec/models/spree/promotion_handler/shipping_spec.rb +1 -6
- data/spec/models/spree/promotion_spec.rb +14 -14
- data/spec/models/spree/refund_spec.rb +1 -1
- data/spec/models/spree/return_item/eligibility_validator/inventory_shipped_spec.rb +1 -1
- data/spec/models/spree/return_item/eligibility_validator/no_reimbursements_spec.rb +1 -1
- data/spec/models/spree/return_item/eligibility_validator/order_completed_spec.rb +3 -2
- data/spec/models/spree/return_item/eligibility_validator/rma_required_spec.rb +1 -1
- data/spec/models/spree/return_item/eligibility_validator/time_since_purchase_spec.rb +2 -2
- data/spec/models/spree/return_item_spec.rb +6 -6
- data/spec/models/spree/shipment_spec.rb +14 -10
- data/spec/models/spree/shipping_manifest_spec.rb +22 -9
- data/spec/models/spree/shipping_method_spec.rb +9 -5
- data/spec/models/spree/stock/availability_spec.rb +16 -2
- data/spec/models/spree/stock/estimator_spec.rb +11 -12
- data/spec/models/spree/stock/inventory_unit_builder_spec.rb +0 -4
- data/spec/models/spree/stock/package_spec.rb +3 -2
- data/spec/models/spree/stock/simple_coordinator_spec.rb +1 -24
- data/spec/models/spree/stock_item_spec.rb +6 -6
- data/spec/models/spree/stock_location_spec.rb +16 -3
- data/spec/models/spree/store_credit_spec.rb +12 -6
- data/spec/models/spree/tax/taxation_integration_spec.rb +6 -6
- data/spec/models/spree/tax_calculator/default_spec.rb +7 -7
- data/spec/models/spree/taxon_spec.rb +42 -19
- data/spec/models/spree/variant/vat_price_generator_spec.rb +1 -1
- data/spec/models/spree/variant_spec.rb +69 -11
- data/spec/rails_helper.rb +7 -13
- data/spec/spec_helper.rb +3 -12
- data/spec/support/concerns/default_price.rb +1 -1
- data/spec/support/dummy_ability.rb +2 -0
- metadata +144 -73
- data/Gemfile +0 -3
- data/app/models/spree/order_stock_location.rb +0 -15
- data/app/models/spree/stock_transfer.rb +0 -110
- data/app/models/spree/transfer_item.rb +0 -54
- data/lib/generators/spree/custom_user/templates/initializer.rb.tt +0 -1
- data/lib/spree/permission_sets/restricted_stock_transfer_display.rb +0 -17
- data/lib/spree/permission_sets/restricted_stock_transfer_management.rb +0 -52
- data/lib/spree/permission_sets/stock_transfer_display.rb +0 -10
- data/lib/spree/permission_sets/stock_transfer_management.rb +0 -11
- data/lib/spree/testing_support/factories/stock_transfer_factory.rb +0 -28
- data/lib/spree/testing_support/i18n.rb +0 -97
- data/spec/lib/spree/core/testing_support/factories/stock_transfer_factory_spec.rb +0 -12
- data/spec/models/spree/order_stock_location_spec.rb +0 -18
- data/spec/models/spree/permission_sets/restricted_stock_transfer_display_spec.rb +0 -49
- data/spec/models/spree/permission_sets/restricted_stock_transfer_management_spec.rb +0 -218
- data/spec/models/spree/permission_sets/stock_transfer_display_spec.rb +0 -23
- data/spec/models/spree/permission_sets/stock_transfer_management_spec.rb +0 -23
- data/spec/models/spree/stock_transfer_spec.rb +0 -308
- data/spec/models/spree/transfer_item_spec.rb +0 -275
- data/spec/support/test_gateway.rb +0 -2
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
class RemoveOrderIdFromInventoryUnits < ActiveRecord::Migration[5.0]
|
|
2
|
+
class InconsistentInventoryUnitError < StandardError; end
|
|
3
|
+
|
|
4
|
+
class InventoryUnit < ActiveRecord::Base
|
|
5
|
+
self.table_name = "spree_inventory_units"
|
|
6
|
+
belongs_to :shipment
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
class Shipment < ActiveRecord::Base
|
|
10
|
+
self.table_name = "spree_shipments"
|
|
11
|
+
has_many :inventory_units
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def up
|
|
15
|
+
if InventoryUnit.
|
|
16
|
+
joins(:shipment).
|
|
17
|
+
where.not(
|
|
18
|
+
'spree_inventory_units.order_id = spree_shipments.order_id'
|
|
19
|
+
).exists?
|
|
20
|
+
raise InconsistentInventoryUnitError, "You have inventory units with inconsistent order references. Please fix those before running this migration"
|
|
21
|
+
end
|
|
22
|
+
remove_column :spree_inventory_units, :order_id
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def down
|
|
26
|
+
add_reference :spree_inventory_units, :order, index: true
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
class RenameBogusGateways < ActiveRecord::Migration[5.0]
|
|
2
2
|
def up
|
|
3
|
+
require 'solidus/migrations/rename_gateways'
|
|
3
4
|
say_with_time 'Renaming bogus gateways into payment methods' do
|
|
4
|
-
|
|
5
|
+
Solidus::Migrations::RenameGateways.new.up
|
|
5
6
|
end
|
|
6
7
|
end
|
|
7
8
|
|
|
8
9
|
def down
|
|
10
|
+
require 'solidus/migrations/rename_gateways'
|
|
9
11
|
say_with_time 'Renaming bogus payment methods into gateways' do
|
|
10
|
-
|
|
12
|
+
Solidus::Migrations::RenameGateways.new.down
|
|
11
13
|
end
|
|
12
14
|
end
|
|
13
15
|
end
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
+
require 'rails/generators/active_record/migration'
|
|
2
|
+
|
|
1
3
|
module Spree
|
|
2
4
|
class CustomUserGenerator < Rails::Generators::NamedBase
|
|
3
|
-
include
|
|
4
|
-
include Rails::Generators::Migration
|
|
5
|
+
include ActiveRecord::Generators::Migration
|
|
5
6
|
|
|
6
7
|
desc "Set up a Solidus installation with a custom User class"
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
paths = superclass.source_paths
|
|
10
|
-
paths << File.expand_path('../templates', __FILE__)
|
|
11
|
-
paths.flatten
|
|
12
|
-
end
|
|
9
|
+
source_root File.expand_path('templates', File.dirname(__FILE__))
|
|
13
10
|
|
|
14
11
|
def check_for_constant
|
|
15
|
-
|
|
12
|
+
klass
|
|
16
13
|
rescue NameError
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
@shell.say "Couldn't find #{class_name}. Are you sure that this class exists within your application and is loaded?", :red
|
|
15
|
+
exit(1)
|
|
19
16
|
end
|
|
20
17
|
|
|
21
18
|
def generate
|
|
@@ -24,22 +21,14 @@ module Spree
|
|
|
24
21
|
|
|
25
22
|
file_action = File.exist?('config/initializers/spree.rb') ? :append_file : :create_file
|
|
26
23
|
send(file_action, 'config/initializers/spree.rb') do
|
|
27
|
-
|
|
28
|
-
Rails.application.config.to_prepare do
|
|
29
|
-
require_dependency 'spree/authentication_helpers'
|
|
30
|
-
end\n}
|
|
24
|
+
"Rails.application.config.to_prepare do\n require_dependency 'spree/authentication_helpers'\nend\n"
|
|
31
25
|
end
|
|
32
|
-
end
|
|
33
26
|
|
|
34
|
-
|
|
35
|
-
if ActiveRecord::Base.timestamped_migrations
|
|
36
|
-
sleep 1 # make sure to get a different migration every time
|
|
37
|
-
Time.new.utc.strftime("%Y%m%d%H%M%S")
|
|
38
|
-
else
|
|
39
|
-
"%.3d" % (current_migration_number(dirname) + 1)
|
|
40
|
-
end
|
|
27
|
+
gsub_file 'config/initializers/spree.rb', /Spree\.user_class.?=.?.+$/, %{Spree.user_class = "#{class_name}"}
|
|
41
28
|
end
|
|
42
29
|
|
|
30
|
+
private
|
|
31
|
+
|
|
43
32
|
def klass
|
|
44
33
|
class_name.constantize
|
|
45
34
|
end
|
|
@@ -4,6 +4,8 @@ require 'bundler/cli'
|
|
|
4
4
|
|
|
5
5
|
module Spree
|
|
6
6
|
class InstallGenerator < Rails::Generators::Base
|
|
7
|
+
CORE_MOUNT_ROUTE = "mount Spree::Core::Engine"
|
|
8
|
+
|
|
7
9
|
class_option :migrate, type: :boolean, default: true, banner: 'Run Solidus migrations'
|
|
8
10
|
class_option :seed, type: :boolean, default: true, banner: 'load seed data (migrations must be run)'
|
|
9
11
|
class_option :sample, type: :boolean, default: true, banner: 'load sample data (migrations must be run)'
|
|
@@ -149,23 +151,26 @@ Spree::Auth::Engine.load_seed if defined?(Spree::Auth)
|
|
|
149
151
|
end
|
|
150
152
|
|
|
151
153
|
def install_routes
|
|
152
|
-
|
|
153
|
-
|
|
154
|
+
routes_file_path = File.join('config', 'routes.rb')
|
|
155
|
+
unless File.read(routes_file_path).include? CORE_MOUNT_ROUTE
|
|
156
|
+
insert_into_file routes_file_path, after: "Rails.application.routes.draw do\n" do
|
|
157
|
+
<<-ROUTES
|
|
154
158
|
# This line mounts Solidus's routes at the root of your application.
|
|
155
159
|
# This means, any requests to URLs such as /products, will go to Spree::ProductsController.
|
|
156
160
|
# If you would like to change where this engine is mounted, simply change the :at option to something different.
|
|
157
161
|
#
|
|
158
162
|
# We ask that you don't use the :as option here, as Solidus relies on it being the default of "spree"
|
|
159
|
-
|
|
163
|
+
#{CORE_MOUNT_ROUTE}, at: '/'
|
|
160
164
|
|
|
161
|
-
|
|
165
|
+
ROUTES
|
|
166
|
+
end
|
|
162
167
|
end
|
|
163
168
|
|
|
164
169
|
unless options[:quiet]
|
|
165
170
|
puts "*" * 50
|
|
166
171
|
puts "We added the following line to your application's config/routes.rb file:"
|
|
167
172
|
puts " "
|
|
168
|
-
puts "
|
|
173
|
+
puts " #{CORE_MOUNT_ROUTE}, at: '/'"
|
|
169
174
|
end
|
|
170
175
|
end
|
|
171
176
|
|
|
@@ -18,13 +18,14 @@
|
|
|
18
18
|
require "spree/core/search/base"
|
|
19
19
|
require "spree/core/search/variant"
|
|
20
20
|
require 'spree/preferences/configuration'
|
|
21
|
+
require 'spree/core/environment'
|
|
21
22
|
|
|
22
23
|
module Spree
|
|
23
24
|
class AppConfiguration < Preferences::Configuration
|
|
24
25
|
# Alphabetized to more easily lookup particular preferences
|
|
25
26
|
|
|
26
27
|
# @!attribute [rw] address_requires_state
|
|
27
|
-
# @return [Boolean] should state/state_name be required
|
|
28
|
+
# @return [Boolean] should state/state_name be required (default: +true+)
|
|
28
29
|
preference :address_requires_state, :boolean, default: true
|
|
29
30
|
|
|
30
31
|
# @!attribute [rw] admin_interface_logo
|
|
@@ -68,11 +69,11 @@ module Spree
|
|
|
68
69
|
# and later capture has far superior error handing. VISA and MasterCard
|
|
69
70
|
# also require that shipments are sent within a certain time of the card
|
|
70
71
|
# being charged.
|
|
71
|
-
# @return [Boolean]
|
|
72
|
+
# @return [Boolean] Automatically capture the credit card (as opposed to just authorize and capture later) (default: +false+)
|
|
72
73
|
preference :auto_capture, :boolean, default: false
|
|
73
74
|
|
|
74
75
|
# @!attribute [rw] auto_capture_exchanges
|
|
75
|
-
#
|
|
76
|
+
# @return [Boolean] Automatically capture the credit card (as opposed to just authorize and capture later) (default: +false+)
|
|
76
77
|
preference :auto_capture_exchanges, :boolean, default: false
|
|
77
78
|
|
|
78
79
|
# @!attribute [rw] binary_inventory_cache
|
|
@@ -256,6 +257,15 @@ module Spree
|
|
|
256
257
|
# @return [Boolean] Indicates if stock management can be restricted by location
|
|
257
258
|
preference :can_restrict_stock_management, :boolean, default: false
|
|
258
259
|
|
|
260
|
+
# Allows restricting what currencies will be available.
|
|
261
|
+
#
|
|
262
|
+
# @!attribute [r] available_currencies
|
|
263
|
+
# @returns [Array] An array of available currencies from Money::Currency.all
|
|
264
|
+
attr_writer :available_currencies
|
|
265
|
+
def available_currencies
|
|
266
|
+
@available_currencies ||= ::Money::Currency.all
|
|
267
|
+
end
|
|
268
|
+
|
|
259
269
|
# searcher_class allows spree extension writers to provide their own Search class
|
|
260
270
|
class_name_attribute :searcher_class, default: 'Spree::Core::Search::Base'
|
|
261
271
|
|
|
@@ -287,8 +297,6 @@ module Spree
|
|
|
287
297
|
|
|
288
298
|
class_name_attribute :shipping_rate_selector_class, default: 'Spree::Stock::ShippingRateSelector'
|
|
289
299
|
|
|
290
|
-
class_name_attribute :shipping_rate_taxer_class, default: 'Spree::Tax::ShippingRateTaxer'
|
|
291
|
-
|
|
292
300
|
# Allows providing your own class for calculating taxes on a shipping rate.
|
|
293
301
|
#
|
|
294
302
|
# @!attribute [rw] shipping_rate_tax_calculator_class
|
|
@@ -364,6 +372,13 @@ module Spree
|
|
|
364
372
|
# Spree::CurrentStoreSelector
|
|
365
373
|
class_name_attribute :current_store_selector_class, default: 'Spree::StoreSelector::ByServerName'
|
|
366
374
|
|
|
375
|
+
# Allows providing your own class for creating urls on taxons
|
|
376
|
+
#
|
|
377
|
+
# @!attribute [rw] taxon_url_parametizer_class
|
|
378
|
+
# @return [Class] a class that provides a `#parameterize` method that
|
|
379
|
+
# returns a String
|
|
380
|
+
class_name_attribute :taxon_url_parametizer_class, default: 'ActiveSupport::Inflector'
|
|
381
|
+
|
|
367
382
|
# Allows providing your own class instance for generating order numbers.
|
|
368
383
|
#
|
|
369
384
|
# @!attribute [rw] order_number_generator
|
|
@@ -383,6 +398,89 @@ module Spree
|
|
|
383
398
|
@stock_configuration ||= Spree::Core::StockConfiguration.new
|
|
384
399
|
end
|
|
385
400
|
|
|
401
|
+
def roles
|
|
402
|
+
@roles ||= Spree::RoleConfiguration.new.tap do |roles|
|
|
403
|
+
roles.assign_permissions :default, ['Spree::PermissionSets::DefaultCustomer']
|
|
404
|
+
roles.assign_permissions :admin, ['Spree::PermissionSets::SuperUser']
|
|
405
|
+
end
|
|
406
|
+
end
|
|
407
|
+
|
|
408
|
+
def environment
|
|
409
|
+
@environment ||= Spree::Core::Environment.new(self).tap do |env|
|
|
410
|
+
env.calculators.shipping_methods = %w[
|
|
411
|
+
Spree::Calculator::Shipping::FlatPercentItemTotal
|
|
412
|
+
Spree::Calculator::Shipping::FlatRate
|
|
413
|
+
Spree::Calculator::Shipping::FlexiRate
|
|
414
|
+
Spree::Calculator::Shipping::PerItem
|
|
415
|
+
Spree::Calculator::Shipping::PriceSack
|
|
416
|
+
]
|
|
417
|
+
|
|
418
|
+
env.calculators.tax_rates = %w[
|
|
419
|
+
Spree::Calculator::DefaultTax
|
|
420
|
+
]
|
|
421
|
+
|
|
422
|
+
env.stock_splitters = %w[
|
|
423
|
+
Spree::Stock::Splitter::ShippingCategory
|
|
424
|
+
Spree::Stock::Splitter::Backordered
|
|
425
|
+
]
|
|
426
|
+
|
|
427
|
+
env.payment_methods = %w[
|
|
428
|
+
Spree::PaymentMethod::BogusCreditCard
|
|
429
|
+
Spree::PaymentMethod::SimpleBogusCreditCard
|
|
430
|
+
Spree::PaymentMethod::StoreCredit
|
|
431
|
+
Spree::PaymentMethod::Check
|
|
432
|
+
]
|
|
433
|
+
|
|
434
|
+
env.promotions = Spree::Promo::Environment.new.tap do |promos|
|
|
435
|
+
promos.rules = %w[
|
|
436
|
+
Spree::Promotion::Rules::ItemTotal
|
|
437
|
+
Spree::Promotion::Rules::Product
|
|
438
|
+
Spree::Promotion::Rules::User
|
|
439
|
+
Spree::Promotion::Rules::FirstOrder
|
|
440
|
+
Spree::Promotion::Rules::UserLoggedIn
|
|
441
|
+
Spree::Promotion::Rules::OneUsePerUser
|
|
442
|
+
Spree::Promotion::Rules::Taxon
|
|
443
|
+
Spree::Promotion::Rules::NthOrder
|
|
444
|
+
Spree::Promotion::Rules::OptionValue
|
|
445
|
+
Spree::Promotion::Rules::FirstRepeatPurchaseSince
|
|
446
|
+
Spree::Promotion::Rules::UserRole
|
|
447
|
+
]
|
|
448
|
+
|
|
449
|
+
promos.actions = %w[
|
|
450
|
+
Spree::Promotion::Actions::CreateAdjustment
|
|
451
|
+
Spree::Promotion::Actions::CreateItemAdjustments
|
|
452
|
+
Spree::Promotion::Actions::CreateQuantityAdjustments
|
|
453
|
+
Spree::Promotion::Actions::FreeShipping
|
|
454
|
+
]
|
|
455
|
+
|
|
456
|
+
promos.shipping_actions = %w[
|
|
457
|
+
Spree::Promotion::Actions::FreeShipping
|
|
458
|
+
]
|
|
459
|
+
end
|
|
460
|
+
|
|
461
|
+
env.calculators.promotion_actions_create_adjustments = %w[
|
|
462
|
+
Spree::Calculator::FlatPercentItemTotal
|
|
463
|
+
Spree::Calculator::FlatRate
|
|
464
|
+
Spree::Calculator::FlexiRate
|
|
465
|
+
Spree::Calculator::TieredPercent
|
|
466
|
+
Spree::Calculator::TieredFlatRate
|
|
467
|
+
]
|
|
468
|
+
|
|
469
|
+
env.calculators.promotion_actions_create_item_adjustments = %w[
|
|
470
|
+
Spree::Calculator::DistributedAmount
|
|
471
|
+
Spree::Calculator::FlatRate
|
|
472
|
+
Spree::Calculator::FlexiRate
|
|
473
|
+
Spree::Calculator::PercentOnLineItem
|
|
474
|
+
Spree::Calculator::TieredPercent
|
|
475
|
+
]
|
|
476
|
+
|
|
477
|
+
env.calculators.promotion_actions_create_quantity_adjustments = %w[
|
|
478
|
+
Spree::Calculator::PercentOnLineItem
|
|
479
|
+
Spree::Calculator::FlatRate
|
|
480
|
+
]
|
|
481
|
+
end
|
|
482
|
+
end
|
|
483
|
+
|
|
386
484
|
# Default admin VAT location
|
|
387
485
|
#
|
|
388
486
|
# An object that responds to :state_id and :country_id so it can double as a Spree::Address in
|
data/lib/spree/core.rb
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
require 'rails/all'
|
|
2
|
-
require 'active_merchant'
|
|
3
2
|
require 'acts_as_list'
|
|
4
3
|
require 'awesome_nested_set'
|
|
5
4
|
require 'cancan'
|
|
6
5
|
require 'friendly_id'
|
|
7
|
-
require 'kaminari'
|
|
6
|
+
require 'kaminari/activerecord'
|
|
8
7
|
require 'mail'
|
|
9
8
|
require 'monetize'
|
|
10
9
|
require 'paperclip'
|
|
@@ -13,6 +12,7 @@ require 'ransack'
|
|
|
13
12
|
require 'state_machines-activerecord'
|
|
14
13
|
|
|
15
14
|
require 'spree/deprecation'
|
|
15
|
+
require 'spree/paranoia_deprecations'
|
|
16
16
|
|
|
17
17
|
# This is required because ActiveModel::Validations#invalid? conflicts with the
|
|
18
18
|
# invalid state of a Payment. In the future this should be removed.
|
|
@@ -53,6 +53,7 @@ end
|
|
|
53
53
|
|
|
54
54
|
require 'spree/core/version'
|
|
55
55
|
|
|
56
|
+
require 'spree/core/active_merchant_dependencies'
|
|
56
57
|
require 'spree/core/class_constantizer'
|
|
57
58
|
require 'spree/core/environment_extension'
|
|
58
59
|
require 'spree/core/environment/calculators'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
require 'active_merchant/errors'
|
|
2
|
+
|
|
3
|
+
require 'active_merchant/billing/base'
|
|
4
|
+
|
|
5
|
+
require 'active_merchant/billing/avs_result'
|
|
6
|
+
require 'active_merchant/billing/cvv_result'
|
|
7
|
+
require 'active_merchant/billing/response'
|
|
8
|
+
|
|
9
|
+
require 'active_merchant/billing/credit_card_methods'
|
|
10
|
+
require 'active_merchant/billing/credit_card_formatting'
|
|
11
|
+
require 'active_merchant/billing/credit_card'
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require 'cancan'
|
|
2
|
+
|
|
1
3
|
module Spree
|
|
2
4
|
module Core
|
|
3
5
|
module ControllerHelpers
|
|
@@ -17,7 +19,7 @@ module Spree
|
|
|
17
19
|
|
|
18
20
|
class_attribute :unauthorized_redirect
|
|
19
21
|
self.unauthorized_redirect = -> do
|
|
20
|
-
flash[:error] =
|
|
22
|
+
flash[:error] = I18n.t('spree.authorization_failure')
|
|
21
23
|
redirect_to "/unauthorized"
|
|
22
24
|
end
|
|
23
25
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require 'carmen'
|
|
2
|
+
|
|
1
3
|
module Spree
|
|
2
4
|
module Core
|
|
3
5
|
module ControllerHelpers
|
|
@@ -41,13 +43,6 @@ module Spree
|
|
|
41
43
|
current_store.seo_title
|
|
42
44
|
end
|
|
43
45
|
|
|
44
|
-
def render_404(_exception = nil)
|
|
45
|
-
respond_to do |type|
|
|
46
|
-
type.html { render status: :not_found, file: "#{::Rails.root}/public/404", formats: [:html], layout: nil }
|
|
47
|
-
type.all { render status: :not_found, nothing: true }
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
|
|
51
46
|
private
|
|
52
47
|
|
|
53
48
|
def set_user_language
|
|
@@ -56,6 +51,7 @@ module Spree
|
|
|
56
51
|
locale ||= Rails.application.config.i18n.default_locale
|
|
57
52
|
locale ||= I18n.default_locale
|
|
58
53
|
I18n.locale = locale
|
|
54
|
+
Carmen.i18n_backend.locale = locale
|
|
59
55
|
end
|
|
60
56
|
|
|
61
57
|
# Returns which layout to render.
|
data/lib/spree/core/engine.rb
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
require 'spree/config'
|
|
2
|
+
|
|
1
3
|
module Spree
|
|
2
4
|
module Core
|
|
3
5
|
class Engine < ::Rails::Engine
|
|
6
|
+
CREDIT_CARD_NUMBER_PARAM = /payment.*source.*\.number$/
|
|
7
|
+
CREDIT_CARD_VERIFICATION_VALUE_PARAM = /payment.*source.*\.verification_value$/
|
|
8
|
+
|
|
4
9
|
isolate_namespace Spree
|
|
5
10
|
engine_name 'spree'
|
|
6
11
|
|
|
@@ -9,114 +14,27 @@ module Spree
|
|
|
9
14
|
end
|
|
10
15
|
|
|
11
16
|
initializer "spree.environment", before: :load_config_initializers do |app|
|
|
12
|
-
app.config.spree = Spree::
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
initializer "spree.default_permissions", before: :load_config_initializers do |_app|
|
|
16
|
-
Spree::RoleConfiguration.configure do |config|
|
|
17
|
-
config.assign_permissions :default, [Spree::PermissionSets::DefaultCustomer]
|
|
18
|
-
config.assign_permissions :admin, [Spree::PermissionSets::SuperUser]
|
|
19
|
-
end
|
|
17
|
+
app.config.spree = Spree::Config.environment
|
|
20
18
|
end
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
Spree::Calculator::DefaultTax
|
|
33
|
-
]
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
initializer "spree.register.stock_splitters", before: :load_config_initializers do |app|
|
|
37
|
-
app.config.spree.stock_splitters = %w[
|
|
38
|
-
Spree::Stock::Splitter::ShippingCategory
|
|
39
|
-
Spree::Stock::Splitter::Backordered
|
|
40
|
-
]
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
initializer "spree.register.payment_methods", before: :load_config_initializers do |app|
|
|
44
|
-
app.config.spree.payment_methods = %w[
|
|
45
|
-
Spree::PaymentMethod::BogusCreditCard
|
|
46
|
-
Spree::PaymentMethod::SimpleBogusCreditCard
|
|
47
|
-
Spree::PaymentMethod::StoreCredit
|
|
48
|
-
Spree::PaymentMethod::Check
|
|
49
|
-
]
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
# We need to define promotions rules here so extensions and existing apps
|
|
53
|
-
# can add their custom classes on their initializer files
|
|
54
|
-
initializer 'spree.promo.environment', before: :load_config_initializers do |app|
|
|
55
|
-
app.config.spree.promotions = Spree::Promo::Environment.new
|
|
56
|
-
app.config.spree.promotions.rules = []
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
initializer 'spree.promo.register.promotion.calculators', before: :load_config_initializers do |app|
|
|
60
|
-
app.config.spree.calculators.promotion_actions_create_adjustments = %w[
|
|
61
|
-
Spree::Calculator::FlatPercentItemTotal
|
|
62
|
-
Spree::Calculator::FlatRate
|
|
63
|
-
Spree::Calculator::FlexiRate
|
|
64
|
-
Spree::Calculator::TieredPercent
|
|
65
|
-
Spree::Calculator::TieredFlatRate
|
|
66
|
-
]
|
|
67
|
-
|
|
68
|
-
app.config.spree.calculators.promotion_actions_create_item_adjustments = %w[
|
|
69
|
-
Spree::Calculator::DistributedAmount
|
|
70
|
-
Spree::Calculator::FlatRate
|
|
71
|
-
Spree::Calculator::FlexiRate
|
|
72
|
-
Spree::Calculator::PercentOnLineItem
|
|
73
|
-
Spree::Calculator::TieredPercent
|
|
74
|
-
]
|
|
75
|
-
|
|
76
|
-
app.config.spree.calculators.promotion_actions_create_quantity_adjustments = %w[
|
|
77
|
-
Spree::Calculator::PercentOnLineItem
|
|
78
|
-
Spree::Calculator::FlatRate
|
|
79
|
-
]
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
initializer 'spree.promo.register.promotion.rules', before: :load_config_initializers do |app|
|
|
83
|
-
app.config.spree.promotions.rules = %w[
|
|
84
|
-
Spree::Promotion::Rules::ItemTotal
|
|
85
|
-
Spree::Promotion::Rules::Product
|
|
86
|
-
Spree::Promotion::Rules::User
|
|
87
|
-
Spree::Promotion::Rules::FirstOrder
|
|
88
|
-
Spree::Promotion::Rules::UserLoggedIn
|
|
89
|
-
Spree::Promotion::Rules::OneUsePerUser
|
|
90
|
-
Spree::Promotion::Rules::Taxon
|
|
91
|
-
Spree::Promotion::Rules::NthOrder
|
|
92
|
-
Spree::Promotion::Rules::OptionValue
|
|
93
|
-
Spree::Promotion::Rules::FirstRepeatPurchaseSince
|
|
94
|
-
Spree::Promotion::Rules::UserRole
|
|
95
|
-
]
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
initializer 'spree.promo.register.promotions.actions', before: :load_config_initializers do |app|
|
|
99
|
-
app.config.spree.promotions.actions = %w[
|
|
100
|
-
Spree::Promotion::Actions::CreateAdjustment
|
|
101
|
-
Spree::Promotion::Actions::CreateItemAdjustments
|
|
102
|
-
Spree::Promotion::Actions::CreateQuantityAdjustments
|
|
103
|
-
Spree::Promotion::Actions::FreeShipping
|
|
104
|
-
]
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
initializer 'spree.promo.register.promotions.shipping_actions', before: :load_config_initializers do |app|
|
|
108
|
-
app.config.spree.promotions.shipping_actions = %w[
|
|
109
|
-
Spree::Promotion::Actions::FreeShipping
|
|
110
|
-
]
|
|
111
|
-
end
|
|
20
|
+
# leave empty initializers for backwards-compatability. Other apps might still rely on these events
|
|
21
|
+
initializer "spree.default_permissions", before: :load_config_initializers do; end
|
|
22
|
+
initializer "spree.register.calculators", before: :load_config_initializers do; end
|
|
23
|
+
initializer "spree.register.stock_splitters", before: :load_config_initializers do; end
|
|
24
|
+
initializer "spree.register.payment_methods", before: :load_config_initializers do; end
|
|
25
|
+
initializer 'spree.promo.environment', before: :load_config_initializers do; end
|
|
26
|
+
initializer 'spree.promo.register.promotion.calculators', before: :load_config_initializers do; end
|
|
27
|
+
initializer 'spree.promo.register.promotion.rules', before: :load_config_initializers do; end
|
|
28
|
+
initializer 'spree.promo.register.promotions.actions', before: :load_config_initializers do; end
|
|
29
|
+
initializer 'spree.promo.register.promotions.shipping_actions', before: :load_config_initializers do; end
|
|
112
30
|
|
|
113
31
|
# Filter sensitive information during logging
|
|
114
32
|
initializer "spree.params.filter", before: :load_config_initializers do |app|
|
|
115
33
|
app.config.filter_parameters += [
|
|
116
34
|
%r{^password$},
|
|
117
35
|
%r{^password_confirmation$},
|
|
118
|
-
|
|
119
|
-
|
|
36
|
+
CREDIT_CARD_NUMBER_PARAM,
|
|
37
|
+
CREDIT_CARD_VERIFICATION_VALUE_PARAM,
|
|
120
38
|
]
|
|
121
39
|
end
|
|
122
40
|
|