Methods

AuxModel

Public Instance Methods

add_newsitem(item) click to toggle source
# File app/models/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

[Validate]

Generated with the Darkfish Rdoc Generator 2.