active_record_calculator 0.9.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,7 @@ require "active_record_calculator/version"
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = "active_record_calculator"
|
7
|
-
s.version = ActiveRecordCalculator::VERSION
|
7
|
+
s.version = ActiveRecordCalculator::VERSION::STRING
|
8
8
|
s.authors = ["Grady Griffin"]
|
9
9
|
s.email = ["gradyg@izea.com"]
|
10
10
|
s.homepage = "https://github.com/thegboat/active_record_calculator"
|
@@ -115,15 +115,20 @@ module ActiveRecordCalculator
|
|
115
115
|
end
|
116
116
|
|
117
117
|
def invalid_columns_sentence
|
118
|
-
|
119
|
-
|
120
|
-
|
118
|
+
case invalid_columns.length
|
119
|
+
when 0
|
120
|
+
""
|
121
|
+
when 1
|
122
|
+
invalid_columns[0].to_s
|
123
|
+
when 2
|
124
|
+
"#{invalid_columns[0]} and #{invalid_columns[1]}"
|
125
|
+
else
|
126
|
+
"#{invalid_columns[0...-1].join(', ')} and #{invalid_columns[-1]}"
|
121
127
|
end
|
122
|
-
start
|
123
128
|
end
|
124
129
|
|
125
130
|
def valid_columns?
|
126
|
-
raise InvalidColumnError, "Can not resolve update column(s) #{
|
131
|
+
raise InvalidColumnError, "Can not resolve update column(s) #{invalid_columns_sentence} for table #{table}" unless invalid_columns.empty?
|
127
132
|
true
|
128
133
|
end
|
129
134
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record_calculator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
|
+
- 1
|
7
8
|
- 0
|
8
|
-
- 9
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 1.0.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Grady Griffin
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-02-
|
18
|
+
date: 2012-02-08 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: activerecord
|