Sha256: 5ff0f377c4099dcbc45c7a49fb3631d543985b9778e9ee8a7c0dcbc3ceef0f62

Contents?: true

Size: 389 Bytes

Versions: 2

Compression:

Stored size: 389 Bytes

Contents

require 'dm-core'
require 'dm-migrations'

class Comment

  include DataMapper::Resource
  include DataMapper::Migrations

  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,
                           :counter_index => true

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dm-is-counter_cacheable-0.1.1 spec/integration/models/comment.rb
dm-is-counter_cacheable-0.1.0 spec/integration/models/comment.rb