Skip to content

Commit

Permalink
Merge branch 'rails4' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mbulat committed Jan 15, 2014
2 parents 6632672 + dc7b3b9 commit f519277
Show file tree
Hide file tree
Showing 14 changed files with 93 additions and 98 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: ruby
rvm:
- 1.9.2
- 1.9.3
- 2.0
- 2.1
script: rake
160 changes: 77 additions & 83 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,113 +2,107 @@ PATH
remote: .
specs:
plutus (0.7.4)
rails (~> 3.1)
rails (~> 4.0)

GEM
remote: http://rubygems.org/
specs:
actionmailer (3.1.0)
actionpack (= 3.1.0)
mail (~> 2.3.0)
actionpack (3.1.0)
activemodel (= 3.1.0)
activesupport (= 3.1.0)
builder (~> 3.0.0)
actionmailer (4.0.2)
actionpack (= 4.0.2)
mail (~> 2.5.4)
actionpack (4.0.2)
activesupport (= 4.0.2)
builder (~> 3.1.0)
erubis (~> 2.7.0)
i18n (~> 0.6)
rack (~> 1.3.2)
rack-cache (~> 1.0.3)
rack-mount (~> 0.8.2)
rack-test (~> 0.6.1)
sprockets (~> 2.0.0)
activemodel (3.1.0)
activesupport (= 3.1.0)
bcrypt-ruby (~> 3.0.0)
builder (~> 3.0.0)
i18n (~> 0.6)
activerecord (3.1.0)
activemodel (= 3.1.0)
activesupport (= 3.1.0)
arel (~> 2.2.1)
tzinfo (~> 0.3.29)
activeresource (3.1.0)
activemodel (= 3.1.0)
activesupport (= 3.1.0)
activesupport (3.1.0)
multi_json (~> 1.0)
arel (2.2.3)
bcrypt-ruby (3.0.1)
builder (3.0.0)
diff-lcs (1.1.3)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
activemodel (4.0.2)
activesupport (= 4.0.2)
builder (~> 3.1.0)
activerecord (4.0.2)
activemodel (= 4.0.2)
activerecord-deprecated_finders (~> 1.0.2)
activesupport (= 4.0.2)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.3)
activesupport (4.0.2)
i18n (~> 0.6, >= 0.6.4)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
arel (4.0.1)
atomic (1.1.14)
builder (3.1.4)
diff-lcs (1.2.5)
erubis (2.7.0)
factory_girl (2.6.4)
activesupport (>= 2.3.9)
factory_girl_rails (1.7.0)
factory_girl (~> 2.6.0)
railties (>= 3.0.0)
hike (1.2.1)
i18n (0.6.0)
json (1.7.3)
mail (2.3.3)
i18n (>= 0.4.0)
hike (1.2.3)
i18n (0.6.9)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.22)
multi_json (1.3.5)
mime-types (1.25.1)
minitest (4.7.5)
multi_json (1.8.4)
polyglot (0.3.3)
rack (1.3.6)
rack-cache (1.0.3)
rack (>= 0.4)
rack-mount (0.8.3)
rack (>= 1.0.0)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (1.5.2)
rack-test (0.6.2)
rack (>= 1.0)
rails (3.1.0)
actionmailer (= 3.1.0)
actionpack (= 3.1.0)
activerecord (= 3.1.0)
activeresource (= 3.1.0)
activesupport (= 3.1.0)
bundler (~> 1.0)
railties (= 3.1.0)
railties (3.1.0)
actionpack (= 3.1.0)
activesupport (= 3.1.0)
rack-ssl (~> 1.3.2)
rails (4.0.2)
actionmailer (= 4.0.2)
actionpack (= 4.0.2)
activerecord (= 4.0.2)
activesupport (= 4.0.2)
bundler (>= 1.3.0, < 2.0)
railties (= 4.0.2)
sprockets-rails (~> 2.0.0)
railties (4.0.2)
actionpack (= 4.0.2)
activesupport (= 4.0.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
redcarpet (2.1.1)
rspec (2.10.0)
rspec-core (~> 2.10.0)
rspec-expectations (~> 2.10.0)
rspec-mocks (~> 2.10.0)
rspec-core (2.10.0)
rspec-expectations (2.10.0)
diff-lcs (~> 1.1.3)
rspec-mocks (2.10.1)
rspec-rails (2.10.1)
thor (>= 0.18.1, < 2.0)
rake (10.1.1)
redcarpet (3.0.0)
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (2.14.7)
rspec-expectations (2.14.4)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.4)
rspec-rails (2.14.1)
actionpack (>= 3.0)
activemodel (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec (~> 2.10.0)
sprockets (2.0.4)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
sprockets (2.10.1)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.6)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.12)
sprockets-rails (2.0.1)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (~> 2.8)
sqlite3 (1.3.8)
thor (0.18.1)
thread_safe (0.1.3)
atomic
tilt (1.4.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.37)
yard (0.8.1)
tzinfo (0.3.38)
yard (0.8.7.3)

PLATFORMS
ruby
Expand Down
6 changes: 5 additions & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ Plutus

The Plutus plugin is a Ruby on Rails Engine which provides a double entry accounting system for your application.

### NOTE: This version of Plutus is compatible with RAILS 3.1
### NOTE: This version of Plutus is compatible with RAILS ~> 4.0

For the rails 3 version, you can go here (current master):

[https://github.com/mbulat/plutus](https://github.com/mbulat/plutus/tree/rails3)

For the rails 2 version, you can go here:

Expand Down
2 changes: 0 additions & 2 deletions app/models/plutus/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ module Plutus
#
# @author Michael Bulat
class Account < ActiveRecord::Base
attr_accessible :name, :contra

has_many :credit_amounts, :extend => AmountsExtension
has_many :debit_amounts, :extend => AmountsExtension
has_many :credit_transactions, :through => :credit_amounts, :source => :transaction
Expand Down
2 changes: 0 additions & 2 deletions app/models/plutus/amount.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ module Plutus
#
# @author Michael Bulat
class Amount < ActiveRecord::Base
attr_accessible :account, :amount, :transaction

belongs_to :transaction
belongs_to :account

Expand Down
2 changes: 1 addition & 1 deletion app/models/plutus/asset.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def balance
# @return [BigDecimal] The decimal value balance
def self.balance
accounts_balance = BigDecimal.new('0')
accounts = self.find(:all)
accounts = self.all
accounts.each do |asset|
unless asset.contra
accounts_balance += asset.balance
Expand Down
2 changes: 1 addition & 1 deletion app/models/plutus/equity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def balance
# @return [BigDecimal] The decimal value balance
def self.balance
accounts_balance = BigDecimal.new('0')
accounts = self.find(:all)
accounts = self.all
accounts.each do |equity|
unless equity.contra
accounts_balance += equity.balance
Expand Down
2 changes: 1 addition & 1 deletion app/models/plutus/expense.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def balance
# @return [BigDecimal] The decimal value balance
def self.balance
accounts_balance = BigDecimal.new('0')
accounts = self.find(:all)
accounts = self.all
accounts.each do |expense|
unless expense.contra
accounts_balance += expense.balance
Expand Down
2 changes: 1 addition & 1 deletion app/models/plutus/liability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def balance
# => #<BigDecimal:1030fcc98,'0.82875E5',8(20)>
def self.balance
accounts_balance = BigDecimal.new('0')
accounts = self.find(:all)
accounts = self.all
accounts.each do |liability|
unless liability.contra
accounts_balance += liability.balance
Expand Down
2 changes: 1 addition & 1 deletion app/models/plutus/revenue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def balance
# @return [BigDecimal] The decimal value balance
def self.balance
accounts_balance = BigDecimal.new('0')
accounts = self.find(:all)
accounts = self.all
accounts.each do |revenue|
unless revenue.contra
accounts_balance += revenue.balance
Expand Down
2 changes: 0 additions & 2 deletions app/models/plutus/transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ module Plutus
#
# @author Michael Bulat
class Transaction < ActiveRecord::Base
attr_accessible :description, :commercial_document

belongs_to :commercial_document, :polymorphic => true
has_many :credit_amounts, :extend => AmountsExtension
has_many :debit_amounts, :extend => AmountsExtension
Expand Down
3 changes: 2 additions & 1 deletion fixture_rails_root/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
config.static_cache_control = "public, max-age=3600"

# Log error messages when you accidentally call methods on nil
config.whiny_nils = true
# config.whiny_nils = true
config.eager_load = false

# Show full error reports and disable caching
config.consider_all_requests_local = true
Expand Down
1 change: 1 addition & 0 deletions lib/plutus.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Plutus
require "rails"

module Plutus
class Engine < Rails::Engine
isolate_namespace Plutus
Expand Down
2 changes: 1 addition & 1 deletion plutus.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |s|
"LICENSE",
"README.markdown"
]
s.add_dependency("rails", "~> 3.1")
s.add_dependency("rails", "~> 4.0")
s.add_development_dependency("sqlite3")
s.add_development_dependency("rspec", "~> 2.6")
s.add_development_dependency("rspec-rails", "~> 2.6")
Expand Down

0 comments on commit f519277

Please sign in to comment.