Skip to content

Instantly share code, notes, and snippets.

View djgraham's full-sized avatar
:shipit:
Oh hello!

David Graham djgraham

:shipit:
Oh hello!
View GitHub Profile
@djgraham
djgraham / option.rb
Created March 31, 2010 12:42 — forked from caius/option.rb
class Option < ActiveRecord::Base
attr_accessor :view_type, :comments_count, :expires_at_date, :expires_at_time
before_save :set_expires_at
after_save :set_reference, :set_default_room_allocation_name, :set_room_allocation_dates
private
def set_reference
self[:reference] = "OPT%05d" % id