erp_txns_and_accts 3.0.0 → 3.0.1

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.
Files changed (69) hide show
  1. data/GPL-3-LICENSE +0 -0
  2. data/app/models/biz_txn_acct_pty_rtype.rb +4 -0
  3. data/app/models/biz_txn_acct_root.rb +15 -3
  4. data/app/models/extensions/money.rb +1 -2
  5. data/app/models/extensions/party.rb +6 -10
  6. data/app/models/financial_txn.rb +12 -55
  7. data/app/models/financial_txn_account.rb +5 -32
  8. data/db/migrate/20080805000030_base_txns_and_accts.rb +10 -7
  9. data/db/migrate/upgrade/20120118135738_add_type_column_to_biz_txn_acct_root.rb +7 -0
  10. data/db/migrate/upgrade/20120118143602_add_apply_date_to_financial_txn.rb +7 -0
  11. data/db/migrate/upgrade/20120515155000_update_financial_txn_acct_due_date.rb +9 -0
  12. data/lib/erp_txns_and_accts/engine.rb +7 -1
  13. data/lib/erp_txns_and_accts/extensions/active_record/acts_as_biz_txn_account.rb +6 -4
  14. data/lib/erp_txns_and_accts/extensions/active_record/acts_as_biz_txn_event.rb +1 -1
  15. data/lib/erp_txns_and_accts/extensions/active_record/acts_as_financial_txn_account.rb +9 -4
  16. data/lib/erp_txns_and_accts/version.rb +7 -1
  17. data/lib/erp_txns_and_accts.rb +1 -0
  18. data/spec/dummy/Rakefile +7 -0
  19. data/spec/dummy/app/assets/javascripts/application.js +9 -0
  20. data/spec/dummy/app/assets/stylesheets/application.css +7 -0
  21. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  22. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  23. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  24. data/spec/dummy/config/application.rb +48 -0
  25. data/spec/dummy/config/boot.rb +10 -0
  26. data/spec/dummy/config/database.yml +8 -0
  27. data/spec/dummy/config/environment.rb +5 -0
  28. data/spec/dummy/config/environments/spec.rb +27 -0
  29. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  30. data/spec/dummy/config/initializers/inflections.rb +10 -0
  31. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  32. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  33. data/spec/dummy/config/initializers/session_store.rb +8 -0
  34. data/spec/dummy/config/initializers/wrap_parameters.rb +12 -0
  35. data/spec/dummy/config/locales/en.yml +5 -0
  36. data/spec/dummy/config/routes.rb +3 -0
  37. data/spec/dummy/config.ru +4 -0
  38. data/spec/dummy/public/404.html +26 -0
  39. data/spec/dummy/public/422.html +26 -0
  40. data/spec/dummy/public/500.html +26 -0
  41. data/spec/dummy/public/favicon.ico +0 -0
  42. data/spec/dummy/script/rails +6 -0
  43. data/spec/factories/basic.rb +13 -0
  44. data/spec/models/base_txn_context_spec.rb +11 -0
  45. data/spec/models/biz_acct_txn_task_spec.rb +11 -0
  46. data/spec/models/biz_txn_acct_party_role_spec.rb +11 -0
  47. data/spec/models/biz_txn_acct_pty_rtype_spec.rb +11 -0
  48. data/spec/models/biz_txn_acct_rel_type_spec.rb +11 -0
  49. data/spec/models/biz_txn_acct_relationship_spec.rb +11 -0
  50. data/spec/models/biz_txn_acct_root_spec.rb +12 -0
  51. data/spec/models/biz_txn_acct_status_spec.rb +13 -0
  52. data/spec/models/biz_txn_acct_status_type_spec.rb +13 -0
  53. data/spec/models/biz_txn_acct_type_spec.rb +13 -0
  54. data/spec/models/biz_txn_agreement_role_spec.rb +14 -0
  55. data/spec/models/biz_txn_agreement_role_type_spec.rb +14 -0
  56. data/spec/models/biz_txn_event_desc_spec.rb +14 -0
  57. data/spec/models/biz_txn_event_spec.rb +11 -0
  58. data/spec/models/biz_txn_party_role_spec.rb +11 -0
  59. data/spec/models/biz_txn_party_role_type_spec.rb +11 -0
  60. data/spec/models/biz_txn_rel_type_spec.rb +11 -0
  61. data/spec/models/biz_txn_relationship_spec.rb +11 -0
  62. data/spec/models/biz_txn_status_spec.rb +11 -0
  63. data/spec/models/biz_txn_task_spec.rb +11 -0
  64. data/spec/models/biz_txn_task_type_spec.rb +11 -0
  65. data/spec/models/biz_txn_type_spec.rb +12 -0
  66. data/spec/models/financial_txn_account_spec.rb +11 -0
  67. data/spec/models/financial_txn_spec.rb +11 -0
  68. data/spec/spec_helper.rb +60 -0
  69. metadata +151 -46
data/GPL-3-LICENSE CHANGED
File without changes
@@ -1,3 +1,7 @@
1
1
  class BizTxnAcctPtyRtype < ActiveRecord::Base
2
+ acts_as_nested_set
3
+ acts_as_erp_type
4
+
5
+ has_many :biz_txn_acct_party_roles
2
6
 
3
7
  end
@@ -1,14 +1,12 @@
1
1
  class BizTxnAcctRoot < ActiveRecord::Base
2
2
 
3
- belongs_to :biz_txn_acct, :polymorphic => true, :dependent => :destroy
4
- belongs_to :biz_txn_acct_type
3
+ belongs_to :biz_txn_acct, :polymorphic => true
5
4
  has_many :biz_txn_events, :dependent => :destroy
6
5
  has_many :biz_txn_acct_party_roles, :dependent => :destroy
7
6
 
8
7
  alias :account :biz_txn_acct
9
8
  alias :txn_events :biz_txn_events
10
9
  alias :txns :biz_txn_events
11
- alias :account_type :biz_txn_acct_type
12
10
 
13
11
  def to_label
14
12
  "#{description}"
@@ -17,5 +15,19 @@ class BizTxnAcctRoot < ActiveRecord::Base
17
15
  def to_s
18
16
  "#{description}"
19
17
  end
18
+
19
+ def add_party_with_role(party, biz_txn_acct_pty_rtype, description=nil)
20
+ biz_txn_acct_pty_rtype = BizTxnAcctPtyRtype.iid(biz_txn_acct_pty_rtype) if biz_txn_acct_pty_rtype.is_a? String
21
+ raise "BizTxnAcctPtyRtype #{biz_txn_acct_pty_rtype.to_s} does not exist" if biz_txn_acct_pty_rtype.nil?
22
+
23
+ self.biz_txn_acct_party_roles << BizTxnAcctPartyRole.create(:party => party, :description => description, :biz_txn_acct_pty_rtype => biz_txn_acct_pty_rtype)
24
+ self.save
25
+ end
26
+
27
+ def find_parties_by_role(biz_txn_acct_pty_rtype)
28
+ biz_txn_acct_pty_rtype = BizTxnAcctPtyRtype.iid(biz_txn_acct_pty_rtype) if biz_txn_acct_pty_rtype.is_a? String
29
+ raise "BizTxnAcctPtyRtype #{biz_txn_acct_pty_rtype.to_s} does not exist" if biz_txn_acct_pty_rtype.nil?
30
+ self.biz_txn_acct_party_roles.where('biz_txn_acct_pty_rtype_id = ?', biz_txn_acct_pty_rtype.id).collect(&:party)
31
+ end
20
32
 
21
33
  end
@@ -1,6 +1,5 @@
1
-
2
1
  Money.class_eval do
3
2
  has_many :financial_txn_accounts, :foreign_key => 'balance_id'
4
3
  has_many :financial_txn_accounts, :foreign_key => 'payment_due_id'
5
- has_many :financial_txns, :dependent => :destroy
4
+ has_many :financial_txns
6
5
  end
@@ -8,20 +8,16 @@ Party.class_eval do
8
8
 
9
9
  # Wrapper to get all party accounts
10
10
  def accounts
11
- relationships
12
-
13
- # old call:
14
- #biz_txn_acct_roots
15
-
16
- # TODO: Get data so we can use this optimized version:
17
- #BizTxnAcctPartyRole.find(:all, :joins => [:party, :biz_txn_acct_root, :biz_txn_acct_pty_rtype], :conditions => ['party_id =?', id])
11
+ biz_txn_acct_roots
18
12
  end
19
13
 
20
14
  # Adds a business account (BizTxnAcctPartyRole)
21
- def add_business_account( acct_root, role_type_id = 10000 )
22
- apr = BizTxnAcctPartyRole.new
15
+ def add_business_account( acct_root, biz_txn_acct_pty_rtype )
16
+ biz_txn_acct_pty_rtype = BizTxnAcctPtyRtype.iid(biz_txn_acct_pty_rtype) if biz_txn_acct_pty_rtype.is_a? String
17
+ raise "BizTxnAcctPtyRtype does not exist" if biz_txn_acct_pty_rtype.nil?
23
18
 
24
- apr.biz_txn_acct_pty_rtype = BizTxnAcctPtyRtype.find(role_type_id)
19
+ apr = BizTxnAcctPartyRole.new
20
+ apr.biz_txn_acct_pty_rtype = biz_txn_acct_pty_rtype
25
21
  biz_txn_acct_roots << acct_root
26
22
  end
27
23
  end
@@ -1,71 +1,28 @@
1
1
  class FinancialTxn < ActiveRecord::Base
2
-
3
2
  acts_as_biz_txn_event
4
3
  has_many :charge_line_payment_txns, :as => :payment_txn, :dependent => :destroy
5
4
  has_many :charge_lines, :through => :charge_line_payment_txns
6
- belongs_to :money
5
+ belongs_to :money, :dependent => :destroy
7
6
  has_many :payments
8
-
9
- def authorize(credit_card, gateway_wrapper, gateway_options={})
10
- credit_card[:charge_amount] = self.money.amount
11
- gateway_options[:charge_lines] = self.charge_lines
12
- gateway_options[:debug] = true
13
-
14
- result = gateway_wrapper.authorize(credit_card, gateway_options)
15
7
 
16
- unless result[:payment].nil?
17
- result[:payment].financial_txn = self
18
- result[:payment].save
19
- self.payments << result[:payment]
20
- self.save
21
- end
22
-
23
- result
8
+ def has_captured_payment?
9
+ has_payments? and self.payments.last.current_state == 'captured'
24
10
  end
25
11
 
26
- def purchase(credit_card, gateway_wrapper, gateway_options={})
27
- credit_card[:charge_amount] = self.money.amount
28
- gateway_options[:charge_lines] = self.charge_lines
29
- gateway_options[:debug] = true
30
-
31
- result = gateway_wrapper.purchase(credit_card, gateway_options)
32
-
33
- unless result[:payment].nil?
34
- result[:payment].financial_txn = self
35
- result[:payment].save
36
- self.payments << result[:payment]
37
- self.save
38
- end
39
-
40
- result
12
+ def has_pending_payment?
13
+ has_payments? and self.payments.last.current_state == 'pending'
41
14
  end
42
-
43
- def capture(credit_card, gateway_wrapper, gateway_options={})
44
- result = {:success => true}
45
- payment = Payment.find(:first, :order => 'created_at desc', :conditions => ["current_state = ? and success = ? and financial_txn_id = ?",'authorized', 1, self.id])
46
- #only capture this payment if it was authorized
47
- if !payment.nil? && payment.current_state.to_sym == :authorized
48
- credit_card[:charge_amount] = self.money.amount
49
- gateway_options[:charge_lines] = self.charge_lines
50
- gateway_options[:debug] = true
51
15
 
52
- result = gateway_wrapper.capture(credit_card, payment, gateway_options)
53
- end
54
- result
16
+ def is_pending?
17
+ self.is_scheduled? || self.has_pending_payment?
55
18
  end
56
19
 
57
- def reverse_authorization(credit_card, gateway_wrapper, gateway_options={})
58
- result = {:success => true}
59
- payment = Payment.find(:first, :order => 'created_at desc', :conditions => ["current_state = ? and success = ? and financial_txn_id = ?",'authorized', 1, self.id])
60
- #only reverse this payment if it was authorized
61
- if !payment.nil? && payment.current_state.to_sym == :authorized
62
- credit_card[:charge_amount] = self.money.amount
63
- gateway_options[:charge_lines] = self.charge_lines
64
- gateway_options[:debug] = true
20
+ def is_scheduled?
21
+ ((self.apply_date > Date.today) or (!self.has_payments?))
22
+ end
65
23
 
66
- result = gateway_wrapper.full_reverse_of_authorization(credit_card, payment, gateway_options)
67
- end
68
- result
24
+ def has_payments?
25
+ !self.payments.empty?
69
26
  end
70
27
 
71
28
  end
@@ -5,9 +5,9 @@ class FinancialTxnAccount < ActiveRecord::Base
5
5
  scope :due, includes([:balance]).where("money.amount != 0")
6
6
 
7
7
  belongs_to :agreement
8
- belongs_to :balance, :dependent => :destroy
9
- belongs_to :payment_due, :dependent => :destroy
10
- belongs_to :financial_account, :polymorphic => true, :dependent => :destroy
8
+ belongs_to :balance, :class_name => "Money", :foreign_key => 'balance_id', :dependent => :destroy
9
+ belongs_to :payment_due, :class_name => "Money", :foreign_key => 'payment_due_id', :dependent => :destroy
10
+ belongs_to :financial_account, :polymorphic => true
11
11
 
12
12
  def financial_txns(result_set, options={})
13
13
  txns = nil
@@ -37,35 +37,8 @@ class FinancialTxnAccount < ActiveRecord::Base
37
37
  past_due
38
38
  end
39
39
 
40
- def authorize_payment_txn(credit_card_info, gateway)
41
- due_amount = self.payment_due.amount
42
-
43
- financial_txn = FinancialTxn.create(:money => Money.create(:amount => due_amount))
44
-
45
- financial_txn.account = self
46
- financial_txn.description = "Payment on account #{self.account_number} of #{due_amount}"
47
-
48
- financial_txn.txn_type = BizTxnType.iid('payment_txn')
49
- financial_txn.save
50
-
51
- financial_txn.authorize_payment(credit_card_info, gateway)
52
- end
53
-
54
- def finalize_payment_txn(credit_card_info, gateway)
55
- financial_txn = self.biz_txn_events.where("biz_txn_record_type = 'FinancialTxn'").order('biz_txn_events.created_at desc').first
56
- result = financial_txn.finalize_payment(credit_card_info, gateway)
57
-
58
- if result[:success]
59
- self.payment_due.amount = 0
60
- self.payment_due.save
61
- end
62
-
63
- result
64
- end
65
-
66
- def rollback_last_txn(credit_card_info, gateway)
67
- financial_txn = self.biz_txn_events.where("biz_txn_record_type = 'FinancialTxn'").order('biz_txn_events.created_at desc').first
68
- financial_txn.reverse_authorization(credit_card_info, gateway)
40
+ def calculate_balance?
41
+ self.calculate_balance
69
42
  end
70
43
 
71
44
  end
@@ -153,6 +153,7 @@ class BaseTxnsAndAccts < ActiveRecord::Migration
153
153
  t.column :biz_txn_acct_type, :string
154
154
  t.column :external_identifier, :string
155
155
  t.column :external_id_source, :string
156
+ t.column :type, :string
156
157
  t.timestamps
157
158
  end
158
159
 
@@ -298,7 +299,8 @@ class BaseTxnsAndAccts < ActiveRecord::Migration
298
299
 
299
300
  unless table_exists?(:financial_txns)
300
301
  create_table :financial_txns do |t|
301
- t.integer :money_id, :integer
302
+ t.integer :money_id
303
+ t.date :apply_date
302
304
 
303
305
  t.timestamps
304
306
  end
@@ -315,12 +317,13 @@ class BaseTxnsAndAccts < ActiveRecord::Migration
315
317
 
316
318
  unless table_exists?(:financial_txn_accounts)
317
319
  create_table :financial_txn_accounts do |t|
318
- t.column :description, :string
319
- t.column :account_number, :string
320
- t.column :agreement_id, :integer
321
- t.column :balance_id, :integer
322
- t.column :payment_due_id, :integer
323
- t.column :due_date, :datetime
320
+ t.column :account_number, :string
321
+ t.column :agreement_id, :integer
322
+ t.column :balance_id, :integer
323
+ t.column :balance_date, :date
324
+ t.column :calculate_balance, :boolean
325
+ t.column :payment_due_id, :integer
326
+ t.column :due_date, :date
324
327
 
325
328
  #polymorphic tables
326
329
  t.references :financial_account, :polymorphic => true
@@ -0,0 +1,7 @@
1
+ class AddTypeColumnToBizTxnAcctRoot < ActiveRecord::Migration
2
+ def change
3
+ unless columns(:biz_txn_acct_roots).collect {|c| c.name}.include?('type')
4
+ add_column :biz_txn_acct_roots, :type, :string
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ class AddApplyDateToFinancialTxn < ActiveRecord::Migration
2
+ def change
3
+ unless columns(:financial_txns).collect {|c| c.name}.include?('apply_date')
4
+ add_column :financial_txns, :apply_date, :date
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ class UpdateFinancialTxnAcctDueDate < ActiveRecord::Migration
2
+ def up
3
+ change_column(:financial_txn_accounts, :due_date, :date)
4
+ end
5
+
6
+ def down
7
+ change_column(:financial_txn_accounts, :due_date, :datetime)
8
+ end
9
+ end
@@ -7,6 +7,12 @@ module ErpTxnsAndAccts
7
7
  include ErpTxnsAndAccts::Extensions::ActiveRecord::ActsAsBizTxnEvent
8
8
  include ErpTxnsAndAccts::Extensions::ActiveRecord::ActsAsFinancialTxnAccount
9
9
  end
10
-
10
+
11
+ #TODO
12
+ #this will be removed once rails 3.2 adds the ability to set the order of engine loading
13
+ engine = self
14
+ config.to_prepare do
15
+ ErpBaseErpSvcs.register_compass_ae_engine(engine)
16
+ end
11
17
  end
12
18
  end
@@ -23,10 +23,12 @@ module ErpTxnsAndAccts
23
23
  :biz_txn_acct_type,
24
24
  :biz_txn_events,
25
25
  :biz_txn_acct_party_roles,
26
- :txn_events,
27
- :description,:description=,
28
- :txns,
29
- :account_type
26
+ :txn_events,:add_party_with_role,
27
+ :status,:status=,
28
+ :external_id_source,:external_id_source=,
29
+ :external_identifier,:external_identifier=,
30
+ :description,:description=,:txns,
31
+ :account_type,:find_parties_by_role
30
32
  ].each do |m| delegate m, :to => :biz_txn_acct_root end
31
33
 
32
34
  end
@@ -61,7 +61,7 @@ module ErpTxnsAndAccts
61
61
  end
62
62
  end
63
63
 
64
- def destroy_biz_txn_account
64
+ def destroy_biz_txn_event
65
65
  self.biz_txn_event.destroy if (self.biz_txn_event && !self.biz_txn_event.frozen?)
66
66
  end
67
67
  end
@@ -9,8 +9,8 @@ module ErpTxnsAndAccts
9
9
 
10
10
  module ClassMethods
11
11
  def acts_as_financial_txn_account
12
- extend ActsAsBizTxnAccount::SingletonMethods
13
- include ActsAsBizTxnAccount::InstanceMethods
12
+ extend ActsAsFinancialTxnAccount::SingletonMethods
13
+ include ActsAsFinancialTxnAccount::InstanceMethods
14
14
 
15
15
  after_initialize :initialize_financial_txn_account
16
16
  after_create :save_financial_txn_account
@@ -23,14 +23,19 @@ module ErpTxnsAndAccts
23
23
  :biz_txn_acct_type,
24
24
  :biz_txn_events,
25
25
  :biz_txn_acct_party_roles,
26
- :txn_events,
27
- :txns,
26
+ :txn_events,:txns,
28
27
  :biz_txn_acct_root,:biz_txn_acct_root=,
29
28
  :account_type,
30
29
  :agreement,:agreement=,
31
30
  :balance,:balance=,
32
31
  :account_number,:account_number=,
32
+ :calculate_balance,:calculate_balance=,
33
+ :balance_date,:balance_date=,
33
34
  :due_date,:due_date=,
35
+ :account_root,
36
+ :external_id_source,:external_id_source=,
37
+ :external_identifier,:external_identifier=,
38
+ :add_party_with_role,:find_parties_by_role,
34
39
  :created_at,:updated_at,
35
40
  :payment_due,:payment_due=,
36
41
  :description,:description=,
@@ -1,3 +1,9 @@
1
1
  module ErpTxnsAndAccts
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
@@ -1,3 +1,4 @@
1
+ require "erp_txns_and_accts/version"
1
2
  require "erp_txns_and_accts/delayed_jobs/payment_gateway_job"
2
3
  require "erp_txns_and_accts/extensions"
3
4
  require "erp_txns_and_accts/engine"
@@ -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,48 @@
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_app"
8
+ require "erp_agreements"
9
+ require "erp_commerce"
10
+ require "erp_orders"
11
+ require "erp_products"
12
+ require "erp_txns_and_accts"
13
+
14
+ module Dummy
15
+ class Application < Rails::Application
16
+ # Settings in config/environments/* take precedence over those specified here.
17
+ # Application configuration should go into files in config/initializers
18
+ # -- all .rb files in that directory are automatically loaded.
19
+
20
+ # Custom directories with classes and modules you want to be autoloadable.
21
+ # config.autoload_paths += %W(#{config.root}/extras)
22
+
23
+ # Only load the plugins named here, in the order given (default is alphabetical).
24
+ # :all can be used as a placeholder for all plugins not explicitly named.
25
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
26
+
27
+ # Activate observers that should always be running.
28
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
29
+
30
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
31
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
32
+ # config.time_zone = 'Central Time (US & Canada)'
33
+
34
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
35
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
36
+ # config.i18n.default_locale = :de
37
+
38
+ # Configure the default encoding used in templates for Ruby 1.9.
39
+ config.encoding = "utf-8"
40
+
41
+ # Configure sensitive parameters which will be filtered from the log file.
42
+ config.filter_parameters += [:password]
43
+
44
+ # Enable the asset pipeline
45
+ config.assets.enabled = true
46
+ end
47
+ end
48
+
@@ -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,3 @@
1
+ Rails.application.routes.draw do
2
+ mount ErpTxnsAndAccts::Engine => "/erp_txns_and_accts"
3
+ 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
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>