Module: Rubix::Associations::BelongsToTemplate

Included in:
Item, Trigger
Defined in:
lib/rubix/associations/belongs_to_template.rb

Instance Method Summary collapse

Instance Method Details

#templateObject


12
13
14
15
16
# File 'lib/rubix/associations/belongs_to_template.rb', line 12

def template
  return @template if @template
  return unless @template_id
  @template = Template.find(:id => @template_id)
end

#template=(h) ⇒ Object


6
7
8
9
10
# File 'lib/rubix/associations/belongs_to_template.rb', line 6

def template= h
  return unless h
  @template    = h
  @template_id = h.id
end

#template_idObject


23
24
25
26
27
# File 'lib/rubix/associations/belongs_to_template.rb', line 23

def template_id
  return @template_id if @template_id
  return unless @template
  @template_id = @template.id
end

#template_id=(tid) ⇒ Object


18
19
20
21
# File 'lib/rubix/associations/belongs_to_template.rb', line 18

def template_id= tid
  return unless tid
  @template_id = tid
end