Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removing cached_find

  • Loading branch information...
commit 4e08e1bffcd34788352ba7893f153971d0f36501 1 parent ebdaa01
@winton authored
View
10 lib/a_b/model/cached_find.rb
@@ -1,10 +0,0 @@
-require 'pp'
-
-module CachedFind
-
- def cached_find(*args)
- $cached_find ||= {}
- cache = $cached_find[self.to_s.intern] ||= {}
- cache[args.pretty_inspect] ||= self.find(*args)
- end
-end
View
4 lib/a_b/model/variant.rb
@@ -45,10 +45,10 @@ def self.record(options)
ids = ids.compact.uniq
variants = ids.collect do |id|
- Variant.cached_find(id, :include => :site)
+ Variant.find(id, :include => :site)
end
- env = Env.cached_find(:first, :conditions => {
+ env = Env.find(:first, :conditions => {
:name => env,
:user_id => variants[0].user_id
})
View
1  spec/a_b/model/env_spec.rb
@@ -3,7 +3,6 @@
describe Env do
before(:each) do
- $cached_find = nil
teardown_tests
setup_tests
end
View
1  spec/a_b/model/variant_spec.rb
@@ -3,7 +3,6 @@
describe Variant do
before(:each) do
- $cached_find = nil
teardown_tests
setup_tests
end
Please sign in to comment.
Something went wrong with that request. Please try again.