spree_core 2.1.12 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/spree/base_helper.rb +4 -7
- data/app/helpers/spree/products_helper.rb +11 -9
- data/app/helpers/spree/store_helper.rb +5 -0
- data/app/models/spree/ability.rb +4 -0
- data/app/models/spree/address.rb +6 -6
- data/app/models/spree/adjustment.rb +40 -61
- data/app/models/spree/app_configuration.rb +1 -14
- data/app/models/spree/calculator.rb +12 -4
- data/app/models/spree/calculator/default_tax.rb +42 -38
- data/app/models/spree/calculator/flat_percent_item_total.rb +2 -4
- data/app/models/spree/calculator/free_shipping.rb +5 -2
- data/app/models/spree/calculator/percent_on_line_item.rb +15 -0
- data/app/models/spree/calculator/percent_per_item.rb +3 -0
- data/app/models/spree/classification.rb +3 -2
- data/app/models/spree/credit_card.rb +7 -25
- data/app/models/spree/gateway/bogus.rb +5 -5
- data/app/models/spree/gateway/bogus_simple.rb +0 -8
- data/app/models/spree/image.rb +0 -9
- data/app/models/spree/inventory_unit.rb +10 -4
- data/app/models/spree/item_adjustments.rb +65 -0
- data/app/models/spree/legacy_user.rb +1 -0
- data/app/models/spree/line_item.rb +33 -13
- data/app/models/spree/option_type.rb +2 -2
- data/app/models/spree/option_value.rb +1 -1
- data/app/models/spree/order.rb +109 -89
- data/app/models/spree/order/checkout.rb +48 -0
- data/app/models/spree/order_contents.rb +72 -37
- data/app/models/spree/order_inventory.rb +65 -68
- data/app/models/spree/order_populator.rb +3 -17
- data/app/models/spree/order_updater.rb +63 -44
- data/app/models/spree/payment.rb +20 -5
- data/app/models/spree/payment/processing.rb +19 -25
- data/app/models/spree/payment_capture_event.rb +9 -0
- data/app/models/spree/payment_method/check.rb +0 -2
- data/app/models/spree/price.rb +1 -1
- data/app/models/spree/product.rb +14 -16
- data/app/models/spree/product/scopes.rb +4 -6
- data/app/models/spree/product_option_type.rb +2 -2
- data/app/models/spree/product_property.rb +2 -2
- data/app/models/spree/promotion.rb +71 -50
- data/app/models/spree/promotion/actions/create_adjustment.rb +31 -32
- data/app/models/spree/promotion/actions/create_item_adjustments.rb +83 -0
- data/app/models/spree/promotion/actions/free_shipping.rb +36 -0
- data/app/models/spree/promotion/rules/first_order.rb +4 -0
- data/app/models/spree/promotion/rules/item_total.rb +5 -1
- data/app/models/spree/promotion/rules/product.rb +4 -0
- data/app/models/spree/promotion/rules/user.rb +5 -6
- data/app/models/spree/promotion/rules/user_logged_in.rb +4 -0
- data/app/models/spree/promotion_action.rb +1 -5
- data/app/models/spree/promotion_handler/cart.rb +38 -0
- data/app/models/spree/promotion_handler/coupon.rb +76 -0
- data/app/models/spree/promotion_handler/free_shipping.rb +31 -0
- data/app/models/spree/promotion_handler/page.rb +24 -0
- data/app/models/spree/promotion_rule.rb +15 -7
- data/app/models/spree/property.rb +1 -1
- data/app/models/spree/return_authorization.rb +7 -1
- data/app/models/spree/shipment.rb +113 -49
- data/app/models/spree/shipping_calculator.rb +4 -5
- data/app/models/spree/shipping_category.rb +2 -2
- data/app/models/spree/shipping_method.rb +12 -6
- data/app/models/spree/shipping_rate.rb +27 -7
- data/app/models/spree/stock/availability_validator.rb +1 -1
- data/app/models/spree/stock/estimator.rb +13 -1
- data/app/models/spree/stock/package.rb +11 -7
- data/app/models/spree/stock/packer.rb +3 -3
- data/app/models/spree/stock/quantifier.rb +9 -1
- data/app/models/spree/stock_item.rb +11 -6
- data/app/models/spree/stock_movement.rb +1 -2
- data/app/models/spree/tax_category.rb +6 -1
- data/app/models/spree/tax_rate.rb +57 -49
- data/app/models/spree/taxon.rb +10 -5
- data/app/models/spree/taxonomy.rb +5 -2
- data/app/models/spree/variant.rb +33 -16
- data/app/models/spree/zone.rb +24 -24
- data/app/views/spree/shared/_routes.html.erb +3 -0
- data/config/locales/en.yml +42 -26
- data/db/migrate/20130213191427_create_default_stock.rb +3 -3
- data/db/migrate/20130413230529_add_name_to_spree_credit_cards.rb +5 -0
- data/db/migrate/20130414000512_update_name_fields_on_spree_credit_cards.rb +13 -0
- data/db/migrate/20130417120035_update_adjustment_states.rb +2 -2
- data/db/migrate/20130417123427_add_shipping_rates_to_shipments.rb +1 -1
- data/db/migrate/20130509115210_add_number_to_stock_transfer.rb +1 -1
- data/db/migrate/20130611054351_rename_shipping_methods_zones_to_spree_shipping_methods_zones.rb +0 -5
- data/db/migrate/20130802022321_migrate_tax_categories_to_line_items.rb +7 -5
- data/db/migrate/20130807024301_upgrade_adjustments.rb +39 -0
- data/db/migrate/20130807024302_rename_adjustment_fields.rb +17 -0
- data/db/migrate/20130813004002_add_shipment_total_to_spree_orders.rb +5 -0
- data/db/migrate/20130813232134_rename_activators_to_promotions.rb +5 -0
- data/db/migrate/20130815000406_add_adjustment_total_to_line_items.rb +5 -0
- data/db/migrate/20130815024413_add_adjustment_total_to_shipments.rb +5 -0
- data/db/migrate/20130828234942_add_tax_total_to_line_items_shipments_and_orders.rb +8 -0
- data/db/migrate/20130830001159_migrate_old_shipping_calculators.rb +1 -1
- data/db/migrate/20130903183026_add_code_to_spree_promotion_rules.rb +5 -0
- data/db/migrate/20130917024658_remove_promotions_event_name_field.rb +5 -0
- data/db/migrate/20130924040529_add_promo_total_to_line_items_and_shipments_and_orders.rb +7 -0
- data/db/migrate/20131001013410_remove_unused_credit_card_fields.rb +7 -3
- data/db/migrate/20131107132123_add_tax_category_to_variants.rb +6 -0
- data/db/migrate/20131118043959_add_included_to_adjustments.rb +5 -0
- data/db/migrate/20131118050234_rename_tax_total_fields.rb +11 -0
- data/db/migrate/20131118183431_add_line_item_id_to_spree_inventory_units.rb +21 -0
- data/db/migrate/20131127001002_add_position_to_classifications.rb +5 -0
- data/db/migrate/20131211112807_create_spree_orders_promotions.rb +8 -0
- data/db/migrate/20131218054603_add_item_count_to_spree_orders.rb +5 -0
- data/db/migrate/20140106224208_rename_permalink_to_slug_for_products.rb +5 -0
- data/db/migrate/20140124023232_rename_activator_id_in_rules_and_actions_to_promotion_id.rb +6 -0
- data/db/migrate/20140203161722_add_approver_id_and_approved_at_to_orders.rb +6 -0
- data/db/migrate/20140204115338_add_confirmation_delivered_to_spree_orders.rb +5 -0
- data/db/migrate/20140205120320_create_spree_payment_capture_events.rb +12 -0
- data/db/migrate/20140205144710_add_uncaptured_amount_to_payments.rb +5 -0
- data/db/migrate/20140207085910_add_tax_category_id_to_shipping_methods.rb +5 -0
- data/db/migrate/20140207093021_add_tax_rate_id_to_shipping_rates.rb +5 -0
- data/db/migrate/20140211040159_add_pre_tax_amount_to_line_items_and_shipments.rb +6 -0
- data/db/migrate/20140213184916_add_more_indexes.rb +13 -0
- data/db/migrate/20140219060952_add_considered_risky_to_orders.rb +5 -0
- data/lib/generators/spree/dummy/dummy_generator.rb +1 -6
- data/lib/generators/spree/install/install_generator.rb +6 -6
- data/lib/generators/spree/install/templates/{app/assets/javascripts/admin → vendor/assets/javascripts/spree/backend}/all.js +3 -3
- data/lib/generators/spree/install/templates/{app/assets/javascripts/store → vendor/assets/javascripts/spree/frontend}/all.js +3 -3
- data/lib/generators/spree/install/templates/{app/assets/stylesheets/store → vendor/assets/stylesheets/spree/backend}/all.css +3 -3
- data/lib/generators/spree/install/templates/{app/assets/stylesheets/admin → vendor/assets/stylesheets/spree/frontend}/all.css +3 -3
- data/lib/spree/core.rb +21 -8
- data/lib/spree/core/calculated_adjustments.rb +0 -40
- data/lib/spree/core/controller_helpers.rb +5 -0
- data/lib/spree/core/controller_helpers/auth.rb +2 -2
- data/lib/spree/core/controller_helpers/common.rb +0 -5
- data/lib/spree/core/controller_helpers/order.rb +8 -9
- data/lib/spree/core/engine.rb +10 -17
- data/lib/spree/core/permalinks.rb +1 -1
- data/lib/spree/core/product_duplicator.rb +3 -8
- data/lib/spree/core/user_address.rb +1 -1
- data/lib/spree/core/validators/email.rb +23 -1
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/money.rb +1 -1
- data/lib/spree/permitted_attributes.rb +2 -2
- data/lib/spree/testing_support/caching.rb +47 -0
- data/lib/spree/testing_support/factories/adjustment_factory.rb +11 -2
- data/lib/spree/testing_support/factories/credit_card_factory.rb +2 -1
- data/lib/spree/testing_support/factories/order_factory.rb +10 -5
- data/lib/spree/testing_support/factories/payment_factory.rb +2 -2
- data/lib/spree/testing_support/factories/payment_method_factory.rb +3 -3
- data/lib/spree/testing_support/factories/promotion_factory.rb +16 -1
- data/lib/spree/testing_support/factories/shipment_factory.rb +8 -4
- data/lib/spree/testing_support/factories/shipping_method_factory.rb +1 -3
- data/lib/spree/testing_support/factories/stock_factory.rb +1 -1
- data/lib/spree/testing_support/factories/tax_rate_factory.rb +2 -2
- data/lib/spree/testing_support/order_walkthrough.rb +1 -1
- data/lib/tasks/core.rake +2 -2
- data/vendor/assets/fonts/FontAwesome.otf +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.svg +399 -0
- data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
- data/vendor/assets/stylesheets/font-awesome.scss +1475 -0
- metadata +73 -44
- data/app/assets/javascripts/admin/handlebar_extensions.js +0 -9
- data/app/helpers/spree/admin/adjustments_helper.rb +0 -26
- data/app/helpers/spree/admin/images_helper.rb +0 -18
- data/app/helpers/spree/promotion_rules_helper.rb +0 -13
- data/app/models/spree/activator.rb +0 -29
- data/app/models/spree/calculator/per_item.rb +0 -41
- data/app/models/spree/stock/remaining_packer.rb +0 -22
- data/app/views/spree/payments/_payment.html.erb +0 -18
- data/db/migrate/20131118041203_add_tax_total_to_spree_orders.rb +0 -5
- data/db/migrate/20131118043021_add_order_id_to_spree_adjustments.rb +0 -6
- data/db/migrate/20131118074808_add_included_to_spree_adjustments.rb +0 -5
- data/db/migrate/20140415041315_add_user_id_created_by_id_index_to_order.rb +0 -5
- data/lib/spree/core/gateway_error.rb +0 -5
- data/lib/spree/core/preference_rescue.rb +0 -25
- data/lib/spree/core/s3_support.rb +0 -25
- data/lib/spree/promo/coupon_applicator.rb +0 -71
- data/lib/spree/testing_support/factories/activator_factory.rb +0 -8
@@ -1,10 +1,12 @@
|
|
1
1
|
class MigrateTaxCategoriesToLineItems < ActiveRecord::Migration
|
2
2
|
def change
|
3
|
-
Spree::LineItem.
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
Spree::LineItem.includes(:variant => { :product => :tax_category }).find_in_batches do |line_items|
|
4
|
+
line_items.each do |line_item|
|
5
|
+
next if line_item.variant.nil?
|
6
|
+
next if line_item.variant.product.nil?
|
7
|
+
next if line_item.product.nil?
|
8
|
+
line_item.update_column(:tax_category_id, line_item.product.tax_category_id)
|
9
|
+
end
|
8
10
|
end
|
9
11
|
end
|
10
12
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
class UpgradeAdjustments < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
# Temporarily make originator association available
|
4
|
+
Spree::Adjustment.class_eval do
|
5
|
+
belongs_to :originator, polymorphic: true
|
6
|
+
end
|
7
|
+
# Shipping adjustments are now tracked as fields on the object
|
8
|
+
Spree::Adjustment.where(:source_type => "Spree::Shipment").find_each do |adjustment|
|
9
|
+
# Account for possible invalid data
|
10
|
+
next if adjustment.source.nil?
|
11
|
+
adjustment.source.update_column(:cost, adjustment.amount)
|
12
|
+
adjustment.destroy
|
13
|
+
end
|
14
|
+
|
15
|
+
# Tax adjustments have their sources altered
|
16
|
+
Spree::Adjustment.where(:originator_type => "Spree::TaxRate").find_each do |adjustment|
|
17
|
+
adjustment.source = adjustment.originator
|
18
|
+
adjustment.save
|
19
|
+
end
|
20
|
+
|
21
|
+
# Promotion adjustments have their source altered also
|
22
|
+
Spree::Adjustment.where(:originator_type => "Spree::PromotionAction").find_each do |adjustment|
|
23
|
+
next if adjustment.originator.nil?
|
24
|
+
adjustment.source = adjustment.originator
|
25
|
+
begin
|
26
|
+
if adjustment.source.calculator_type == "Spree::Calculator::FreeShipping"
|
27
|
+
# Previously this was a Spree::Promotion::Actions::CreateAdjustment
|
28
|
+
# And it had a calculator to work out FreeShipping
|
29
|
+
# In Spree 2.2, the "calculator" is now the action itself.
|
30
|
+
adjustment.source.becomes(Spree::Promotion::Actions::FreeShipping)
|
31
|
+
end
|
32
|
+
rescue
|
33
|
+
# Fail silently. This is primarily in instances where the calculator no longer exists
|
34
|
+
end
|
35
|
+
|
36
|
+
adjustment.save
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class RenameAdjustmentFields < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
remove_column :spree_adjustments, :originator_id
|
4
|
+
remove_column :spree_adjustments, :originator_type
|
5
|
+
|
6
|
+
add_column :spree_adjustments, :order_id, :integer unless column_exists?(:spree_adjustments, :order_id)
|
7
|
+
|
8
|
+
# This enables the Spree::Order#all_adjustments association to work correctly
|
9
|
+
Spree::Adjustment.reset_column_information
|
10
|
+
Spree::Adjustment.find_each do |adjustment|
|
11
|
+
if adjustment.adjustable.is_a?(Spree::Order)
|
12
|
+
adjustment.order = adjustment.adjustable
|
13
|
+
adjustment.save
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
class AddTaxTotalToLineItemsShipmentsAndOrders < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
add_column :spree_line_items, :tax_total, :decimal, precision: 10, scale: 2, default: 0.0
|
4
|
+
add_column :spree_shipments, :tax_total, :decimal, precision: 10, scale: 2, default: 0.0
|
5
|
+
# This column may already be here from a 2.1.x migration
|
6
|
+
add_column :spree_orders, :tax_total, :decimal, precision: 10, scale: 2, default: 0.0 unless Spree::Order.column_names.include?("tax_total")
|
7
|
+
end
|
8
|
+
end
|
@@ -3,7 +3,7 @@ class MigrateOldShippingCalculators < ActiveRecord::Migration
|
|
3
3
|
Spree::ShippingMethod.all.each do |shipping_method|
|
4
4
|
old_calculator = shipping_method.calculator
|
5
5
|
next if old_calculator.class < Spree::ShippingCalculator # We don't want to mess with new shipping calculators
|
6
|
-
new_calculator = eval(old_calculator.class.name.
|
6
|
+
new_calculator = eval("Spree::Calculator::Shipping::#{old_calculator.class.name.demodulize}").new
|
7
7
|
new_calculator.preferences.keys.each do |pref|
|
8
8
|
# Preferences can't be read/set by name, you have to prefix preferred_
|
9
9
|
pref_method = "preferred_#{pref}"
|
@@ -0,0 +1,7 @@
|
|
1
|
+
class AddPromoTotalToLineItemsAndShipmentsAndOrders < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
add_column :spree_line_items, :promo_total, :decimal, precision: 10, scale: 2, default: 0.0
|
4
|
+
add_column :spree_shipments, :promo_total, :decimal, precision: 10, scale: 2, default: 0.0
|
5
|
+
add_column :spree_orders, :promo_total, :decimal, precision: 10, scale: 2, default: 0.0
|
6
|
+
end
|
7
|
+
end
|
@@ -1,12 +1,16 @@
|
|
1
1
|
class RemoveUnusedCreditCardFields < ActiveRecord::Migration
|
2
2
|
def up
|
3
|
-
remove_column :spree_credit_cards, :start_month
|
4
|
-
remove_column :spree_credit_cards, :start_year
|
5
|
-
remove_column :spree_credit_cards, :issue_number
|
3
|
+
remove_column :spree_credit_cards, :start_month if column_exists?(:spree_credit_cards, :start_month)
|
4
|
+
remove_column :spree_credit_cards, :start_year if column_exists?(:spree_credit_cards, :start_year)
|
5
|
+
remove_column :spree_credit_cards, :issue_number if column_exists?(:spree_credit_cards, :issue_number)
|
6
6
|
end
|
7
7
|
def down
|
8
8
|
add_column :spree_credit_cards, :start_month, :string
|
9
9
|
add_column :spree_credit_cards, :start_year, :string
|
10
10
|
add_column :spree_credit_cards, :issue_number, :string
|
11
11
|
end
|
12
|
+
|
13
|
+
def column_exists?(table, column)
|
14
|
+
ActiveRecord::Base.connection.column_exists?(table, column)
|
15
|
+
end
|
12
16
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class RenameTaxTotalFields < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
rename_column :spree_line_items, :tax_total, :additional_tax_total
|
4
|
+
rename_column :spree_shipments, :tax_total, :additional_tax_total
|
5
|
+
rename_column :spree_orders, :tax_total, :additional_tax_total
|
6
|
+
|
7
|
+
add_column :spree_line_items, :included_tax_total, :decimal, precision: 10, scale: 2, null: false, default: 0.0
|
8
|
+
add_column :spree_shipments, :included_tax_total, :decimal, precision: 10, scale: 2, null: false, default: 0.0
|
9
|
+
add_column :spree_orders, :included_tax_total, :decimal, precision: 10, scale: 2, null: false, default: 0.0
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class AddLineItemIdToSpreeInventoryUnits < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
# Stores running the product-assembly extension already have a line_item_id column
|
4
|
+
unless column_exists? Spree::InventoryUnit.table_name, :line_item_id
|
5
|
+
add_column :spree_inventory_units, :line_item_id, :integer
|
6
|
+
add_index :spree_inventory_units, :line_item_id
|
7
|
+
|
8
|
+
shipments = Spree::Shipment.includes(:inventory_units, :order)
|
9
|
+
|
10
|
+
shipments.find_each do |shipment|
|
11
|
+
shipment.inventory_units.group_by(&:variant).each do |variant, units|
|
12
|
+
|
13
|
+
line_item = shipment.order.find_line_item_by_variant(variant)
|
14
|
+
next unless line_item
|
15
|
+
|
16
|
+
Spree::InventoryUnit.where(id: units.map(&:id)).update_all(line_item_id: line_item.id)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class CreateSpreePaymentCaptureEvents < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :spree_payment_capture_events do |t|
|
4
|
+
t.decimal :amount, precision: 10, scale: 2, default: 0.0
|
5
|
+
t.integer :payment_id
|
6
|
+
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
|
10
|
+
add_index :spree_payment_capture_events, :payment_id
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class AddMoreIndexes < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
add_index :spree_payment_methods, [:id, :type]
|
4
|
+
add_index :spree_calculators, [:id, :type]
|
5
|
+
add_index :spree_calculators, [:calculable_id, :calculable_type]
|
6
|
+
add_index :spree_payments, :payment_method_id
|
7
|
+
add_index :spree_promotion_actions, [:id, :type]
|
8
|
+
add_index :spree_promotion_actions, :promotion_id
|
9
|
+
add_index :spree_promotions, [:id, :type]
|
10
|
+
add_index :spree_option_values, :option_type_id
|
11
|
+
add_index :spree_shipments, :stock_location_id
|
12
|
+
end
|
13
|
+
end
|
@@ -122,12 +122,7 @@ end
|
|
122
122
|
end
|
123
123
|
|
124
124
|
def gemfile_path
|
125
|
-
|
126
|
-
if File.exist?(version_file)
|
127
|
-
'../../../../Gemfile'
|
128
|
-
else
|
129
|
-
'../../../../../Gemfile'
|
130
|
-
end
|
125
|
+
'../../../../../Gemfile'
|
131
126
|
end
|
132
127
|
end
|
133
128
|
end
|
@@ -70,18 +70,18 @@ Disallow: /account
|
|
70
70
|
def setup_assets
|
71
71
|
@lib_name = 'spree'
|
72
72
|
%w{javascripts stylesheets images}.each do |path|
|
73
|
-
empty_directory "
|
74
|
-
empty_directory "
|
73
|
+
empty_directory "vendor/assets/#{path}/spree/frontend" if defined? Spree::Frontend || Rails.env.test?
|
74
|
+
empty_directory "vendor/assets/#{path}/spree/backend" if defined? Spree::Backend || Rails.env.test?
|
75
75
|
end
|
76
76
|
|
77
77
|
if defined? Spree::Frontend || Rails.env.test?
|
78
|
-
template "
|
79
|
-
template "
|
78
|
+
template "vendor/assets/javascripts/spree/frontend/all.js"
|
79
|
+
template "vendor/assets/stylesheets/spree/frontend/all.css"
|
80
80
|
end
|
81
81
|
|
82
82
|
if defined? Spree::Backend || Rails.env.test?
|
83
|
-
template "
|
84
|
-
template "
|
83
|
+
template "vendor/assets/javascripts/spree/backend/all.js"
|
84
|
+
template "vendor/assets/stylesheets/spree/backend/all.css"
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
@@ -6,9 +6,9 @@
|
|
6
6
|
//
|
7
7
|
//= require jquery
|
8
8
|
//= require jquery_ujs
|
9
|
-
<% if options[:lib_name] == 'spree' %>
|
10
|
-
//= require
|
9
|
+
<% if options[:lib_name] == 'spree' || options[:lib_name] == 'spree/backend' %>
|
10
|
+
//= require spree/backend
|
11
11
|
<% else %>
|
12
|
-
//= require
|
12
|
+
//= require spree/backend/<%= options[:lib_name].gsub("/", "_") %>
|
13
13
|
<% end %>
|
14
14
|
//= require_tree .
|
@@ -6,9 +6,9 @@
|
|
6
6
|
//
|
7
7
|
//= require jquery
|
8
8
|
//= require jquery_ujs
|
9
|
-
<% if options[:lib_name] == 'spree' %>
|
10
|
-
//= require
|
9
|
+
<% if options[:lib_name] == 'spree' || options[:lib_name] == 'spree/frontend' %>
|
10
|
+
//= require spree/frontend
|
11
11
|
<% else %>
|
12
|
-
//= require
|
12
|
+
//= require spree/frontend/<%= options[:lib_name].gsub("/", "_") %>
|
13
13
|
<% end %>
|
14
14
|
//= require_tree .
|
@@ -3,10 +3,10 @@
|
|
3
3
|
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
4
4
|
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
5
5
|
*
|
6
|
-
<% if options[:lib_name] == 'spree' %>
|
7
|
-
*= require
|
6
|
+
<% if options[:lib_name] == 'spree' || options[:lib_name] == 'spree/backend' %>
|
7
|
+
*= require spree/backend
|
8
8
|
<% else %>
|
9
|
-
*= require
|
9
|
+
*= require spree/backend/<%= options[:lib_name].gsub("/", "_") %>
|
10
10
|
<% end %>
|
11
11
|
*= require_self
|
12
12
|
*= require_tree .
|
@@ -3,10 +3,10 @@
|
|
3
3
|
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
4
4
|
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
5
5
|
*
|
6
|
-
<% if options[:lib_name] == 'spree' %>
|
7
|
-
*= require
|
6
|
+
<% if options[:lib_name] == 'spree' || options[:lib_name] == 'spree/frontend' %>
|
7
|
+
*= require spree/frontend
|
8
8
|
<% else %>
|
9
|
-
*= require
|
9
|
+
*= require spree/frontend/<%= options[:lib_name].gsub("/", "_") %>
|
10
10
|
<% end %>
|
11
11
|
*= require_self
|
12
12
|
*= require_tree .
|
data/lib/spree/core.rb
CHANGED
@@ -5,11 +5,11 @@ require 'awesome_nested_set'
|
|
5
5
|
require 'cancan'
|
6
6
|
require 'kaminari'
|
7
7
|
require 'mail'
|
8
|
-
require 'monetize'
|
9
8
|
require 'paperclip'
|
10
9
|
require 'paranoia'
|
11
10
|
require 'ransack'
|
12
11
|
require 'state_machine'
|
12
|
+
require 'friendly_id'
|
13
13
|
|
14
14
|
module Spree
|
15
15
|
|
@@ -36,24 +36,37 @@ module Spree
|
|
36
36
|
def self.config(&block)
|
37
37
|
yield(Spree::Config)
|
38
38
|
end
|
39
|
+
|
40
|
+
module Core
|
41
|
+
autoload :ProductFilters, "spree/core/product_filters"
|
42
|
+
|
43
|
+
class GatewayError < RuntimeError; end
|
44
|
+
end
|
39
45
|
end
|
40
46
|
|
41
47
|
require 'spree/core/version'
|
48
|
+
|
49
|
+
require 'spree/core/mail_interceptor'
|
50
|
+
require 'spree/core/mail_method'
|
51
|
+
require 'spree/core/mail_settings'
|
52
|
+
require 'spree/core/environment_extension'
|
53
|
+
require 'spree/core/environment/calculators'
|
54
|
+
require 'spree/core/environment'
|
55
|
+
require 'spree/promo/environment'
|
42
56
|
require 'spree/migrations'
|
43
57
|
require 'spree/core/engine'
|
44
58
|
|
45
59
|
require 'spree/i18n'
|
46
60
|
require 'spree/money'
|
47
|
-
require 'spree/promo/coupon_applicator'
|
48
61
|
|
62
|
+
require 'spree/permitted_attributes'
|
63
|
+
require 'spree/core/user_address'
|
49
64
|
require 'spree/core/delegate_belongs_to'
|
50
65
|
require 'spree/core/permalinks'
|
51
66
|
require 'spree/core/token_resource'
|
52
67
|
require 'spree/core/calculated_adjustments'
|
53
68
|
require 'spree/core/product_duplicator'
|
54
|
-
require 'spree/core/
|
55
|
-
require 'spree/core/
|
56
|
-
|
57
|
-
|
58
|
-
include CollectiveIdea::Acts::NestedSet
|
59
|
-
end
|
69
|
+
require 'spree/core/controller_helpers'
|
70
|
+
require 'spree/core/controller_helpers/strong_parameters'
|
71
|
+
require 'spree/core/controller_helpers/ssl'
|
72
|
+
require 'spree/core/controller_helpers/search'
|