piggybak_variants 0.0.2 → 0.0.4
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.
|
13
|
+
map[variant.option_values.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
|
-
default_scope :order => "position ASC"
|
9
|
+
default_scope :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.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -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: 4538040221749696801
|
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: 4538040221749696801
|
115
115
|
requirements: []
|
116
116
|
rubyforge_project:
|
117
117
|
rubygems_version: 1.8.23
|