spree_core 3.0.0.rc4 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4cbd5f726167f74ffe46561c736107c5da112b96
4
- data.tar.gz: ba1d064375e342db1715d81d5405977dec6cf607
3
+ metadata.gz: 3affc0ac5855ce03665194985d21e1bf01bcda44
4
+ data.tar.gz: ad8218d37fb42edea1f6e34e0554fced3aa4758b
5
5
  SHA512:
6
- metadata.gz: a6f1ee67cf444eecc36036df3237aa6c00b51e882df1a838ec34664f4b7faca7e252acfdced21c2d3a56e2778acc98a4d2c8a0470b0e4335ec540805d76a51d4
7
- data.tar.gz: 929b702b204003e0e1ce8e90b809285a330b6810deea0e3d610276a9376c203ab4e2bc80d441d1ae229c2796bf5fc39ed8209adb10ce673e04c621fcb58d4a30
6
+ metadata.gz: fac94f550dc92e07f5ecbdefe2151853b8f7963ecf5378bcc61bccc6cb47063792185175041551ff301f810100a4f43873480b0d9d75673f1ad3376532e0ac65
7
+ data.tar.gz: 60c7dd641591eaaf0f80bcb48d8fb169fb9e150fe31e87705f3a537a13d107826bb2138ea3019d6f97ba3ebe63c682873a62e3e34e60c3be0b6d58e59e1ca071
@@ -2,7 +2,7 @@ module Spree
2
2
  class BaseMailer < ActionMailer::Base
3
3
 
4
4
  def from_address
5
- Spree::Config[:mails_from]
5
+ Spree::Store.current.mail_from_address
6
6
  end
7
7
 
8
8
  def money(amount, currency = Spree::Config[:currency])
@@ -8,7 +8,7 @@ module Spree
8
8
 
9
9
  included do
10
10
  before_validation :generate_number, on: :create # generate number before make_permalink
11
- validates :number, uniqueness: true
11
+ validates :number, presence: true, uniqueness: true
12
12
  end
13
13
 
14
14
  def self.by_number(number)
@@ -61,7 +61,6 @@ module Spree
61
61
 
62
62
  # Default mail headers settings
63
63
  preference :send_core_emails, :boolean, default: true
64
- preference :mails_from, :string, default: 'spree@example.com'
65
64
 
66
65
  # searcher_class allows spree extension writers to provide their own Search class
67
66
  def searcher_class
@@ -1,5 +1,7 @@
1
1
  module Spree
2
2
  class OptionType < Spree::Base
3
+ acts_as_list
4
+
3
5
  has_many :option_values, -> { order(:position) }, dependent: :destroy, inverse_of: :option_type
4
6
  has_many :product_option_types, dependent: :destroy, inverse_of: :option_type
5
7
  has_many :products, through: :product_option_types
@@ -41,8 +41,8 @@ module Spree
41
41
  end
42
42
 
43
43
  def self.active
44
- where('starts_at IS NULL OR starts_at < ?', Time.now).
45
- where('expires_at IS NULL OR expires_at > ?', Time.now)
44
+ where('spree_promotions.starts_at IS NULL OR spree_promotions.starts_at < ?', Time.now).
45
+ where('spree_promotions.expires_at IS NULL OR spree_promotions.expires_at > ?', Time.now)
46
46
  end
47
47
 
48
48
  def self.order_activatable?(order)
@@ -46,6 +46,7 @@ module Spree
46
46
 
47
47
  self.transaction_id = @response.authorization
48
48
  update_columns(transaction_id: transaction_id)
49
+ update_order
49
50
  end
50
51
 
51
52
  # return an activemerchant response object if successful or else raise an error
@@ -77,5 +78,9 @@ module Spree
77
78
  errors.add(:amount, :greater_than_allowed)
78
79
  end
79
80
  end
81
+
82
+ def update_order
83
+ payment.order.updater.update
84
+ end
80
85
  end
81
86
  end
@@ -2,10 +2,5 @@ module Spree
2
2
  class ZoneMember < Spree::Base
3
3
  belongs_to :zone, class_name: 'Spree::Zone', counter_cache: true, inverse_of: :zone_members
4
4
  belongs_to :zoneable, polymorphic: true
5
-
6
- def name
7
- return nil if zoneable.nil?
8
- zoneable.name
9
- end
10
5
  end
11
6
  end
@@ -3,6 +3,7 @@ Spree::Core::Engine.config.to_prepare do
3
3
  Spree.user_class.class_eval do
4
4
 
5
5
  include Spree::UserApiAuthentication
6
+ include Spree::UserPaymentSource
6
7
  include Spree::UserReporting
7
8
 
8
9
  has_and_belongs_to_many :spree_roles,
@@ -0,0 +1,8 @@
1
+ class EnsurePaymentsHaveNumbers < ActiveRecord::Migration
2
+ def change
3
+ Spree::Payment.where(number: nil).find_each do |payment|
4
+ payment.generate_number
5
+ payment.save
6
+ end
7
+ end
8
+ end
@@ -7,7 +7,6 @@ module Spree
7
7
  included do
8
8
  before_filter :set_current_order
9
9
 
10
- helper_method :current_currency
11
10
  helper_method :current_order
12
11
  helper_method :simple_current_order
13
12
  end
@@ -64,10 +63,6 @@ module Spree
64
63
  end
65
64
  end
66
65
 
67
- def current_currency
68
- Spree::Config[:currency]
69
- end
70
-
71
66
  def ip_address
72
67
  request.remote_ip
73
68
  end
@@ -5,14 +5,17 @@ module Spree
5
5
  extend ActiveSupport::Concern
6
6
 
7
7
  included do
8
-
9
- def current_store
10
- @current_store ||= Spree::Store.current(request.env['SERVER_NAME'])
11
- end
8
+ helper_method :current_currency
12
9
  helper_method :current_store
10
+ end
13
11
 
12
+ def current_currency
13
+ Spree::Config[:currency]
14
14
  end
15
15
 
16
+ def current_store
17
+ @current_store ||= Spree::Store.current(request.env['SERVER_NAME'])
18
+ end
16
19
  end
17
20
  end
18
21
  end
@@ -89,7 +89,11 @@ module Spree
89
89
 
90
90
  per_page = params[:per_page].to_i
91
91
  @properties[:per_page] = per_page > 0 ? per_page : Spree::Config[:products_per_page]
92
- @properties[:page] = (params[:page].to_i <= 0) ? 1 : params[:page].to_i
92
+ if params[:page].respond_to?(:to_i)
93
+ @properties[:page] = (params[:page].to_i <= 0) ? 1 : params[:page].to_i
94
+ else
95
+ @properties[:page] = 1
96
+ end
93
97
  end
94
98
  end
95
99
  end
@@ -1,5 +1,5 @@
1
1
  module Spree
2
2
  def self.version
3
- "3.0.0.rc4"
3
+ "3.0.0"
4
4
  end
5
5
  end
@@ -1,5 +1,10 @@
1
1
  class OrderWalkthrough
2
2
  def self.up_to(state)
3
+ # A default store must exist to provide store settings
4
+ unless Spree::Store.exists?
5
+ FactoryGirl.create(:store)
6
+ end
7
+
3
8
  # A payment method must exist for an order to proceed through the Address state
4
9
  unless Spree::PaymentMethod.exists?
5
10
  FactoryGirl.create(:check_payment_method)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.rc4
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-03 00:00:00.000000000 Z
11
+ date: 2015-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant
@@ -775,6 +775,7 @@ files:
775
775
  - db/migrate/20150128032538_remove_environment_from_tracker.rb
776
776
  - db/migrate/20150128060325_remove_spree_configurations.rb
777
777
  - db/migrate/20150216173445_add_index_to_spree_stock_items_variant_id.rb
778
+ - db/migrate/20150309161154_ensure_payments_have_numbers.rb
778
779
  - db/seeds.rb
779
780
  - lib/generators/spree/custom_user/custom_user_generator.rb
780
781
  - lib/generators/spree/custom_user/templates/authentication_helpers.rb.tt