Module: SocialStream::Models::Actor::ClassMethods
- Defined in:
- lib/social_stream/models/actor.rb
Instance Method Summary collapse
- #find_by_permalink(perm) ⇒ Object
- #find_by_permalink!(perm) ⇒ Object
-
#receiving_subject_classes ⇒ Object
Actor subtypes that may receive a tie from an instance of this class.
-
#relations(to = to_s) ⇒ Object
Relations defined for this actor model.
Instance Method Details
#find_by_permalink(perm) ⇒ Object
67 68 69 |
# File 'lib/social_stream/models/actor.rb', line 67 def find_by_permalink(perm) joins(:actor).where('actors.permalink' => perm).first end |
#find_by_permalink!(perm) ⇒ Object
71 72 73 74 |
# File 'lib/social_stream/models/actor.rb', line 71 def find_by_permalink!(perm) find_by_permalink(perm) || raise(ActiveRecord::RecordNotFound) end |
#receiving_subject_classes ⇒ Object
Actor subtypes that may receive a tie from an instance of this class
60 61 62 63 64 65 |
# File 'lib/social_stream/models/actor.rb', line 60 def receiving_subject_classes Relation.select("DISTINCT #{ Relation.quoted_table_name }.receiver_type"). where(:sender_type => to_s). map(&:receiver_type). map(&:constantize) end |