erp_products 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/app/controllers/erp_products/erp_app/desktop/product_manager/base_controller.rb +1 -1
  2. data/app/models/product_type.rb +2 -2
  3. data/lib/erp_products/engine.rb +7 -1
  4. data/lib/erp_products/version.rb +7 -1
  5. data/lib/erp_products.rb +1 -0
  6. data/public/javascripts/erp_app/desktop/applications/product_manager/module.js +713 -718
  7. data/public/javascripts/erp_app/desktop/applications/product_manager/product_list_panel.js +127 -128
  8. data/spec/dummy/Rakefile +7 -0
  9. data/spec/dummy/app/assets/javascripts/application.js +9 -0
  10. data/spec/dummy/app/assets/stylesheets/application.css +7 -0
  11. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  12. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  13. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  14. data/spec/dummy/config/application.rb +49 -0
  15. data/spec/dummy/config/boot.rb +10 -0
  16. data/spec/dummy/config/database.yml +8 -0
  17. data/spec/dummy/config/environment.rb +5 -0
  18. data/spec/dummy/config/environments/spec.rb +27 -0
  19. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  20. data/spec/dummy/config/initializers/inflections.rb +10 -0
  21. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  22. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  23. data/spec/dummy/config/initializers/session_store.rb +8 -0
  24. data/spec/dummy/config/initializers/wrap_parameters.rb +12 -0
  25. data/spec/dummy/config/locales/en.yml +5 -0
  26. data/spec/dummy/config/routes.rb +3 -0
  27. data/spec/dummy/config.ru +4 -0
  28. data/spec/dummy/public/404.html +26 -0
  29. data/spec/dummy/public/422.html +26 -0
  30. data/spec/dummy/public/500.html +26 -0
  31. data/spec/dummy/public/favicon.ico +0 -0
  32. data/spec/dummy/script/rails +6 -0
  33. data/spec/models/prod_availability_status_type_spec.rb +11 -0
  34. data/spec/models/prod_instance_reln_spec.rb +11 -0
  35. data/spec/models/prod_instance_reln_type_spec.rb +11 -0
  36. data/spec/models/prod_instance_role_type_spec.rb +11 -0
  37. data/spec/models/prod_type_reln_spec.rb +11 -0
  38. data/spec/models/prod_type_reln_type_spec.rb +12 -0
  39. data/spec/models/prod_type_role_type_spec.rb +12 -0
  40. data/spec/models/product_instance_spec.rb +13 -0
  41. data/spec/models/product_offer_spec.rb +12 -0
  42. data/spec/models/product_package_spec.rb +12 -0
  43. data/spec/models/product_type_spec.rb +13 -0
  44. data/spec/models/simple_product_offer_spec.rb +14 -0
  45. data/spec/spec_helper.rb +60 -0
  46. metadata +110 -34
@@ -8,7 +8,7 @@ module ErpProducts
8
8
  {
9
9
  :id => product_type.id,
10
10
  :title => product_type.description,
11
- :imageUrl => product_type.images.empty? ? '/images/img_blank.png' : product_type.images.first.data.url,
11
+ :imageUrl => product_type.images.empty? ? '/images/img_blank.png' : product_type.images.first.data.url(nil, :escape => false),
12
12
  :price => product_type.get_current_simple_amount_with_currency.nil? ? 'no price set' : product_type.get_current_simple_amount_with_currency,
13
13
  :available => product_type.inventory_entries.first.number_available,
14
14
  :sold => product_type.inventory_entries.first.number_sold,
@@ -30,8 +30,8 @@ class ProductType < ActiveRecord::Base
30
30
  end
31
31
 
32
32
  def images_path
33
- file_support = ErpTechSvcs::FileSupport::Base.new(:storage => ErpTechSvcs::FileSupport.options[:storage])
34
- File.join(file_support.root,'products/images',"#{self.description.underscore}_#{self.id}")
33
+ file_support = ErpTechSvcs::FileSupport::Base.new(:storage => Rails.application.config.erp_tech_svcs.file_storage)
34
+ File.join(file_support.root,Rails.application.config.erp_tech_svcs.file_assets_location,'products','images',"#{self.description.underscore}_#{self.id}")
35
35
  end
36
36
 
37
37
  end
@@ -11,6 +11,12 @@ module ErpProducts
11
11
  include ErpProducts::Extensions::ActiveRecord::ActsAsProductOffer
12
12
  include ErpProducts::Extensions::ActiveRecord::ActsAsProductType
13
13
  end
14
-
14
+
15
+ #TODO
16
+ #this will be removed once rails 3.2 adds the ability to set the order of engine loading
17
+ engine = self
18
+ config.to_prepare do
19
+ ErpBaseErpSvcs.register_compass_ae_engine(engine)
20
+ end
15
21
  end
16
22
  end
@@ -1,3 +1,9 @@
1
1
  module ErpProducts
2
- VERSION = "3.0.0"
2
+ module VERSION #:nodoc:
3
+ MAJOR = 3
4
+ MINOR = 0
5
+ TINY = 1
6
+
7
+ STRING = [MAJOR, MINOR, TINY].compact.join('.')
8
+ end
3
9
  end
data/lib/erp_products.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require "erp_products/version"
1
2
  require "erp_products/extensions"
2
3
  require "erp_products/engine"
3
4