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.
- data/GPL-3-LICENSE +0 -0
- data/app/models/biz_txn_acct_pty_rtype.rb +4 -0
- data/app/models/biz_txn_acct_root.rb +15 -3
- data/app/models/extensions/money.rb +1 -2
- data/app/models/extensions/party.rb +6 -10
- data/app/models/financial_txn.rb +12 -55
- data/app/models/financial_txn_account.rb +5 -32
- data/db/migrate/20080805000030_base_txns_and_accts.rb +10 -7
- data/db/migrate/upgrade/20120118135738_add_type_column_to_biz_txn_acct_root.rb +7 -0
- data/db/migrate/upgrade/20120118143602_add_apply_date_to_financial_txn.rb +7 -0
- data/db/migrate/upgrade/20120515155000_update_financial_txn_acct_due_date.rb +9 -0
- data/lib/erp_txns_and_accts/engine.rb +7 -1
- data/lib/erp_txns_and_accts/extensions/active_record/acts_as_biz_txn_account.rb +6 -4
- data/lib/erp_txns_and_accts/extensions/active_record/acts_as_biz_txn_event.rb +1 -1
- data/lib/erp_txns_and_accts/extensions/active_record/acts_as_financial_txn_account.rb +9 -4
- data/lib/erp_txns_and_accts/version.rb +7 -1
- data/lib/erp_txns_and_accts.rb +1 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/assets/stylesheets/application.css +7 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config/application.rb +48 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +8 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/spec.rb +27 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +12 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/factories/basic.rb +13 -0
- data/spec/models/base_txn_context_spec.rb +11 -0
- data/spec/models/biz_acct_txn_task_spec.rb +11 -0
- data/spec/models/biz_txn_acct_party_role_spec.rb +11 -0
- data/spec/models/biz_txn_acct_pty_rtype_spec.rb +11 -0
- data/spec/models/biz_txn_acct_rel_type_spec.rb +11 -0
- data/spec/models/biz_txn_acct_relationship_spec.rb +11 -0
- data/spec/models/biz_txn_acct_root_spec.rb +12 -0
- data/spec/models/biz_txn_acct_status_spec.rb +13 -0
- data/spec/models/biz_txn_acct_status_type_spec.rb +13 -0
- data/spec/models/biz_txn_acct_type_spec.rb +13 -0
- data/spec/models/biz_txn_agreement_role_spec.rb +14 -0
- data/spec/models/biz_txn_agreement_role_type_spec.rb +14 -0
- data/spec/models/biz_txn_event_desc_spec.rb +14 -0
- data/spec/models/biz_txn_event_spec.rb +11 -0
- data/spec/models/biz_txn_party_role_spec.rb +11 -0
- data/spec/models/biz_txn_party_role_type_spec.rb +11 -0
- data/spec/models/biz_txn_rel_type_spec.rb +11 -0
- data/spec/models/biz_txn_relationship_spec.rb +11 -0
- data/spec/models/biz_txn_status_spec.rb +11 -0
- data/spec/models/biz_txn_task_spec.rb +11 -0
- data/spec/models/biz_txn_task_type_spec.rb +11 -0
- data/spec/models/biz_txn_type_spec.rb +12 -0
- data/spec/models/financial_txn_account_spec.rb +11 -0
- data/spec/models/financial_txn_spec.rb +11 -0
- data/spec/spec_helper.rb +60 -0
- metadata +151 -46
data/GPL-3-LICENSE
CHANGED
File without changes
|
@@ -1,14 +1,12 @@
|
|
1
1
|
class BizTxnAcctRoot < ActiveRecord::Base
|
2
2
|
|
3
|
-
belongs_to :biz_txn_acct, :polymorphic => true
|
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
|
@@ -8,20 +8,16 @@ Party.class_eval do
|
|
8
8
|
|
9
9
|
# Wrapper to get all party accounts
|
10
10
|
def accounts
|
11
|
-
|
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,
|
22
|
-
|
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
|
-
|
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
|
data/app/models/financial_txn.rb
CHANGED
@@ -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
|
-
|
17
|
-
|
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
|
27
|
-
|
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
|
-
|
53
|
-
|
54
|
-
result
|
16
|
+
def is_pending?
|
17
|
+
self.is_scheduled? || self.has_pending_payment?
|
55
18
|
end
|
56
19
|
|
57
|
-
def
|
58
|
-
|
59
|
-
|
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
|
-
|
67
|
-
|
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
|
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
|
41
|
-
|
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
|
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 :
|
319
|
-
t.column :
|
320
|
-
t.column :
|
321
|
-
t.column :
|
322
|
-
t.column :
|
323
|
-
t.column :
|
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
|
@@ -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
|
-
:
|
28
|
-
:
|
29
|
-
:
|
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
|
@@ -9,8 +9,8 @@ module ErpTxnsAndAccts
|
|
9
9
|
|
10
10
|
module ClassMethods
|
11
11
|
def acts_as_financial_txn_account
|
12
|
-
extend
|
13
|
-
include
|
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=,
|
data/lib/erp_txns_and_accts.rb
CHANGED
data/spec/dummy/Rakefile
ADDED
@@ -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,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,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,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,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,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>
|