Module: ActivityObject::Properties

Extended by:
ActiveSupport::Concern, HolderMethods
Included in:
ActivityObject
Defined in:
app/models/activity_object/properties.rb

Overview

Manage all the relations between two ActivityObject

By default, any object is related with the others That means that the following methods are available:

post.posts #=> returns all the posts that are properties of post
post.documents #=> returns all the documents associated with post
document.holder_posts #=> all the posts that have this document as property

Currently, Rails does not support assigning objects directly, as in post.documents << d, but you can use

post.property_objects << d.activity_object_id

There are convenience method to add properties to holders without affecting existing holders. For instance, if you can assign several documents to an event, you can use:

document.add_holder_event_id = event.id

Defined Under Namespace

Modules: ClassMethods, HolderMethods

Instance Method Summary collapse

Methods included from HolderMethods

holder_methods

Instance Method Details

#add_holder_object_id=(i) ⇒ Object



109
110
111
# File 'app/models/activity_object/properties.rb', line 109

def add_holder_object_id= i
  self.holder_object_ids |= [i]
end