active_record_calculator 0.9.0 → 1.0.0

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.
@@ -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
- start = invalid_columns[0..-2].join(', ')
119
- if invalid_columns.length > 1
120
- start += ' and ' + invalid_columns[-1..-1].to_s
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) #{invalid_columns.to_sentence} for table #{table}" unless invalid_columns.empty?
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
 
@@ -1,3 +1,9 @@
1
1
  module ActiveRecordCalculator
2
- VERSION = "0.9.0"
2
+ module VERSION # :nodoc:
3
+ MAJOR = 1
4
+ MINOR = 0
5
+ TINY = 0
6
+
7
+ STRING = [MAJOR, MINOR, TINY].join('.')
8
+ end
3
9
  end
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: 59
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
+ - 1
7
8
  - 0
8
- - 9
9
9
  - 0
10
- version: 0.9.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-07 00:00:00 Z
18
+ date: 2012-02-08 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: activerecord