Module: SocialStream::Models::Subject::ClassMethods

Defined in:
lib/social_stream/models/subject.rb

Instance Method Summary collapse

Instance Method Details

#find_by_slug(perm) ⇒ Object



107
108
109
# File 'lib/social_stream/models/subject.rb', line 107

def find_by_slug(perm)
  includes(:actor).where('actors.slug' => perm).first
end

#find_by_slug!(perm) ⇒ Object



111
112
113
114
# File 'lib/social_stream/models/subject.rb', line 111

def find_by_slug!(perm)
  find_by_slug(perm) ||
    raise(ActiveRecord::RecordNotFound)
end