piggybak_variants 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,7 @@ module PiggybakVariantsHelper
|
|
10
10
|
def variant_map(object)
|
11
11
|
map = {}
|
12
12
|
object.variants.available.each do |variant|
|
13
|
-
map[variant.option_values.map { |ov| ov.id }.join('_')] = { :id => variant.piggybak_sellable.id, :price => number_to_currency(variant.piggybak_sellable.price) }
|
13
|
+
map[variant.option_values.ordered.map { |ov| ov.id }.join('_')] = { :id => variant.piggybak_sellable.id, :price => number_to_currency(variant.piggybak_sellable.price) }
|
14
14
|
end
|
15
15
|
map.to_json
|
16
16
|
end
|
@@ -6,7 +6,7 @@ module PiggybakVariants
|
|
6
6
|
has_and_belongs_to_many :variants
|
7
7
|
belongs_to :option, :inverse_of => :option_values
|
8
8
|
|
9
|
-
|
9
|
+
scope :ordered, :include => :option, :order => "options.position ASC, option_values.position ASC"
|
10
10
|
|
11
11
|
def admin_label
|
12
12
|
"#{self.option.name}: #{self.name}"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: piggybak_variants
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -102,7 +102,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
102
102
|
version: '0'
|
103
103
|
segments:
|
104
104
|
- 0
|
105
|
-
hash:
|
105
|
+
hash: -4598558641619927151
|
106
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
107
|
none: false
|
108
108
|
requirements:
|
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
version: '0'
|
112
112
|
segments:
|
113
113
|
- 0
|
114
|
-
hash:
|
114
|
+
hash: -4598558641619927151
|
115
115
|
requirements: []
|
116
116
|
rubyforge_project:
|
117
117
|
rubygems_version: 1.8.23
|