before_create :permission_to_attach_to_objects
before_update :permission_to_attach_to_objects
+ attr_accessor :head
+ attr_accessor :tail
+
api_accessible :superuser, :extend => :common do |t|
t.add :tail_kind
t.add :tail_uuid
t.add :name
t.add :head_kind
t.add :head_uuid
+ t.add :head, :if => :head
+ t.add :tail, :if => :tail
t.add :properties
end
include CommonApiTemplate
serialize :info, Hash
before_validation :set_default_event_at
+ attr_accessor :object
api_accessible :superuser, :extend => :common do |t|
t.add :object_kind
t.add :object_uuid
+ t.add :object, :if => :object
t.add :event_at
t.add :event_type
t.add :summary
re = col.name.match /^(.*)_kind$/
if (re and
self.respond_to? re[1].to_sym and
- (auuid = self.send(re[1].to_sym)) and
+ (auuid = self.send((re[1] + '_uuid').to_sym)) and
(aclass = self.class.kind_class(self.send(col.name.to_sym))) and
(aobject = aclass.where('uuid=?', auuid).first))
- self.send((re[1]+'=').to_sym, aobject)
+ self.instance_variable_set('@'+re[1], aobject)
end
end
end
include CommonApiTemplate
serialize :components, Hash
belongs_to :pipeline, :foreign_key => :pipeline_uuid, :primary_key => :uuid
+ attr_accessor :pipeline
before_validation :bootstrap_components
before_validation :update_success
api_accessible :superuser, :extend => :common do |t|
t.add :pipeline_uuid
+ t.add :pipeline, :if => :pipeline
t.add :name
t.add :components
t.add :success