netshade-cache-money 0.2.5.4 → 0.2.5.5

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.
@@ -154,7 +154,14 @@ module Cash
154
154
  end
155
155
 
156
156
  def find_from_keys(*missing_keys)
157
- missing_ids = Array(missing_keys).flatten.collect { |key| key.split('/')[2] }
157
+ convert_to_i = @active_record.columns_hash[@active_record.primary_key] == :integer
158
+ missing_ids = Array(missing_keys).flatten.collect { |key|
159
+ k = key.split('/')[2]
160
+ if convert_to_i
161
+ k = k.to_i
162
+ end
163
+ k
164
+ }
158
165
  find_from_ids_without_cache(missing_ids, {})
159
166
  end
160
167
  end
@@ -4,7 +4,7 @@ module Cash
4
4
  def initialize(active_record, ids, options1, options2)
5
5
  super(active_record, options1, options2)
6
6
  @original_ids = ids
7
- @keytype = active_record.columns_hash[active_record.primary_key]
7
+ @keytype = active_record.columns_hash[active_record.primary_key].type
8
8
  @ids = ids.flatten.compact.uniq.collect do |object|
9
9
  object.respond_to?(:quoted_id) ? object.quoted_id : ((@keytype == :integer) ? object.to_i : object.to_s)
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netshade-cache-money
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5.4
4
+ version: 0.2.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Kallen