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

Untitled

By: a guest on May 9th, 2012  |  syntax: None  |  size: 0.53 KB  |  hits: 13  |  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.   def validate_status_changes
  2.     if changes.keys == ["status"]
  3.       noop("Allow changes to the status only")
  4.     elsif changes["status"].present? && changes["status"].second == "open"
  5.       noop("Allow any changes when going to 'open'")
  6.     elsif changes["status"].present? && changes["status"].first == "open"
  7.       noop("Allow any changes when going from 'open' to another status")
  8.     else
  9.       errors.add_to_base(:cant_update_locked_deliverable) if locked?
  10.       errors.add_to_base(:cant_update_closed_deliverable) if closed?
  11.     end
  12.   end