bookkeeper 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
@@ -29,19 +29,16 @@ module Bookkeeper
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def self.default
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
end
|
32
|
+
account = Account.find_by_default(true)
|
33
|
+
account = Account.create(title: "Default", start_date: Time.now, initial_balance: 0.0, default: true) if account.nil?
|
34
|
+
|
35
|
+
account
|
37
36
|
end
|
38
37
|
|
39
38
|
protected
|
40
39
|
|
41
40
|
def default_must_be_uniq
|
42
|
-
|
43
|
-
errors.add(:base, I18n.t(".default_must_be_uniq"))
|
44
|
-
end
|
41
|
+
errors.add(:base, I18n.t(".default_must_be_uniq")) if Account.find_by_default(true)
|
45
42
|
end
|
46
43
|
end
|
47
44
|
end
|
data/lib/bookkeeper/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bookkeeper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
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: 2013-03-
|
12
|
+
date: 2013-03-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|