Sha256: 6584a8f0c4a9608b784b3def7806dd9cbb908ee713e27a9e1e4e74d1925d5153
Contents?: true
Size: 816 Bytes
Versions: 1
Compression:
Stored size: 816 Bytes
Contents
class Relation::Public < Relation attr_accessor :actor after_create :initialize_tie scope :actor, lambda { |a| joins(:ties).merge(Tie.sent_by(a)) } class << self def default_for(actor) create! :actor => actor end # The {Relation::Public} belonging to actor def of(actor) actor(actor).first end end # A {Relation::Public public relation} is always the weakest def <=>(relation) 1 end # The name of public relation def name I18n.t('relation.public.name') end # Are we supporting custom permissions for {Relation::Public}? Not by the moment. def allow?(user, action, object) action == 'read' && object == 'activity' end private def initialize_tie ties.create! :sender => actor, :receiver => actor end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
social_stream-0.4.4 | app/models/relation/public.rb |