Class: EvilQuery::Participation

Inherits:
Base
  • Object
show all
Defined in:
lib/evil_query.rb

Instance Method Summary collapse

Methods inherited from Base

#fetch_ids!, #id_sql

Constructor Details

#initialize(user) ⇒ Participation


14
15
16
17
# File 'lib/evil_query.rb', line 14

def initialize(user)
  @user = user
  @class = Post
end

Instance Method Details

#postsObject


19
20
21
# File 'lib/evil_query.rb', line 19

def posts
  Post.joins(:participations).where(:participations => {:author_id => @user.person.id}).order("posts.interacted_at DESC")
end