Sha256: 997167f49d062b082bad82bb8605cbde5181b803e426c31f31792c42b37b5ba4

Contents?: true

Size: 260 Bytes

Versions: 9

Compression:

Stored size: 260 Bytes

Contents

class User < ActiveRecord::Base
  include Cacheable

  has_many :posts
  has_one :account

  model_cache do
    with_key
    with_attribute :login
    with_method :last_post
    with_association :posts, :account
  end

  def last_post
    posts.last
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
simple_cacheable-1.3.0 spec/models/user.rb
simple_cacheable-1.2.1 spec/models/user.rb
simple_cacheable-1.2.0 spec/models/user.rb
simple_cacheable-1.1.5 spec/models/user.rb
simple_cacheable-1.1.4 spec/models/user.rb
simple_cacheable-1.1.3 spec/models/user.rb
simple_cacheable-1.1.2 spec/models/user.rb
simple_cacheable-1.1.1 spec/models/user.rb
simple_cacheable-1.1.0 spec/models/user.rb