Class: Tie
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Tie
- Defined in:
- app/models/tie.rb
Overview
Authorization
When an Actor establishes a Tie with other, she is granting a set of Permissions to them (posting to her wall, reading her posts, etc..) The set of Permissions granted are associated with the Relation of the Tie.
Scopes
There are several scopes defined:
- sent_by(actor)
-
ties whose sender is actor
- received_by(actor)
-
ties whose receiver is actor
- sent_or_received_by(actor)
-
the union of the former
- related_by(relation)
-
ties with this relation. Accepts relation, relation_name, integer, array
Instance Method Summary collapse
-
#bidirectional? ⇒ Boolean
This Tie is positive and positive replied.
- #positive? ⇒ Boolean
- #positive_replied? ⇒ Boolean
- #receiver_subject ⇒ Object
- #relation_name ⇒ Object
- #sender_subject ⇒ Object
Instance Method Details
#bidirectional? ⇒ Boolean
This Tie is positive and positive replied
89 90 91 |
# File 'app/models/tie.rb', line 89 def bidirectional? positive? && positive_replied? end |
#positive? ⇒ Boolean
79 80 81 |
# File 'app/models/tie.rb', line 79 def positive? relation.positive? end |
#positive_replied? ⇒ Boolean
84 85 86 |
# File 'app/models/tie.rb', line 84 def positive_replied? contact.positive_replied? end |
#receiver_subject ⇒ Object
74 75 76 |
# File 'app/models/tie.rb', line 74 def receiver_subject receiver.subject end |
#relation_name ⇒ Object
66 67 68 |
# File 'app/models/tie.rb', line 66 def relation_name relation.try(:name) end |
#sender_subject ⇒ Object
70 71 72 |
# File 'app/models/tie.rb', line 70 def sender_subject sender.subject end |