spree_core 2.0.11 → 2.0.12

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: ce81644f3167d18676644b782d34b38282cc43a4
4
- data.tar.gz: 97ee622222799fab84efe8e61782361e569cf88e
3
+ metadata.gz: 2f6fc34716045492c73cd83a2a7f9e446a0f5a6b
4
+ data.tar.gz: 94a3ffee5660aa9d365687e48197c2caed09936e
5
5
  SHA512:
6
- metadata.gz: 45a8a9e3e94291dae3b17df911b1253303765f11ee78758d1daa66db2b49201735942db84817782f50af9df92ed38580dd427b9b7bbd03b4af208dab8aab4d2d
7
- data.tar.gz: 1cf648e2e2680bb4c055913ed9a856844abde7e59b635f27adadca4b2b4e7f1e110582fbe6e3bacf5a69297d8011b531f8ed83c7b1b40a50e0f6be1f376709fa
6
+ metadata.gz: 73ce47ef477bde8e1f32f37556a55e610b290ab8e69f29518e7f2911401b7b281731383498276f0d0ccf34dd621838d5209b06642b7897526e8c763fd2e51b54
7
+ data.tar.gz: 687cf5058572498f0ed8582a32766056fb1090e74cbf9c5fd7645ffa041b9d38ec82379010e55ec3e1b8ae2fc38afe91c1dd7bddd2edb1ee944a862a7e6198ef
@@ -120,7 +120,7 @@ module Spree
120
120
  countries.collect do |country|
121
121
  country.name = Spree.t(country.iso, scope: 'country_names', default: country.name)
122
122
  country
123
- end.sort { |a, b| a.name.parameterize <=> b.name.parameterize }
123
+ end.sort_by { |c| c.name.parameterize }
124
124
  end
125
125
 
126
126
  def seo_url(taxon)
@@ -78,6 +78,7 @@ module Spree
78
78
 
79
79
  validates :email, presence: true, if: :require_email
80
80
  validates :email, email: true, if: :require_email, allow_blank: true
81
+ validates :number, uniqueness: true
81
82
  validate :has_available_shipment
82
83
  validate :has_available_payment
83
84
 
@@ -286,15 +287,11 @@ module Spree
286
287
  end
287
288
  end
288
289
 
289
- # FIXME refactor this method and implement validation using validates_* utilities
290
290
  def generate_order_number
291
- record = true
292
- while record
291
+ self.number ||= loop do
293
292
  random = "R#{Array.new(9){rand(9)}.join}"
294
- record = self.class.where(number: random).first
293
+ break random unless self.class.exists?(number: random)
295
294
  end
296
- self.number = random if self.number.blank?
297
- self.number
298
295
  end
299
296
 
300
297
  def shipment
@@ -2,8 +2,12 @@ module Spree
2
2
  class ProductDuplicator
3
3
  attr_accessor :product
4
4
 
5
- def initialize(product)
5
+ @@clone_images_default = true
6
+ mattr_accessor :clone_images_default
7
+
8
+ def initialize(product, include_images = @@clone_images_default)
6
9
  @product = product
10
+ @include_images = include_images
7
11
  end
8
12
 
9
13
  def duplicate
@@ -39,7 +43,7 @@ module Spree
39
43
  master.dup.tap do |new_master|
40
44
  new_master.sku = "COPY OF #{master.sku}"
41
45
  new_master.deleted_at = nil
42
- new_master.images = master.images.map { |image| duplicate_image image }
46
+ new_master.images = master.images.map { |image| duplicate_image image } if @include_images
43
47
  new_master.price = master.price
44
48
  new_master.currency = master.currency
45
49
  end
@@ -1,5 +1,5 @@
1
1
  module Spree
2
2
  def self.version
3
- "2.0.11"
3
+ '2.0.12'
4
4
  end
5
5
  end
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: 2.0.11
4
+ version: 2.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-15 00:00:00.000000000 Z
11
+ date: 2014-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.42.3
19
+ version: 1.43.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.42.3
26
+ version: 1.43.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: acts_as_list
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '1.16'
103
+ version: 1.22.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '1.16'
110
+ version: 1.22.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: highline
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -212,14 +212,14 @@ dependencies:
212
212
  requirements:
213
213
  - - "~>"
214
214
  - !ruby/object:Gem::Version
215
- version: 3.2.17
215
+ version: 3.2.18
216
216
  type: :runtime
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - "~>"
221
221
  - !ruby/object:Gem::Version
222
- version: 3.2.17
222
+ version: 3.2.18
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: ransack
225
225
  requirement: !ruby/object:Gem::Requirement
@@ -664,7 +664,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
664
664
  version: '0'
665
665
  requirements: []
666
666
  rubyforge_project:
667
- rubygems_version: 2.2.0
667
+ rubygems_version: 2.2.2
668
668
  signing_key:
669
669
  specification_version: 4
670
670
  summary: The bare bones necessary for Spree.