Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 28th, 2012  |  syntax: None  |  size: 0.23 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Rails writing a record to a table
  2. class Record < ActiveRecord::Base
  3.  
  4.   after_save :add_status_chanage
  5.  
  6.   def add_status_change
  7.     status = Status.new
  8.     status.record_id = id
  9.     status.field = field
  10.     status.save
  11.   end
  12.  
  13. end