jodosha / cached-models

CachedModels provides to your ActiveRecord objects a transparent approach to use ActiveSupport caching mechanism.

This URL has Read+Write access

cached-models / CHANGELOG
100644 155 lines (82 sloc) 4.294 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
* has_and_belongs_to_many association support
 
* Fix memory leak issue in cached_associations
 
* DRYed-up belongs_to definition
 
* Make sure of use Memcached as test store. Compatibility changes for ActiveRecord 2.2.0
 
* Make sure of require frameworks configured in environment.rb
 
 
 
*0.0.3 (October 22nd, 2008)*
 
* Tagged v0.0.3
 
* Test cases cleanup
 
* Sugar syntax for AssociationCollection#size
 
* Use loaded collection, instead of read from cache, when use scoped find form AssociationCollection
 
  author.posts.find(1) # no cache read for #find
 
* Use loaded collection, instead of read from cache, when use #size, #empty? and #any? from AssociationCollection. Added support for :uniq option.
 
* Reduced cache overhead using read instead of fetch for access to AssociationCollection. Enhanced Mocha expectactions.
 
  # BEFORE
  author.posts # => cache fetch
  
  # NOW
  author.posts # => cache read
 
* Fixed typos in CHANGELOG and README
 
* Don't instantiate ivar when read from AssociationCollection if options[:cached] == true
 
* Reduced by half cache lookups when read from AssociationCollection
 
  # BEFORE
  author.posts # => cache read + cache fetch
 
  # NOW
  author.posts # => cache fetch
 
* Fixed Mocha expectations
 
* Fixed clear, delete and destroy cases for AssociationCollection
 
  author.posts.delete(post)
  author.posts.delete_all
  author.posts.destroy
  author.posts.destroy_all
  author.posts.clear
 
* Fixed concurrency issues, using Thread#current to store cached_associations instead of ivar
 
* Make sure tests suite runs in 'test' environment. Introduced SKIP_MOCHA env variable, in order to run tests directly on cache
 
  $ rake cached_models SKIP_MOCHA=true
 
* Bypass cache for will_paginate on association collection
 
  author.posts.paginate(:all, :page => 1, :per_page => 10)
 
* Make sure habtm and has_one are safely used
 
 
 
*0.0.2 (October 10th, 2008)*
 
* Updated README with new installation instructions
 
* Created separated folder for ActiveRecord
 
* Added dist related Rake tasks
 
* Added gem related files
 
* Added Git related Rake tasks
 
* Removed default configuration for cache lookup
 
* Make sure cache is always used by all the instances which reference the same record
 
* Made independent of Rails
 
* Allow test suite to work without any active cache server
 
* Enhanced AssociationCollection test coverage
 
* ActiveRecord::Base#expire_cache_for now uses the new cache access API
 
* Abstracted ActiveRecord::Base#cache_fetch in order to normalize cache access for <reflection_name>_ids
 
* Reduced the amount of cache hits, caching the status of cached relations with ActiveRecord::Base#cached_associations
 
 
 
*0.0.1 (September 10th, 2008)*
 
* Updated README with project informations
 
* Make sure 'test' is the default Rake task
 
* Added project description to README. Added about.yml.
 
* Updated README with informations about required environment settings
 
* Only load the plugin if the current environment has the cache turned on
 
* Added support for cache expiration on after_save callback
 
* Make sure to use ActiveRecord cache proxy for test suite
 
* Make sure test suite will run using RAILS_ENV in test mode
 
* Added support for scoped finders in AssociationCollection. Fixed cache renewal for AssociationCollection#delete.
 
* Added support for cache renewal on AssociationCollection methods
 
* Added support for cache expiration on direct associated objects updates
 
* Updated README example
 
* Removed CacheObserver. Fixed cache expiration for has_many relation.
 
* Introducing CacheObserver in order to transparently handle cache expiring for has_many macro
 
* Test enhancements for AssociationCollection#<< on polymorphic associations
 
* Test enhancements for AssociationCollection#<<. Make sure to expire caches when an associated object changes owner.
 
  class Author < ActiveRecord::Base
    has_many :posts, :cached => true
  end
 
  post = author.posts.last
  another_author.posts << post # => refresh both author and another_author caches
 
* AssociationCollection#<< support
 
  class Author < ActiveRecord::Base
    has_many :posts, :cached => true
  end
 
  author.posts << post # => causes a refresh of cached posts
 
* has_many association support
  
  class Author < ActiveRecord::Base
    has_many :posts, :cached => true
  end