spree_variant_options 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +54 -40
- data/Versionfile +1 -0
- data/app/assets/javascripts/store/product_variant_options.js +24 -0
- data/app/assets/javascripts/store/variant_options.js +2 -1
- data/app/assets/stylesheets/store/{variant_options.css → variant_options.css.erb} +1 -6
- data/app/controllers/spree/admin/option_values_controller.rb +18 -0
- data/app/models/option_value_decorator.rb +1 -1
- data/app/models/product_decorator.rb +1 -1
- data/app/overrides/spree_variant_options.rb +26 -5
- data/app/views/spree/admin/option_types/_option_value_fields.html.erb +7 -0
- data/app/views/spree/admin/option_values/_table_header.html.erb +7 -0
- data/app/views/{products → spree/products}/_variant_options.html.erb +2 -7
- data/config/routes.rb +4 -6
- data/db/migrate/20120213174249_add_image_to_option_values.rb +8 -0
- data/features/{admin_option_types.feature → spree/admin/option_types.feature} +0 -0
- data/features/{variant_options.feature → spree/variant_options.feature} +0 -0
- data/features/step_definitions/option_values.rb +8 -8
- data/features/step_definitions/variant_options.rb +6 -5
- data/features/step_definitions/web_steps.rb +36 -10
- data/features/support/env.rb +4 -6
- data/lib/generators/spree_variant_options/install_generator.rb +9 -26
- data/lib/spree_variant_options.rb +5 -21
- data/lib/spree_variant_options/engine.rb +19 -0
- data/lib/spree_variant_options/version.rb +1 -1
- data/spree_variant_options.gemspec +3 -3
- data/test/dummy_hooks/before_migrate.rb +16 -10
- data/test/dummy_hooks/templates/spree_user_error_fix.rb +3 -0
- data/test/dummy_hooks/templates/store/screen.css +749 -0
- data/test/support/factories.rb +8 -8
- data/test/support/user_fix.rb +5 -0
- data/test/test_helper.rb +1 -2
- data/test/unit/{option_value_test.rb → spree/option_value_test.rb} +4 -4
- data/test/unit/{product_test.rb → spree/product_test.rb} +1 -1
- metadata +45 -38
- data/app/assets/javascripts/store/product.js +0 -38
- data/app/controllers/admin/option_values_controller.rb +0 -14
- data/app/views/admin/option_types/_option_value_fields.html.erb +0 -8
- data/app/views/admin/option_types/edit.html.erb +0 -33
- data/lib/generators/templates/db/migrate/add_image_to_option_values.rb +0 -14
data/test/support/factories.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
FactoryGirl.define do
|
2
2
|
|
3
|
-
factory :product do
|
3
|
+
factory :product, :class => Spree::Product do
|
4
4
|
name "Very Wearily Variantly"
|
5
5
|
description "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla nonummy aliquet mi. Proin lacus. Ut placerat. Proin consequat, justo sit amet tempus consequat, elit est adipiscing odio, ut egestas pede eros in diam. Proin varius, lacus vitae suscipit varius, ipsum eros convallis nisi, sit amet sodales lectus pede non est. Duis augue. Suspendisse hendrerit pharetra metus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Curabitur nec pede. Quisque volutpat, neque ac porttitor sodales, sem lacus rutrum nulla, ullamcorper placerat ante tortor ac odio. Suspendisse vel libero. Nullam volutpat magna vel ligula. Suspendisse sit amet metus. Nunc quis massa. Nulla facilisi. In enim. In venenatis nisi id eros. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc sit amet felis sed lectus tincidunt egestas. Mauris nibh."
|
6
6
|
available_on { Time.zone.now - 1.day }
|
@@ -13,15 +13,15 @@ FactoryGirl.define do
|
|
13
13
|
after_create { |product|
|
14
14
|
sizes = %w(Small Medium Large X-Large).map{|i| Factory.create(:option_value, :presentation => i) }
|
15
15
|
colors = %w(Red Green Blue Yellow Purple Gray Black White).map{|i|
|
16
|
-
Factory.create(:option_value, :presentation => i, :option_type => OptionType.find_by_name("color") || Factory.create(:option_type, :presentation => "Color"))
|
16
|
+
Factory.create(:option_value, :presentation => i, :option_type => Spree::OptionType.find_by_name("color") || Factory.create(:option_type, :presentation => "Color"))
|
17
17
|
}
|
18
18
|
product.variants = sizes.map{|i| colors.map{|j| Factory.create(:variant, :product => product, :option_values => [i, j]) }}.flatten
|
19
|
-
product.option_types = OptionType.where(:name => %w(size color))
|
19
|
+
product.option_types = Spree::OptionType.where(:name => %w(size color))
|
20
20
|
}
|
21
21
|
end
|
22
22
|
|
23
|
-
factory :variant do
|
24
|
-
product { Product.last || Factory.create(:product) }
|
23
|
+
factory :variant, :class => Spree::Variant do
|
24
|
+
product { Spree::Product.last || Factory.create(:product) }
|
25
25
|
option_values { [OptionValue.last || Factory.create(:option_value)] }
|
26
26
|
sequence(:sku) { |n| "ROR-#{1000 + n}" }
|
27
27
|
sequence(:price) { |n| 19.99 + n }
|
@@ -29,16 +29,16 @@ FactoryGirl.define do
|
|
29
29
|
count_on_hand 10
|
30
30
|
end
|
31
31
|
|
32
|
-
factory :option_type do
|
32
|
+
factory :option_type, :class => Spree::OptionType do
|
33
33
|
presentation "Size"
|
34
34
|
name { presentation.downcase }
|
35
35
|
#sequence(:position) {|n| n }
|
36
36
|
end
|
37
37
|
|
38
|
-
factory :option_value do
|
38
|
+
factory :option_value, :class => Spree::OptionValue do
|
39
39
|
presentation "Large"
|
40
40
|
name { presentation.downcase }
|
41
|
-
option_type { OptionType.last || Factory.create(:option_type) }
|
41
|
+
option_type { Spree::OptionType.last || Factory.create(:option_type) }
|
42
42
|
#sequence(:position) {|n| n }
|
43
43
|
end
|
44
44
|
|
data/test/test_helper.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
class OptionValueTest < ActiveSupport::TestCase
|
3
|
+
class Spree::OptionValueTest < ActiveSupport::TestCase
|
4
4
|
|
5
5
|
setup do
|
6
|
-
@images = Dir[File.expand_path("
|
6
|
+
@images = Dir[File.expand_path("../../../support/images/*", __FILE__)]
|
7
7
|
end
|
8
8
|
|
9
9
|
should_have_attached_file :image
|
@@ -11,7 +11,7 @@ class OptionValueTest < ActiveSupport::TestCase
|
|
11
11
|
context "a new option value" do
|
12
12
|
|
13
13
|
setup do
|
14
|
-
@option_value = OptionValue.new
|
14
|
+
@option_value = Spree::OptionValue.new
|
15
15
|
end
|
16
16
|
|
17
17
|
should "not have an image" do
|
@@ -44,7 +44,7 @@ class OptionValueTest < ActiveSupport::TestCase
|
|
44
44
|
end
|
45
45
|
|
46
46
|
should "have small large and original images" do
|
47
|
-
dir = File.expand_path("
|
47
|
+
dir = File.expand_path("../../../dummy/public/system/images/#{@option_value.id}", __FILE__)
|
48
48
|
%w(small large original).each do |size|
|
49
49
|
assert File.exists?(File.join(dir, size, File.basename(@path)))
|
50
50
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_variant_options
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,44 +9,44 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-02-27 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: spree_core
|
16
|
-
requirement: &
|
16
|
+
requirement: &70218045579800 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
21
|
+
version: 1.0.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70218045579800
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: spree_sample
|
27
|
-
requirement: &
|
27
|
+
requirement: &70218045579220 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0.
|
32
|
+
version: 1.0.0
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70218045579220
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: dummier
|
38
|
-
requirement: &
|
38
|
+
requirement: &70218045578360 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.
|
43
|
+
version: 0.3.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70218045578360
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: shoulda
|
49
|
-
requirement: &
|
49
|
+
requirement: &70218045577460 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 3.0.0.beta2
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70218045577460
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: factory_girl
|
60
|
-
requirement: &
|
60
|
+
requirement: &70218045576200 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 2.3.2
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70218045576200
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: cucumber-rails
|
71
|
-
requirement: &
|
71
|
+
requirement: &70218045575120 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 1.2.1
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70218045575120
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: database_cleaner
|
82
|
-
requirement: &
|
82
|
+
requirement: &70218045574360 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: 0.6.7
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70218045574360
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: sqlite3
|
93
|
-
requirement: &
|
93
|
+
requirement: &70218045573380 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,7 +98,7 @@ dependencies:
|
|
98
98
|
version: 1.3.4
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *70218045573380
|
102
102
|
description: Spree Variant Options is a simple spree extension that replaces the radio-button
|
103
103
|
variant selection with groups of option types and values. Please see the documentation
|
104
104
|
for more details.
|
@@ -116,37 +116,40 @@ files:
|
|
116
116
|
- Rakefile
|
117
117
|
- Versionfile
|
118
118
|
- app/assets/images/store/out-of-stock.png
|
119
|
-
- app/assets/javascripts/store/
|
119
|
+
- app/assets/javascripts/store/product_variant_options.js
|
120
120
|
- app/assets/javascripts/store/variant_options.js
|
121
|
-
- app/assets/stylesheets/store/variant_options.css
|
122
|
-
- app/controllers/admin/option_values_controller.rb
|
121
|
+
- app/assets/stylesheets/store/variant_options.css.erb
|
122
|
+
- app/controllers/spree/admin/option_values_controller.rb
|
123
123
|
- app/models/option_value_decorator.rb
|
124
124
|
- app/models/product_decorator.rb
|
125
125
|
- app/overrides/spree_variant_options.rb
|
126
|
-
- app/views/admin/option_types/_option_value_fields.html.erb
|
127
|
-
- app/views/admin/
|
128
|
-
- app/views/products/_variant_options.html.erb
|
126
|
+
- app/views/spree/admin/option_types/_option_value_fields.html.erb
|
127
|
+
- app/views/spree/admin/option_values/_table_header.html.erb
|
128
|
+
- app/views/spree/products/_variant_options.html.erb
|
129
129
|
- config/cucumber.yml
|
130
130
|
- config/routes.rb
|
131
|
-
-
|
131
|
+
- db/migrate/20120213174249_add_image_to_option_values.rb
|
132
|
+
- features/spree/admin/option_types.feature
|
133
|
+
- features/spree/variant_options.feature
|
132
134
|
- features/step_definitions/option_values.rb
|
133
135
|
- features/step_definitions/variant_options.rb
|
134
136
|
- features/step_definitions/web_steps.rb
|
135
137
|
- features/support/env.rb
|
136
138
|
- features/support/paths.rb
|
137
139
|
- features/support/selectors.rb
|
138
|
-
- features/variant_options.feature
|
139
140
|
- lib/generators/spree_variant_options/install_generator.rb
|
140
|
-
- lib/generators/templates/db/migrate/add_image_to_option_values.rb
|
141
141
|
- lib/spree_variant_options.rb
|
142
|
+
- lib/spree_variant_options/engine.rb
|
142
143
|
- lib/spree_variant_options/version.rb
|
143
144
|
- spree_variant_options.gemspec
|
144
145
|
- test/dummy_hooks/after_migrate.rb.sample
|
145
146
|
- test/dummy_hooks/before_migrate.rb
|
146
147
|
- test/dummy_hooks/templates/admin/all.css
|
147
148
|
- test/dummy_hooks/templates/admin/all.js
|
149
|
+
- test/dummy_hooks/templates/spree_user_error_fix.rb
|
148
150
|
- test/dummy_hooks/templates/store/all.css
|
149
151
|
- test/dummy_hooks/templates/store/all.js
|
152
|
+
- test/dummy_hooks/templates/store/screen.css
|
150
153
|
- test/support/factories.rb
|
151
154
|
- test/support/helper_methods.rb
|
152
155
|
- test/support/images/1.gif
|
@@ -159,9 +162,10 @@ files:
|
|
159
162
|
- test/support/images/3.jpg
|
160
163
|
- test/support/images/3.png
|
161
164
|
- test/support/paperclip.rb
|
165
|
+
- test/support/user_fix.rb
|
162
166
|
- test/test_helper.rb
|
163
|
-
- test/unit/option_value_test.rb
|
164
|
-
- test/unit/product_test.rb
|
167
|
+
- test/unit/spree/option_value_test.rb
|
168
|
+
- test/unit/spree/product_test.rb
|
165
169
|
homepage: https://github.com/citrus/spree_variant_options
|
166
170
|
licenses: []
|
167
171
|
post_install_message:
|
@@ -176,7 +180,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
176
180
|
version: '0'
|
177
181
|
segments:
|
178
182
|
- 0
|
179
|
-
hash: -
|
183
|
+
hash: -34473155772268830
|
180
184
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
181
185
|
none: false
|
182
186
|
requirements:
|
@@ -185,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
189
|
version: '0'
|
186
190
|
segments:
|
187
191
|
- 0
|
188
|
-
hash: -
|
192
|
+
hash: -34473155772268830
|
189
193
|
requirements: []
|
190
194
|
rubyforge_project: spree_variant_options
|
191
195
|
rubygems_version: 1.8.10
|
@@ -194,20 +198,22 @@ specification_version: 3
|
|
194
198
|
summary: Spree Variant Options is a simple spree extension that replaces the radio-button
|
195
199
|
variant selection with groups of option types and values.
|
196
200
|
test_files:
|
197
|
-
- features/
|
201
|
+
- features/spree/admin/option_types.feature
|
202
|
+
- features/spree/variant_options.feature
|
198
203
|
- features/step_definitions/option_values.rb
|
199
204
|
- features/step_definitions/variant_options.rb
|
200
205
|
- features/step_definitions/web_steps.rb
|
201
206
|
- features/support/env.rb
|
202
207
|
- features/support/paths.rb
|
203
208
|
- features/support/selectors.rb
|
204
|
-
- features/variant_options.feature
|
205
209
|
- test/dummy_hooks/after_migrate.rb.sample
|
206
210
|
- test/dummy_hooks/before_migrate.rb
|
207
211
|
- test/dummy_hooks/templates/admin/all.css
|
208
212
|
- test/dummy_hooks/templates/admin/all.js
|
213
|
+
- test/dummy_hooks/templates/spree_user_error_fix.rb
|
209
214
|
- test/dummy_hooks/templates/store/all.css
|
210
215
|
- test/dummy_hooks/templates/store/all.js
|
216
|
+
- test/dummy_hooks/templates/store/screen.css
|
211
217
|
- test/support/factories.rb
|
212
218
|
- test/support/helper_methods.rb
|
213
219
|
- test/support/images/1.gif
|
@@ -220,6 +226,7 @@ test_files:
|
|
220
226
|
- test/support/images/3.jpg
|
221
227
|
- test/support/images/3.png
|
222
228
|
- test/support/paperclip.rb
|
229
|
+
- test/support/user_fix.rb
|
223
230
|
- test/test_helper.rb
|
224
|
-
- test/unit/option_value_test.rb
|
225
|
-
- test/unit/product_test.rb
|
231
|
+
- test/unit/spree/option_value_test.rb
|
232
|
+
- test/unit/spree/product_test.rb
|
@@ -1,38 +0,0 @@
|
|
1
|
-
var add_image_handlers = function() {
|
2
|
-
$("#main-image").data('selectedThumb', $('#main-image img').attr('src'));
|
3
|
-
$('ul.thumbnails li').eq(0).addClass('selected');
|
4
|
-
$('ul.thumbnails li a').click(function() {
|
5
|
-
$("#main-image").data('selectedThumb', $(this).attr('href'));
|
6
|
-
$('ul.thumbnails li').removeClass('selected');
|
7
|
-
$(this).parent('li').addClass('selected');
|
8
|
-
return false;
|
9
|
-
}).hover(function() {
|
10
|
-
$('#main-image img').attr('src', $(this).attr('href').replace('mini', 'product'));
|
11
|
-
}, function() {
|
12
|
-
$('#main-image img').attr('src', $("#main-image").data('selectedThumb'));
|
13
|
-
});
|
14
|
-
};
|
15
|
-
|
16
|
-
var select_variant = function(vid, text) {
|
17
|
-
jQuery("#variant-thumbnails").empty();
|
18
|
-
jQuery("#variant-images span").html(text);
|
19
|
-
if (images[vid].length > 0) {
|
20
|
-
$.each(images[vid], function(i, link) {
|
21
|
-
jQuery("#variant-thumbnails").append('<li>' + link + '</li>');
|
22
|
-
});
|
23
|
-
jQuery("#variant-images").show();
|
24
|
-
} else {
|
25
|
-
jQuery("#variant-images").hide();
|
26
|
-
}
|
27
|
-
add_image_handlers();
|
28
|
-
var link = jQuery("#variant-thumbnails a")[0];
|
29
|
-
jQuery("#main-image img").attr({src: jQuery(link).attr('href')});
|
30
|
-
jQuery('ul.thumbnails li').removeClass('selected');
|
31
|
-
jQuery(link).parent('li').addClass('selected');
|
32
|
-
}
|
33
|
-
|
34
|
-
jQuery(document).ready(function() {
|
35
|
-
add_image_handlers();
|
36
|
-
jQuery("#variant-thumbnails").empty();
|
37
|
-
jQuery("#variant-images").hide();
|
38
|
-
});
|
@@ -1,14 +0,0 @@
|
|
1
|
-
class Admin::OptionValuesController < Admin::BaseController
|
2
|
-
|
3
|
-
def update_positions
|
4
|
-
params[:positions].each do |id, index|
|
5
|
-
OptionValue.update_all(['position=?', index], ['id=?', id])
|
6
|
-
end
|
7
|
-
|
8
|
-
respond_to do |format|
|
9
|
-
format.html { redirect_to edit_admin_option_type_url(params[:id]) }
|
10
|
-
format.js { render :text => 'Ok' }
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
@@ -1,8 +0,0 @@
|
|
1
|
-
<tr class="option_value fields" id="<%= dom_id(f.object) %>">
|
2
|
-
<td><span class="handle"></span></td>
|
3
|
-
<td><%= f.text_field :name %></td>
|
4
|
-
<td><%= f.text_field :presentation %></td>
|
5
|
-
<td><%= image_tag f.object.image.url(:small) if f.object.has_image? %></td>
|
6
|
-
<td><%= f.file_field :image %></td>
|
7
|
-
<td class="actions"><%= link_to_remove_fields t("remove"), f %></td>
|
8
|
-
</tr>
|
@@ -1,33 +0,0 @@
|
|
1
|
-
<%= render :partial => 'admin/shared/product_sub_menu' %>
|
2
|
-
<h1><%= t("editing_option_type") %></h1>
|
3
|
-
<%= render 'shared/error_messages', :target => @option_type %>
|
4
|
-
<%= form_for(@option_type, :url => object_url, :html => { :method => :put, :multipart => true }) do |f| %>
|
5
|
-
<fieldset>
|
6
|
-
<legend><%= t("editing_option_type") %></legend>
|
7
|
-
<%= render :partial => "form", :locals => { :f => f } %>
|
8
|
-
<h3><%= t("option_values") %></h3>
|
9
|
-
<table class="index sortable">
|
10
|
-
<thead>
|
11
|
-
<tr>
|
12
|
-
<th colspan="2"><%= t("name") %></th>
|
13
|
-
<th><%= t("display") %></th>
|
14
|
-
<th><%= t("preview") %></th>
|
15
|
-
<th><%= t("image") %></th>
|
16
|
-
<th></th>
|
17
|
-
</tr>
|
18
|
-
</thead>
|
19
|
-
<tbody id="option_values">
|
20
|
-
<% if @option_type.option_values.empty? %>
|
21
|
-
<tr id="none">
|
22
|
-
<td colspan="6"><%= @option_type.option_values.empty? ? t("none") : "" %></td>
|
23
|
-
</tr>
|
24
|
-
<% end %>
|
25
|
-
<%= f.fields_for :option_values do |option_value_form| %>
|
26
|
-
<%= render "option_value_fields", :f => option_value_form %>
|
27
|
-
<% end %>
|
28
|
-
</tbody>
|
29
|
-
</table>
|
30
|
-
<%= link_to_add_fields t("add_option_value"), "tbody#option_values", f, :option_values %>
|
31
|
-
<%= render :partial => 'admin/shared/edit_resource_links' %>
|
32
|
-
</fieldset>
|
33
|
-
<% end %>
|
@@ -1,14 +0,0 @@
|
|
1
|
-
class AddImageToOptionValues < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
add_column :option_values, :image_file_name, :string
|
4
|
-
add_column :option_values, :image_content_type, :string
|
5
|
-
add_column :option_values, :image_file_size, :integer
|
6
|
-
add_column :option_values, :image_updated_at, :datetime
|
7
|
-
end
|
8
|
-
def self.down
|
9
|
-
remove_column :option_values, :image_file_name
|
10
|
-
remove_column :option_values, :image_content_type
|
11
|
-
remove_column :option_values, :image_file_size
|
12
|
-
remove_column :option_values, :image_updated_at
|
13
|
-
end
|
14
|
-
end
|