erp_inventory 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. data/GPL-3-LICENSE +674 -0
  2. data/README.rdoc +2 -0
  3. data/Rakefile +32 -0
  4. data/app/assets/javascripts/erp_inventory/application.js +9 -0
  5. data/app/assets/stylesheets/erp_inventory/application.css +7 -0
  6. data/app/controllers/erp_inventory/application_controller.rb +4 -0
  7. data/app/helpers/erp_inventory/application_helper.rb +4 -0
  8. data/app/models/extensions/product_instance.rb +9 -0
  9. data/app/models/extensions/product_type.rb +3 -0
  10. data/app/models/inv_entry_reln.rb +14 -0
  11. data/app/models/inv_entry_reln_type.rb +4 -0
  12. data/app/models/inv_entry_role_type.rb +4 -0
  13. data/app/models/inventory_entry.rb +21 -0
  14. data/app/models/prod_instance_inv_entry.rb +6 -0
  15. data/app/views/layouts/erp_inventory/application.html.erb +14 -0
  16. data/config/routes.rb +2 -0
  17. data/db/migrate/20080805000050_base_inventory.rb +90 -0
  18. data/db/migrate/20080805000051_base_inventory_indexes.rb +47 -0
  19. data/lib/erp_inventory/engine.rb +10 -0
  20. data/lib/erp_inventory/extensions/active_record/acts_as_inventory_entry.rb +56 -0
  21. data/lib/erp_inventory/extensions.rb +1 -0
  22. data/lib/erp_inventory/version.rb +3 -0
  23. data/lib/erp_inventory.rb +5 -0
  24. data/lib/tasks/erp_inventory_tasks.rake +16 -0
  25. data/spec/dummy/Rakefile +7 -0
  26. data/spec/dummy/app/assets/javascripts/application.js +9 -0
  27. data/spec/dummy/app/assets/stylesheets/application.css +7 -0
  28. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  29. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  30. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  31. data/spec/dummy/config/application.rb +49 -0
  32. data/spec/dummy/config/boot.rb +10 -0
  33. data/spec/dummy/config/database.yml +8 -0
  34. data/spec/dummy/config/environment.rb +5 -0
  35. data/spec/dummy/config/environments/spec.rb +27 -0
  36. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  37. data/spec/dummy/config/initializers/inflections.rb +10 -0
  38. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  39. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  40. data/spec/dummy/config/initializers/session_store.rb +8 -0
  41. data/spec/dummy/config/initializers/wrap_parameters.rb +12 -0
  42. data/spec/dummy/config/locales/en.yml +5 -0
  43. data/spec/dummy/config/routes.rb +4 -0
  44. data/spec/dummy/config.ru +4 -0
  45. data/spec/dummy/public/404.html +26 -0
  46. data/spec/dummy/public/422.html +26 -0
  47. data/spec/dummy/public/500.html +26 -0
  48. data/spec/dummy/public/favicon.ico +0 -0
  49. data/spec/dummy/script/rails +6 -0
  50. data/spec/models/inv_entry_reln_spec.rb +12 -0
  51. data/spec/models/inv_entry_reln_type_spec.rb +13 -0
  52. data/spec/models/inv_entry_role_type_spec.rb +14 -0
  53. data/spec/models/inventory_entry_spec.rb +11 -0
  54. data/spec/models/prod_instance_inv_entry_spec.rb +11 -0
  55. data/spec/spec_helper.rb +60 -0
  56. metadata +202 -0
data/Rakefile ADDED
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
13
+ end
14
+
15
+ RDoc::Task.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'ErpInventory'
18
+ rdoc.options << '--line-numbers'
19
+ rdoc.rdoc_files.include('README.rdoc')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
21
+ end
22
+
23
+ APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
24
+ load 'rails/tasks/engine.rake'
25
+
26
+ Bundler::GemHelper.install_tasks
27
+
28
+ require "rspec/core/rake_task"
29
+ RSpec::Core::RakeTask.new(:spec)
30
+ task :default => :spec
31
+
32
+
@@ -0,0 +1,9 @@
1
+ // This is a manifest file that'll be compiled into including all the files listed below.
2
+ // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
3
+ // be included in the compiled file accessible from http://example.com/assets/application.js
4
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
+ // the compiled file.
6
+ //
7
+ //= require jquery
8
+ //= require jquery_ujs
9
+ //= require_tree .
@@ -0,0 +1,7 @@
1
+ /*
2
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
3
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
4
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
5
+ *= require_self
6
+ *= require_tree .
7
+ */
@@ -0,0 +1,4 @@
1
+ module ErpInventory
2
+ class ApplicationController < ActionController::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module ErpInventory
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -0,0 +1,9 @@
1
+ ProductInstance.class_eval do
2
+
3
+ # A ProductInstance can be referenced by more than one inventory entry via overbooking or
4
+ # "first-come, first serve" inventory strategies. This is a cross-reference entity that
5
+ # allows this kind of relationship, which is optional depending on business circumstances.
6
+ has_many :prod_instance_inv_entries
7
+ has_many :inventory_entries, :through => :prod_instance_inv_entries
8
+
9
+ end
@@ -0,0 +1,3 @@
1
+ ProductType.class_eval do
2
+ has_many :inventory_entries
3
+ end
@@ -0,0 +1,14 @@
1
+ class InvEntryReln < ActiveRecord::Base
2
+
3
+ belongs_to :inv_entry_from, :class_name => "InvEntry", :foreign_key => "inv_entry_id_from"
4
+ belongs_to :inv_entry_to, :class_name => "InvEntry", :foreign_key => "inv_entry_id_to"
5
+
6
+ belongs_to :from_role, :class_name => "InvEntryRoleType", :foreign_key => "role_type_id_from"
7
+ belongs_to :to_role, :class_name => "InvEntryRoleType", :foreign_key => "role_type_id_to"
8
+
9
+ belongs_to :inv_entry_reln_type
10
+
11
+ alias :from_item :inv_entry_from
12
+ alias :to_item :inv_entry_to
13
+
14
+ end
@@ -0,0 +1,4 @@
1
+ class InvEntryRelnType < ActiveRecord::Base
2
+ acts_as_nested_set
3
+ include ErpTechSvcs::Utils::DefaultNestedSetMethods
4
+ end
@@ -0,0 +1,4 @@
1
+ class InvEntryRoleType < ActiveRecord::Base
2
+ acts_as_nested_set
3
+ include ErpTechSvcs::Utils::DefaultNestedSetMethods
4
+ end
@@ -0,0 +1,21 @@
1
+ class InventoryEntry < ActiveRecord::Base
2
+
3
+ belongs_to :inventory_entry_record, :polymorphic => true
4
+ belongs_to :product_type
5
+ has_one :classification, :as => :classification, :class_name => 'CategoryClassification'
6
+ has_many :prod_instance_inv_entries
7
+ has_many :product_instances, :through => :prod_instance_inv_entries do
8
+ def available
9
+ includes([:prod_availability_status_type]).where('prod_availability_status_types.internal_identifier = ?', 'available')
10
+ end
11
+
12
+ def sold
13
+ includes([:prod_availability_status_type]).where('prod_availability_status_types.internal_identifier = ?', 'sold')
14
+ end
15
+ end
16
+
17
+ def to_label
18
+ "#{description}"
19
+ end
20
+
21
+ end
@@ -0,0 +1,6 @@
1
+ class ProdInstanceInvEntry < ActiveRecord::Base
2
+
3
+ belongs_to :product_instance
4
+ belongs_to :inventory_entry
5
+
6
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>ErpInventory</title>
5
+ <%= stylesheet_link_tag "erp_inventory/application" %>
6
+ <%= javascript_include_tag "erp_inventory/application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
data/config/routes.rb ADDED
@@ -0,0 +1,2 @@
1
+ ErpInventory::Engine.routes.draw do
2
+ end
@@ -0,0 +1,90 @@
1
+ class BaseInventory < ActiveRecord::Migration
2
+ def self.up
3
+
4
+ unless table_exists?(:inventory_entries)
5
+ create_table :inventory_entries do |t|
6
+ t.column :description, :string
7
+ t.column :inventory_entry_record_id, :integer
8
+ t.column :inventory_entry_record_type, :string
9
+ t.column :external_identifier, :string
10
+ t.column :external_id_source, :string
11
+ t.column :product_type_id, :integer
12
+ t.column :number_available, :integer
13
+ t.string :sku
14
+ t.integer :number_sold
15
+
16
+ t.timestamps
17
+ end
18
+ end
19
+
20
+ unless table_exists?(:inv_entry_reln_types)
21
+ create_table :inv_entry_reln_types do |t|
22
+ t.column :parent_id, :integer
23
+ t.column :lft, :integer
24
+ t.column :rgt, :integer
25
+ #custom columns go here
26
+ t.column :description, :string
27
+ t.column :comments, :string
28
+ t.column :internal_identifier, :string
29
+ t.column :external_identifier, :string
30
+ t.column :external_id_source, :string
31
+
32
+ t.timestamps
33
+ end
34
+ end
35
+
36
+ unless table_exists?(:inv_entry_role_types)
37
+ create_table :inv_entry_role_types do |t|
38
+ t.column :parent_id, :integer
39
+ t.column :lft, :integer
40
+ t.column :rgt, :integer
41
+ #custom columns go here
42
+ t.column :description, :string
43
+ t.column :comments, :string
44
+ t.column :internal_identifier, :string
45
+ t.column :external_identifier, :string
46
+ t.column :external_id_source, :string
47
+
48
+ t.timestamps
49
+ end
50
+ end
51
+
52
+ unless table_exists?(:inv_entry_relns)
53
+ create_table :inv_entry_relns do |t|
54
+ t.column :inv_entry_reln_type_id, :integer
55
+ t.column :description, :string
56
+ t.column :inv_entry_id_from, :integer
57
+ t.column :inv_entry_id_to, :integer
58
+ t.column :role_type_id_from, :integer
59
+ t.column :role_type_id_to, :integer
60
+ t.column :status_type_id, :integer
61
+ t.column :from_date, :date
62
+ t.column :thru_date, :date
63
+
64
+ t.timestamps
65
+ end
66
+ end
67
+
68
+ unless table_exists?(:prod_instance_inv_entries)
69
+ create_table :prod_instance_inv_entries do |t|
70
+ t.column :product_instance_id, :integer
71
+ t.column :inventory_entry_id, :integer
72
+
73
+ t.timestamps
74
+ end
75
+ end
76
+
77
+ end
78
+
79
+ def self.down
80
+ [
81
+ :prod_instance_inv_entries,:inv_entry_relns,
82
+ :inv_entry_role_types, :inv_entry_reln_types, :inventory_entries
83
+ ].each do |tbl|
84
+ if table_exists?(tbl)
85
+ drop_table tbl
86
+ end
87
+ end
88
+ end
89
+
90
+ end
@@ -0,0 +1,47 @@
1
+ class BaseInventoryIndexes < ActiveRecord::Migration
2
+ def self.up
3
+ add_index :inventory_entries, [:inventory_entry_record_id, :inventory_entry_record_type],
4
+ :name => "bii_1"
5
+
6
+ add_index :inv_entry_reln_types, :parent_id
7
+
8
+ add_index :inv_entry_role_types, :parent_id
9
+
10
+ add_index :inv_entry_relns, :inv_entry_reln_type_id
11
+ add_index :inv_entry_relns, :status_type_id
12
+
13
+ add_index :prod_instance_inv_entries, :product_instance_id
14
+ add_index :prod_instance_inv_entries, :inventory_entry_id
15
+
16
+ ### Conditional checks: since these columns may have been added with a later migration,
17
+ ### we check that the column exists before adding an index on it.
18
+
19
+ if columns(:inventory_entries).include?('product_type_id')
20
+ add_index :inventory_entries, :product_type_id
21
+ end
22
+ end
23
+
24
+ def self.down
25
+ remove_index :inventory_entries, :name => "bii_1"
26
+
27
+ remove_index :inv_entry_reln_types, :parent_id
28
+
29
+ remove_index :inv_entry_role_types, :parent_id
30
+
31
+ remove_index :inv_entry_relns, :inv_entry_reln_type_id
32
+ remove_index :inv_entry_relns, :status_type_id
33
+
34
+ remove_index :prod_instance_inv_entries, :product_instance_id
35
+ remove_index :prod_instance_inv_entries, :inventory_entry_id
36
+
37
+ ### Conditional checks: since these columns were originally added in a later
38
+ ### migration that may not yet have already been run,
39
+ ### we check that the column exists before removing an index on it.
40
+
41
+ if indexes(:inventory_entries).collect {|i|
42
+ i.name}.include?('index_inventory_entries_on_product_type_id')
43
+ remove_index :inventory_entries, :product_type_id
44
+ end
45
+
46
+ end
47
+ end
@@ -0,0 +1,10 @@
1
+ module ErpInventory
2
+ class Engine < Rails::Engine
3
+ isolate_namespace ErpInventory
4
+
5
+ ActiveSupport.on_load(:active_record) do
6
+ include ErpInventory::Extensions::ActiveRecord::ActsAsInventoryEntry
7
+ end
8
+
9
+ end
10
+ end
@@ -0,0 +1,56 @@
1
+ module ErpInventory
2
+ module Extensions
3
+ module ActiveRecord
4
+ module ActsAsInventoryEntry
5
+ def self.included(base)
6
+ base.extend(ClassMethods)
7
+ end
8
+
9
+ module ClassMethods
10
+ def acts_as_inventory_entry
11
+ extend ActsAsInventoryEntry::SingletonMethods
12
+ include ActsAsInventoryEntry::InstanceMethods
13
+
14
+ after_initialize :new_inventory_entry
15
+ after_update :save_inventory
16
+ after_save :save_inventory
17
+ after_destroy :destroy_inventory
18
+
19
+ has_one :inventory_entry, :as => :inventory_entry_record
20
+
21
+ [
22
+ :product_type,:product_type=,
23
+ :product_instances,
24
+ :number_available,:number_available=
25
+ ].each do |m|
26
+ delegate m, :to => :inventory_entry
27
+ end
28
+ end
29
+ end
30
+
31
+ module SingletonMethods
32
+ end
33
+
34
+ module InstanceMethods
35
+ def new_inventory_entry
36
+ if self.new_record? && self.inventory_entry == nil
37
+ self.inventory_entry = InventoryEntry.new
38
+ self.inventory_entry.inventory_entry_record = self
39
+ end
40
+ end
41
+
42
+ def save_inventory
43
+ self.inventory_entry.save
44
+ end
45
+
46
+ def destroy_inventory
47
+ if self.inventory_entry && !self.inventory_entry.frozen?
48
+ self.inventory_entry.destroy
49
+ end
50
+ end
51
+
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1 @@
1
+ require 'erp_inventory/extensions/active_record/acts_as_inventory_entry'
@@ -0,0 +1,3 @@
1
+ module ErpInventory
2
+ VERSION = "3.0.0"
3
+ end
@@ -0,0 +1,5 @@
1
+ require "erp_inventory/extensions"
2
+ require "erp_inventory/engine"
3
+
4
+ module ErpInventory
5
+ end
@@ -0,0 +1,16 @@
1
+ namespace :erp_inventory do
2
+ desc 'Clear all inventory'
3
+ task :clear => :environment do
4
+ InventoryEntry.destroy_all
5
+ end
6
+
7
+ desc 'Initial load for inventory'
8
+ task :initial_load => :environment do
9
+ product_types = ProductType.all
10
+ product_types.each do |product_type|
11
+ count = ProductInstance.count(:conditions => ['product_type_id = ?', product_type.id])
12
+ puts "Creating inventory for #{product_type.description}"
13
+ InventoryEntry.create(:description => "Inventory for #{product_type.description}", :product_type_id => product_type.id, :number_available => count)
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env rake
2
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
3
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
+
5
+ require File.expand_path('../config/application', __FILE__)
6
+
7
+ Dummy::Application.load_tasks
@@ -0,0 +1,9 @@
1
+ // This is a manifest file that'll be compiled into including all the files listed below.
2
+ // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
3
+ // be included in the compiled file accessible from http://example.com/assets/application.js
4
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
+ // the compiled file.
6
+ //
7
+ //= require jquery
8
+ //= require jquery_ujs
9
+ //= require_tree .
@@ -0,0 +1,7 @@
1
+ /*
2
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
3
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
4
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
5
+ *= require_self
6
+ *= require_tree .
7
+ */
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag "application" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,49 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require
6
+ require "erp_base_erp_svcs"
7
+ require "erp_tech_svcs"
8
+ require "erp_app"
9
+ require "erp_agreements"
10
+ require "erp_txns_and_accts"
11
+ require "erp_commerce"
12
+ require "erp_products"
13
+ require "erp_inventory"
14
+
15
+ module Dummy
16
+ class Application < Rails::Application
17
+ # Settings in config/environments/* take precedence over those specified here.
18
+ # Application configuration should go into files in config/initializers
19
+ # -- all .rb files in that directory are automatically loaded.
20
+
21
+ # Custom directories with classes and modules you want to be autoloadable.
22
+ # config.autoload_paths += %W(#{config.root}/extras)
23
+
24
+ # Only load the plugins named here, in the order given (default is alphabetical).
25
+ # :all can be used as a placeholder for all plugins not explicitly named.
26
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
27
+
28
+ # Activate observers that should always be running.
29
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
30
+
31
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
32
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
33
+ # config.time_zone = 'Central Time (US & Canada)'
34
+
35
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
36
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
37
+ # config.i18n.default_locale = :de
38
+
39
+ # Configure the default encoding used in templates for Ruby 1.9.
40
+ config.encoding = "utf-8"
41
+
42
+ # Configure sensitive parameters which will be filtered from the log file.
43
+ config.filter_parameters += [:password]
44
+
45
+ # Enable the asset pipeline
46
+ config.assets.enabled = true
47
+ end
48
+ end
49
+
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
8
+ end
9
+
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,8 @@
1
+ # Warning: The database defined as "test" will be erased and
2
+ # re-generated from your development database when you run "rake".
3
+ # Do not set this db to the same as development or production.
4
+ spec:
5
+ adapter: sqlite3
6
+ database: db/spec.sqlite3
7
+ pool: 5
8
+ timeout: 5000
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,27 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger
20
+ config.active_support.deprecation = :log
21
+
22
+ # Only use best-standards-support built into browsers
23
+ config.action_dispatch.best_standards_support = :builtin
24
+
25
+ # Do not compress assets
26
+ config.assets.compress = false
27
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,10 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = 'ae0d58840f73a49e40850c9d815a6a135e169865cdb8721cec7f335a738af09f3483de0f99d7c131f8fdecf2d8b508f8fd5e2e33c8d0565dcc9030eadb227695'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, :key => '_dummy_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,12 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActionController::Base.wrap_parameters :format => [:json]
8
+
9
+ # Disable root element in JSON by default.
10
+ if defined?(ActiveRecord)
11
+ ActiveRecord::Base.include_root_in_json = false
12
+ end
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,4 @@
1
+ Rails.application.routes.draw do
2
+
3
+ mount ErpInventory::Engine => "/erp_inventory"
4
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application