Module: MuckShares::Models::MuckShare

Extended by:
ActiveSupport::Concern
Defined in:
lib/muck-shares/models/share.rb

Instance Method Summary collapse

Instance Method Details

#add_share_activity(share_to = nil, attach_to = nil) ⇒ Object

Adds activities for the share.



24
25
26
27
28
29
# File 'lib/muck-shares/models/share.rb', line 24

def add_share_activity(share_to = nil, attach_to = nil)
  share_to ||= self.shared_by.feed_to
  share_to = [share_to] unless share_to.is_a?(Array)
  share_to << self.shared_by unless share_to.include?(self.shared_by) # make sure the person doing the sharing is included
  add_activity(share_to, self.shared_by, self, 'share', '', '', nil, attach_to)
end

#can_edit?(user) ⇒ Boolean

override this method to change the way permissions are handled on shares

Returns:

  • (Boolean)


32
33
34
35
# File 'lib/muck-shares/models/share.rb', line 32

def can_edit?(user)
  return true if check_sharer(user)
  false
end