Sha256: d83b5df29d874a51434179fc8e50c02b39976d9e94ff98fc7fa9acc5a8f9bd9c
Contents?: true
Size: 754 Bytes
Versions: 11
Compression:
Stored size: 754 Bytes
Contents
module ForumReader def self.included(base) base.class_eval { has_many :posts, :order => 'posts.created_at desc', :dependent => :nullify named_scope :most_commenting, lambda { |count| { :select => "readers.*, count(posts.id) AS post_count", :joins => "INNER JOIN posts ON posts.reader_id = readers.id", :group => "readers.id", :order => "post_count DESC", :limit => count } } } end # This will get more useful soon. For now I'm just establishing an interface. # Moderation will be a global flag but can also come from group-leadership or forum-ownership def is_moderator?(thing=nil) true if is_admin? end end
Version data entries
11 entries across 11 versions & 1 rubygems