spree_core 2.0.13 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/spree/base_controller.rb +3 -0
- data/app/helpers/spree/base_helper.rb +6 -16
- data/app/helpers/spree/products_helper.rb +3 -8
- data/app/helpers/spree/taxons_helper.rb +1 -1
- data/app/mailers/spree/base_mailer.rb +0 -5
- data/app/models/spree/ability.rb +10 -7
- data/app/models/spree/address.rb +7 -17
- data/app/models/spree/adjustment.rb +15 -11
- data/app/models/spree/app_configuration.rb +0 -5
- data/app/models/spree/billing_integration.rb +0 -1
- data/app/models/spree/calculator/flat_percent_item_total.rb +1 -3
- data/app/models/spree/calculator/flat_rate.rb +2 -4
- data/app/models/spree/calculator/flexi_rate.rb +6 -9
- data/app/models/spree/calculator/per_item.rb +2 -4
- data/app/models/spree/calculator/percent_per_item.rb +1 -3
- data/app/models/spree/calculator/price_sack.rb +4 -9
- data/app/models/spree/calculator/shipping/flat_percent_item_total.rb +1 -2
- data/app/models/spree/calculator/shipping/flat_rate.rb +2 -4
- data/app/models/spree/calculator/shipping/flexi_rate.rb +4 -9
- data/app/models/spree/calculator/shipping/per_item.rb +2 -3
- data/app/models/spree/calculator/shipping/price_sack.rb +4 -9
- data/app/models/spree/classification.rb +0 -3
- data/app/models/spree/country.rb +1 -3
- data/app/models/spree/credit_card.rb +37 -38
- data/app/models/spree/gateway/bogus_simple.rb +0 -8
- data/app/models/spree/gateway.rb +1 -3
- data/app/models/spree/image.rb +1 -3
- data/app/models/spree/inventory_unit.rb +5 -8
- data/app/models/spree/legacy_user.rb +0 -4
- data/app/models/spree/line_item.rb +2 -15
- data/app/models/spree/option_type.rb +2 -5
- data/app/models/spree/option_value.rb +1 -3
- data/app/models/spree/order/checkout.rb +4 -13
- data/app/models/spree/order.rb +47 -99
- data/app/models/spree/order_contents.rb +4 -7
- data/app/models/spree/order_inventory.rb +4 -8
- data/app/models/spree/order_updater.rb +13 -12
- data/app/models/spree/payment/processing.rb +12 -19
- data/app/models/spree/payment.rb +17 -30
- data/app/models/spree/payment_method.rb +2 -3
- data/app/models/spree/preference.rb +1 -1
- data/app/models/spree/preferences/configuration.rb +1 -1
- data/app/models/spree/preferences/preferable.rb +1 -1
- data/app/models/spree/preferences/store.rb +1 -1
- data/app/models/spree/price.rb +0 -7
- data/app/models/spree/product/scopes.rb +16 -17
- data/app/models/spree/product.rb +27 -62
- data/app/models/spree/product_property.rb +3 -5
- data/app/models/spree/promotion/actions/create_adjustment.rb +9 -8
- data/app/models/spree/promotion/actions/create_line_items.rb +1 -2
- data/app/models/spree/promotion/rules/first_order.rb +1 -1
- data/app/models/spree/promotion/rules/item_total.rb +2 -4
- data/app/models/spree/promotion/rules/product.rb +2 -2
- data/app/models/spree/promotion/rules/user.rb +1 -3
- data/app/models/spree/promotion.rb +23 -24
- data/app/models/spree/promotion_action.rb +0 -2
- data/app/models/spree/promotion_action_line_item.rb +1 -3
- data/app/models/spree/promotion_rule.rb +0 -2
- data/app/models/spree/property.rb +2 -4
- data/app/models/spree/prototype.rb +0 -2
- data/app/models/spree/return_authorization.rb +6 -9
- data/app/models/spree/role.rb +0 -2
- data/app/models/spree/shipment.rb +19 -25
- data/app/models/spree/shipping_calculator.rb +0 -2
- data/app/models/spree/shipping_category.rb +0 -2
- data/app/models/spree/shipping_method.rb +6 -20
- data/app/models/spree/shipping_rate.rb +12 -10
- data/app/models/spree/state.rb +2 -4
- data/app/models/spree/stock/availability_validator.rb +2 -2
- data/app/models/spree/stock/estimator.rb +6 -20
- data/app/models/spree/stock/packer.rb +1 -1
- data/app/models/spree/stock/quantifier.rb +2 -3
- data/app/models/spree/stock/splitter/base.rb +1 -1
- data/app/models/spree/stock_item.rb +8 -18
- data/app/models/spree/stock_location.rb +2 -11
- data/app/models/spree/stock_movement.rb +2 -5
- data/app/models/spree/stock_transfer.rb +0 -2
- data/app/models/spree/tax_category.rb +0 -2
- data/app/models/spree/tax_rate.rb +12 -12
- data/app/models/spree/taxon.rb +1 -13
- data/app/models/spree/taxonomy.rb +3 -6
- data/app/models/spree/tracker.rb +0 -2
- data/app/models/spree/variant/scopes.rb +2 -2
- data/app/models/spree/variant.rb +13 -31
- data/app/models/spree/zone.rb +2 -7
- data/app/models/spree/zone_member.rb +0 -2
- data/app/views/spree/payments/_payment.html.erb +1 -3
- data/config/locales/en.yml +11 -26
- data/db/default/spree/countries.rb +230 -229
- data/db/default/spree/states.rb +57 -56
- data/db/default/spree/zones.rb +5 -5
- data/db/migrate/20130213191427_create_default_stock.rb +4 -7
- 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/20130611185927_add_user_id_index_to_spree_orders.rb +5 -0
- data/db/migrate/20130618041418_add_updated_at_to_spree_countries.rb +9 -0
- data/db/migrate/20130619012236_add_updated_at_to_spree_states.rb +9 -0
- data/db/migrate/20130802022321_migrate_tax_categories_to_line_items.rb +4 -5
- data/db/migrate/20130806145853_set_default_stock_location_on_shipments.rb +1 -1
- data/lib/generators/spree/dummy/dummy_generator.rb +3 -14
- data/lib/generators/spree/dummy/templates/rails/database.yml +0 -10
- data/lib/generators/spree/dummy/templates/rails/test.rb +2 -7
- data/lib/generators/spree/install/install_generator.rb +11 -8
- data/lib/spree/core/calculated_adjustments.rb +9 -8
- data/lib/spree/core/controller_helpers/auth.rb +2 -3
- data/lib/spree/core/controller_helpers/order.rb +8 -13
- data/lib/spree/core/controller_helpers/ssl.rb +13 -22
- data/lib/spree/core/controller_helpers/strong_parameters.rb +36 -0
- data/lib/spree/core/delegate_belongs_to.rb +0 -2
- data/lib/spree/core/engine.rb +1 -5
- data/lib/spree/core/ext/active_record.rb +2 -9
- data/lib/spree/core/permalinks.rb +1 -5
- data/lib/spree/core/product_duplicator.rb +2 -16
- data/lib/spree/core/product_filters.rb +37 -33
- data/lib/spree/core/search/base.rb +1 -1
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/core.rb +3 -31
- data/lib/spree/i18n.rb +0 -1
- data/lib/spree/money.rb +2 -177
- data/lib/spree/permitted_attributes.rb +95 -0
- data/lib/spree/promo/coupon_applicator.rb +4 -12
- data/lib/spree/testing_support/capybara_ext.rb +13 -17
- data/lib/spree/testing_support/common_rake.rb +1 -1
- data/lib/spree/testing_support/controller_requests.rb +3 -3
- data/lib/spree/testing_support/factories/credit_card_factory.rb +1 -1
- data/lib/spree/testing_support/factories/product_factory.rb +0 -4
- data/lib/spree/testing_support/factories/shipping_method_factory.rb +1 -3
- data/lib/spree/testing_support/factories/user_factory.rb +1 -1
- data/lib/spree/testing_support/factories/variant_factory.rb +0 -15
- data/lib/spree/testing_support/factories.rb +1 -1
- data/lib/spree/testing_support/order_walkthrough.rb +1 -1
- data/lib/tasks/core.rake +2 -2
- data/vendor/assets/javascripts/jquery.payment.js +497 -0
- metadata +166 -172
- data/app/views/spree/admin/shared/_report_order_criteria.html.erb +0 -17
- data/db/migrate/20130417120034_add_index_to_source_columns_on_adjustments.rb +0 -5
- data/db/migrate/20130830001033_add_shipping_category_to_shipping_methods_and_products.rb +0 -15
- data/db/migrate/20130830001159_migrate_old_shipping_calculators.rb +0 -19
- data/db/migrate/20130909115621_change_states_required_for_countries.rb +0 -9
- data/db/migrate/20131001013410_remove_unused_credit_card_fields.rb +0 -12
- data/db/migrate/20131026154747_add_track_inventory_to_variant.rb +0 -5
- data/db/migrate/20131113035136_add_channel_to_spree_orders.rb +0 -5
- data/db/migrate/20140120160805_add_index_to_variant_id_and_currency_on_prices.rb +0 -5
- data/db/migrate/20140205181631_default_variant_weight_to_zero.rb +0 -11
- data/db/migrate/20140415041315_add_user_id_created_by_id_index_to_order.rb +0 -5
- data/lib/spree/core/preference_rescue.rb +0 -25
@@ -1,17 +0,0 @@
|
|
1
|
-
<%= search_form_for @search, :url => spree.sales_total_admin_reports_path do |s| %>
|
2
|
-
<div class="date-range-filter field align-center">
|
3
|
-
<%= label_tag nil, t(:start), :class => 'inline' %>
|
4
|
-
<%= s.text_field :completed_at_gt, :class => 'datepicker datepicker-from', :value => datepicker_field_value(params[:q][:completed_at_gt]) %>
|
5
|
-
|
6
|
-
<span class="range-divider">
|
7
|
-
<i class="icon-arrow-right"></i>
|
8
|
-
</span>
|
9
|
-
|
10
|
-
<%= s.text_field :completed_at_lt, :class => 'datepicker datepicker-to', :value => datepicker_field_value(params[:q][:completed_at_lt]) %>
|
11
|
-
<%= label_tag nil, t(:end), :class => 'inline' %>
|
12
|
-
</div>
|
13
|
-
|
14
|
-
<div class="actions filter-actions">
|
15
|
-
<%= button t(:search), 'icon-search' %>
|
16
|
-
</div>
|
17
|
-
<% end %>
|
@@ -1,15 +0,0 @@
|
|
1
|
-
class AddShippingCategoryToShippingMethodsAndProducts < ActiveRecord::Migration
|
2
|
-
def up
|
3
|
-
default_category = Spree::ShippingCategory.first
|
4
|
-
default_category ||= Spree::ShippingCategory.create!(:name => "Default")
|
5
|
-
|
6
|
-
Spree::ShippingMethod.all.each do |method|
|
7
|
-
method.shipping_categories << default_category if method.shipping_categories.blank?
|
8
|
-
end
|
9
|
-
|
10
|
-
Spree::Product.where(shipping_category_id: nil).update_all(shipping_category_id: default_category.id)
|
11
|
-
end
|
12
|
-
|
13
|
-
def down
|
14
|
-
end
|
15
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
class MigrateOldShippingCalculators < ActiveRecord::Migration
|
2
|
-
def up
|
3
|
-
Spree::ShippingMethod.all.each do |shipping_method|
|
4
|
-
old_calculator = shipping_method.calculator
|
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.sub("::Calculator::", "::Calculator::Shipping::")).new
|
7
|
-
new_calculator.preferences.keys.each do |pref|
|
8
|
-
# Preferences can't be read/set by name, you have to prefix preferred_
|
9
|
-
pref_method = "preferred_#{pref}"
|
10
|
-
new_calculator.send("#{pref_method}=", old_calculator.send(pref_method))
|
11
|
-
end
|
12
|
-
new_calculator.calculable = old_calculator.calculable
|
13
|
-
new_calculator.save
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
def down
|
18
|
-
end
|
19
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
class RemoveUnusedCreditCardFields < ActiveRecord::Migration
|
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
|
6
|
-
end
|
7
|
-
def down
|
8
|
-
add_column :spree_credit_cards, :start_month, :string
|
9
|
-
add_column :spree_credit_cards, :start_year, :string
|
10
|
-
add_column :spree_credit_cards, :issue_number, :string
|
11
|
-
end
|
12
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
class DefaultVariantWeightToZero < ActiveRecord::Migration
|
2
|
-
def up
|
3
|
-
Spree::Variant.unscoped.where(weight: nil).update_all("weight = 0.0")
|
4
|
-
|
5
|
-
change_column :spree_variants, :weight, :decimal, precision: 8, scale: 2, default: 0.0
|
6
|
-
end
|
7
|
-
|
8
|
-
def down
|
9
|
-
change_column :spree_variants, :weight, :decimal, precision: 8, scale: 2
|
10
|
-
end
|
11
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
module Spree
|
2
|
-
class OldPrefs < ActiveRecord::Base
|
3
|
-
self.table_name = "spree_preferences"
|
4
|
-
belongs_to :owner, :polymorphic => true
|
5
|
-
attr_accessor :owner_klass
|
6
|
-
end
|
7
|
-
|
8
|
-
class PreferenceRescue
|
9
|
-
def self.try
|
10
|
-
OldPrefs.where(:key => nil).each do |old_pref|
|
11
|
-
next unless owner = (old_pref.owner rescue nil)
|
12
|
-
unless old_pref.owner_type == "Spree::Activator" || old_pref.owner_type == "Spree::Configuration"
|
13
|
-
begin
|
14
|
-
old_pref.key = [owner.class.name, old_pref.name, owner.id].join('::').underscore
|
15
|
-
old_pref.value_type = owner.preference_type(old_pref.name)
|
16
|
-
puts "Migrating Preference: #{old_pref.key}"
|
17
|
-
old_pref.save
|
18
|
-
rescue NoMethodError => ex
|
19
|
-
puts ex.message
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|