No commit activity in last 3 years
No release in over 3 years
DataMapper plugin for counter caches ala ActiveRecord. Original idea and implementation by Saimon Moore (daimonmoore [a] gmail [d] com)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 2.3.3

Runtime

= 0.9.12
 Project Readme
== README

DataMapper::CounterCacheable automates the dec/incrementing of association counter fields. This is
similar to counter caches in ActiveRecord.

Example:

class Post
  include DataMapper::Resource

  has n :comments

  property :id, Integer, :serial => true
  property :comments_count, Integer, :default => 0
end

class Comment
  include DataMapper::Resource
  include DataMapper::CounterCacheable  

  belongs_to :post, :counter_cache => true

end