spree_zone_pricing 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2 +1,51 @@
1
1
  require 'spree_core'
2
- require 'spree_auth'
2
+ require 'spree_zone_pricing_hooks'
3
+
4
+ module SpreeZonePricing
5
+
6
+ class Engine < Rails::Engine
7
+
8
+ config.autoload_paths += %W(#{config.root}/lib)
9
+
10
+ def self.activate
11
+
12
+ =begin
13
+ Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c|
14
+ Rails.env.production? ? require(c) : load(c)
15
+ end
16
+
17
+ ::Product.class_eval do
18
+ accepts_nested_attributes_for :translations
19
+ end
20
+
21
+ ::ProductProperty.class_eval do
22
+ accepts_nested_attributes_for :translations, :reject_if => proc { |attributes| attributes['value'].blank? }
23
+ validates_presence_of :value
24
+ end
25
+
26
+ ::Property.class_eval do
27
+ accepts_nested_attributes_for :translations
28
+ end
29
+
30
+ ::Taxon.class_eval do
31
+ accepts_nested_attributes_for :translations
32
+ end
33
+
34
+ ::OptionType.class_eval do
35
+ accepts_nested_attributes_for :translations, :reject_if => proc { |attributes| attributes['presentation'].blank? }
36
+ accepts_nested_attributes_for :option_values, :allow_destroy => true
37
+ end
38
+
39
+ ::OptionValue.class_eval do
40
+ accepts_nested_attributes_for :translations, :reject_if => proc { |attributes| attributes['presentation'].blank? }
41
+ validates_presence_of :name
42
+ end
43
+ =end
44
+
45
+ end
46
+
47
+ config.to_prepare &method(:activate).to_proc
48
+
49
+ end
50
+
51
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_zone_pricing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -20,7 +20,6 @@ extensions: []
20
20
  extra_rdoc_files: []
21
21
  files:
22
22
  - app/models/zone_price.rb
23
- - app/overrides/xxx.rb
24
23
  - app/views/admin/shared/_zone_prices.html.erb
25
24
  - app/views/admin/shared/_zp_product_tab.html.erb
26
25
  - app/views/admin/variants/zone_prices.html.erb
@@ -30,6 +29,7 @@ files:
30
29
  - config/locales/en_spree.yml
31
30
  - db/seeds.rb
32
31
  - lib/spree_zone_pricing.rb
32
+ - lib/spree_zone_pricing_hooks.rb
33
33
  - lib/spree/zone_pricing/checkouts_controller.rb
34
34
  - lib/spree/zone_pricing/countries_controller.rb
35
35
  - lib/spree/zone_pricing/get_country.rb