Permalink
Browse files

Avoid method name clash with ActiveRecord

  • Loading branch information...
1 parent b9393f9 commit 2175c41cd7527b76db8ebe5c33b0be3d002e1d41 @andys committed Feb 4, 2012
Showing with 6 additions and 4 deletions.
  1. +2 −0 CHANGELOG
  2. +2 −2 README
  3. +1 −1 lib/redrecord.rb
  4. +1 −1 test/test_helper.rb
View
@@ -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
@@ -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
@@ -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}"

0 comments on commit 2175c41

Please sign in to comment.