<commit_before># dm-is-countercacheable

* [github.com/postmodern/dm-is-counter_cacheable](http://github.com/postmodern/dm-is-counter_cacheable)
* [github.com/postmodern/dm-is-counter_cacheable/issues](http://github.com/postmodern/dm-is-counter_cacheable/issues)
* Postmodern (postmodern.mod3 at gmail.com)

## Description

A DataMapper plugin for adding counter-cache properties to related models.

## Example

Adds counter properties to Post and User for the number of comments:

    require 'dm-core'
    
    class Comment
    
      include DataMapper::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

## Requirements

* [dm-core](http://github.com/datamapper/dm-core/) ~> 1.0

## Install

    $ sudo gem install dm-is-countercacheable

## License

See {file:LICENSE.txt} for license information.
<commit_msg>Updated the README.<commit_after># dm-is-countercacheable

* [Source](http://github.com/postmodern/dm-is-counter_cacheable)
* [Issues](http://github.com/postmodern/dm-is-counter_cacheable/issues)
* [Docuementation](http://rubydoc.info/gems/dm-is-counter_cacheable)
* [Email](mailto:postmodern.mod3 at gmail.com)

## Description

A DataMapper plugin for adding counter-cache properties to related models.

## Example

Adds counter properties to Post and User for the number of comments:

    require 'dm-core'
    
    class Comment
    
      include DataMapper::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

## Requirements

* [dm-core](http://github.com/datamapper/dm-core/) ~> 1.0

## Install

    $ sudo gem install dm-is-countercacheable

## License

Copyright (c) 2008-2011 <NAME>

See {file:LICENSE.txt} for license information.
{'fraction_non_alphanumeric': 0.10489181561618062, 'fraction_numerical': 0.00658513640639699, 'mean_word_length': 3.2035573122529644, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4241851', 'n_tokens_mistral': 695, 'n_tokens_neox': 664, 'n_words': 148}