Sha256: 1cb1a4ac9eea7af8167c3c8af4f9bcc3172caee209ebd540d21813be30d90e35

Contents?: true

Size: 450 Bytes

Versions: 3

Compression:

Stored size: 450 Bytes

Contents

class Tweet < ActiveRecord::Base
  has_many :favorites, count_loader: true
  has_many :favs, class_name: 'Favorite'
  has_many :my_favorites, -> { where(user_id: 1) }, class_name: 'Favorite', count_loader: true
  has_many :my_favs, -> { where(user_id: 1) }, class_name: 'Favorite'
  has_many :ordered_favorites, -> { order(:id) }, class_name: 'Favorite', count_loader: true
  has_many :notifications, as: :notifiable, foreign_key: :notifiable_id
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
activerecord-precount-0.7.0 test/models/tweet.rb
activerecord-precount-0.7.0.beta1 test/models/tweet.rb
activerecord-precount-0.6.3 test/models/tweet.rb