unit_validation 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,5 @@
1
1
  class UnitValidator < ActiveModel::EachValidator
2
+ require 'ruby-units'
2
3
  def validate_each(record, attribute, value)
3
4
  allowed=Array(options[:allowed_types]) if options[:allowed_types]
4
5
  begin
@@ -12,4 +13,4 @@ class UnitValidator < ActiveModel::EachValidator
12
13
  record.errors[attribute] << (options[:message] || "is not a valid measurement")
13
14
  end
14
15
  end
15
- end
16
+ end
@@ -1,3 +1,3 @@
1
1
  module UnitValidation
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -180,3 +180,20 @@ Connecting to database specified by database.yml
180
180
   (0.0ms) rollback transaction
181
181
   (0.0ms) begin transaction
182
182
   (0.0ms) rollback transaction
183
+ Connecting to database specified by database.yml
184
+  (0.5ms) begin transaction
185
+  (0.1ms) rollback transaction
186
+  (0.0ms) begin transaction
187
+  (0.0ms) rollback transaction
188
+  (0.0ms) begin transaction
189
+  (0.0ms) rollback transaction
190
+  (0.0ms) begin transaction
191
+  (0.0ms) rollback transaction
192
+  (0.0ms) begin transaction
193
+  (0.0ms) rollback transaction
194
+  (0.0ms) begin transaction
195
+  (0.0ms) rollback transaction
196
+  (0.0ms) begin transaction
197
+  (0.0ms) rollback transaction
198
+  (0.0ms) begin transaction
199
+  (0.0ms) rollback transaction
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unit_validation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
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-06-18 00:00:00.000000000 Z
12
+ date: 2012-06-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -125,7 +125,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
125
125
  version: '0'
126
126
  segments:
127
127
  - 0
128
- hash: 577278562134281254
128
+ hash: -3016504596751154144
129
129
  required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  none: false
131
131
  requirements:
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  version: '0'
135
135
  segments:
136
136
  - 0
137
- hash: 577278562134281254
137
+ hash: -3016504596751154144
138
138
  requirements: []
139
139
  rubyforge_project:
140
140
  rubygems_version: 1.8.21