ar-ondemand 1.1.7 → 1.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDlkODQyOThhNDU2OWIwOWIyYWE1MzAxNzBiZjQ3YzNjOWViOWRlYw==
4
+ YmJkZGE0ZjJmOTAxNGMzNTQ2M2VhZWIxODJkZmYxODE5OTc1ZjQyMA==
5
5
  data.tar.gz: !binary |-
6
- OGVlODFkZjdmMzA3OGVmNjQwYzY3NzY4NjE2OTY3YzA2NDJkN2NlYQ==
6
+ ZjgxOGJjYWVjMzVhY2U2ZjYzZTk4OWZmMTI1MThmZThkYTA1ZTYxNw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MTA4NDJlZDljZmU5MTM3MDE0Njg5ZTg3YmYzNzEzMGY0MTI5YjA4ZjFjNDVi
10
- ODBkNDg2YWI4NWI3N2I0NWMyNzgwZmJjMTYwYTVjM2Y1YmNiZGI3Yzc1YjI0
11
- ZjQ4YjFhZjJmZWI4ODY4YzlmNjY2MjY1NjI2M2Q1OGNlZjQ0NDc=
9
+ ZDNjOTY4Y2MyN2JlYzRjZGU2YzFhNjEyNmY0YmQzZWE5YTAzYWU2Y2NmNjlm
10
+ MWM1N2U2MmFmYWU1ZDZiYTAzMzg0NmM5MThjYTNkMjEyMGU3NjAyYWQzZWMy
11
+ ODMzNGVmNTE2ZThjMjk4YTI2ZmE0NTcwZjNkMTAzNjdiYzkyMDY=
12
12
  data.tar.gz: !binary |-
13
- OWU1NWViMGY0MjA5YmFiOWIxN2ZjZjI3OWExOGJiYWY0OTgxODQwNmQ1Yjhh
14
- Mzc1OGJiMzY0MDUzYjA1ZWQ4NGU4OThkZTQyOTQ5YmM4ZjMyYjU1NzNlYmMw
15
- ZGMzNDhjNTYwYjZhY2VhNTE1ZTExNTdlZGM0ZDY4MzcyYWQxZTY=
13
+ MWU1ZTlkYzYyZGM0ZGY1ZDgxYTUyMGRkZWVmMTg1ODk1M2YwZGNhNjdiYzVh
14
+ NWQyMzVlOTQwNTJhNGU4ZjViNDgzMWJjYmFhNGVjMmYzMGIxYTM2MGY1NDE2
15
+ OWY3ZDMwYzNjZjQ0ZTI0OWRkYTEyZWJlYmM5MzU1ZDdkZDlmMGU=
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ar-ondemand (1.1.7)
4
+ ar-ondemand (1.1.8)
5
5
  activerecord (~> 3.2)
6
6
  activesupport (~> 3.2)
7
7
 
@@ -4,11 +4,12 @@ module ActiveRecord
4
4
 
5
5
  def initialize(model, result_set)
6
6
  @result_set = result_set
7
-
7
+ @column_models = model.columns.inject({}) {|h,c| h[c.name] = c; h}
8
8
  result_set.columns.each_with_index do |name, index|
9
+ column_model = @column_models[name]
9
10
  self.define_singleton_method(name) {
10
11
  raise "Not accessible outside of enumeration" if @row.nil?
11
- @row[index]
12
+ column_model.type_cast @row[index]
12
13
  }
13
14
  end
14
15
  end
@@ -1,3 +1,3 @@
1
1
  module ArOnDemand
2
- VERSION = '1.1.7'
2
+ VERSION = '1.1.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ar-ondemand
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Frank