Module: AuxModel

Included in:
City, Site
Defined in:
lib/aux_model.rb

Instance Method Summary collapse

Instance Method Details

#add_newsitem(item) ⇒ Object


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/aux_model.rb', line 4

def add_newsitem item
  n = Newsitem.new
  case item.class.name
  when 'Video'
    n.video_id = item.id
  when 'Photo'
    raise 'Not Implemented'
  when 'Report'
    raise 'Not Implemented'
  when 'Gallery'
    raise 'Not Implmented'
  else
    raise 'Not Implemented'
  end
  self.newsitems << n
  self.save
end