has_accounts 0.18.3 → 0.18.4

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.
@@ -1,4 +1,7 @@
1
1
  class Account < ActiveRecord::Base
2
+ # Access restrictions
3
+ attr_accessible :title, :code, :account_type_id
4
+
2
5
  # Scopes
3
6
  default_scope :order => 'code'
4
7
 
@@ -1,4 +1,7 @@
1
1
  class AccountType < ActiveRecord::Base
2
+ # Access restrictions
3
+ attr_accessible :title, :name
4
+
2
5
  # Validation
3
6
  validates_presence_of :name, :title
4
7
 
@@ -1,4 +1,7 @@
1
1
  class Booking < ActiveRecord::Base
2
+ # Access restrictions
3
+ attr_accessible :title, :comments, :amount, :debit_account, :credit_account, :value_date
4
+
2
5
  # Validation
3
6
  validates_presence_of :debit_account, :credit_account, :title, :value_date
4
7
  validates :amount, :presence => true, :numericality => true
@@ -5,7 +5,7 @@ module HasAccounts
5
5
  included do
6
6
  class_attribute :direct_account
7
7
 
8
- has_many :bookings, :as => :reference, :dependent => :destroy, :inverse_of => :reference do
8
+ has_many :bookings, :as => :reference, :dependent => :nullify, :inverse_of => :reference do
9
9
  # TODO: duplicated in Booking (without parameter)
10
10
  def direct_balance(value_date = nil, direct_account = nil)
11
11
  return BigDecimal.new('0') unless proxy_association.owner.direct_account
@@ -1,3 +1,3 @@
1
1
  module HasAccounts
2
- VERSION = "0.18.3"
2
+ VERSION = "0.18.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_accounts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.3
4
+ version: 0.18.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-04 00:00:00.000000000 Z
12
+ date: 2012-11-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails