seamusabshere-cache-money 0.2.9 → 0.2.10

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.
data/lib/cash/finders.rb CHANGED
@@ -26,7 +26,7 @@ module Cash
26
26
 
27
27
  def _find_by_id_with_exclusive_scope(id)
28
28
  with_exclusive_scope({ :find => _default_order }) do
29
- find_from_ids_without_cache([id], {})
29
+ find_every_with_cache(:conditions => { :id => id }).first
30
30
  end
31
31
  end
32
32
 
@@ -14,7 +14,9 @@ module Cash
14
14
  return [] if @expects_array && @ids.empty?
15
15
  raise ActiveRecord::RecordNotFound if @ids.empty?
16
16
 
17
- super(:conditions => { :id => @ids.first })
17
+ retval = super(:conditions => { :id => @ids.first })
18
+ retval = nil if retval.kind_of?(Array) and retval.empty? and !@expects_array
19
+ retval
18
20
  end
19
21
 
20
22
  protected
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seamusabshere-cache-money
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Kallen