Parent

Methods

Included Modules

Newsitem

Public Class Methods

from_params(item) click to toggle source
# File app/models/newsitem.rb, line 31
def self.from_params item
  n = Newsitem.new
  n.descr = item[:descr]
  n.username = item[:username]

  unless item[:report_id].blank?
    n.report = Report.find item[:report_id]
  end
  
  unless item[:gallery_id].blank?
    n.gallery = Gallery.find item[:gallery_id]
  end

  n.partial_name = item.partial_name unless item.partial_name.blank?

  return n
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.