Class: EvilQuery::VisibleShareableById

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, klass, key, id, conditions = {}) ⇒ VisibleShareableById


85
86
87
88
89
90
91
# File 'lib/evil_query.rb', line 85

def initialize(user, klass, key, id, conditions={})
  @querent = user
  @class = klass
  @key = key
  @id  = id
  @conditions = conditions
end

Instance Method Details

#post!Object


93
94
95
96
# File 'lib/evil_query.rb', line 93

def post!
  #small optimization - is this optimal order??
  querent_is_contact.first || querent_is_author.first || public_post.first
end