blob: 6e15dc44935c3c5260f7c4dfc74b12cdf602e452 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
class Favorite < ActiveRecord::Base
belongs_to :tweet, :counter_cache => true
belongs_to :user
def user
User.cached(user_id)
end
def tweet
Tweet.cached(tweet_id)
end
end
|