Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Avoid method name clash with ActiveRecord

  • Loading branch information...
commit 2175c41cd7527b76db8ebe5c33b0be3d002e1d41 1 parent b9393f9
@andys authored
View
2  CHANGELOG
@@ -1,4 +1,6 @@
+v0.4. Avoid method name clash with ActiveRecord
+
v0.3. Support bang and question mark method rewrites
v0.2. Support disabling cache on timeout
View
4 README
@@ -11,7 +11,7 @@ Example
class User < ActiveRecord::Base
- cache do
+ redis_cache do
def fullname
firstname + ' ' + lastname
end
@@ -33,7 +33,7 @@ Redrecord can be used to cache attributes that use assocations:
class User < ActiveRecord::Base
has_many :preferences
- cache do
+ redis_cache do
def preferences_list
preferences.map(&:name).join(', ')
end
View
2  lib/redrecord.rb
@@ -37,7 +37,7 @@ def redrecord_invalidation_fields
@redrecord_invalidation_fields ||= []
end
- def cache(*fields, &bl)
+ def redis_cache(*fields, &bl)
if block_given?
old_methods = instance_methods
class_eval(&bl)
View
2  test/test_helper.rb
@@ -54,7 +54,7 @@ def initialize(id, first_name=nil, last_name=nil)
@id, @first_name, @last_name = id, first_name, last_name
end
- cache do
+ redis_cache do
def full_name
@recalculated = true
"#{first_name} #{last_name}"
Please sign in to comment.
Something went wrong with that request. Please try again.