A DataMapper plugin for adding counter-cache properties to related models.
Adds counter properties to Post and User for the number of comments:
require 'dm-core' class Comment include ::Resource is :counter_cacheable property :id, Serial property :body, Text belongs_to :post belongs_to :user counter_cacheable :post counter_cacheable :user, :counter_property => :post_comments_counter end
- dm-core ~> 1.0
$ sudo gem install dm-is-countercacheable
Copyright (c) 2008-2011 Hal Brodigan
See LICENSE for license information.