Class: AspectMembership

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/aspect_membership.rb

Overview

Copyright © 2010-2011, Diaspora Inc. This file is

licensed under the Affero General Public License version 3 or later.  See
the COPYRIGHT file.

Instance Method Summary collapse

Instance Method Details

#as_json(opts = {}) ⇒ Object


19
20
21
22
23
24
25
26
27
# File 'app/models/aspect_membership.rb', line 19

def as_json(opts={})
  {
    :id => self.id,
    :person_id  => self.person.id,
    :contact_id => self.contact.id,
    :aspect_id  => self.aspect_id,
    :aspect_ids => self.contact.aspects.map{|a| a.id}
  }
end