2008-01-31 02:50:15 -05:00
|
|
|
class Pet < ActiveRecord::Base
|
2010-11-11 11:41:15 -05:00
|
|
|
attr_accessor :current_user
|
|
|
|
|
2011-11-29 13:58:41 -05:00
|
|
|
self.primary_key = :pet_id
|
2009-04-16 18:25:55 -04:00
|
|
|
belongs_to :owner, :touch => true
|
2009-03-09 09:42:51 -04:00
|
|
|
has_many :toys
|
2010-11-11 11:41:15 -05:00
|
|
|
|
2010-11-30 21:46:56 -05:00
|
|
|
class << self
|
|
|
|
attr_accessor :after_destroy_output
|
|
|
|
end
|
|
|
|
|
2010-11-11 11:41:15 -05:00
|
|
|
after_destroy do |record|
|
2010-11-30 21:46:56 -05:00
|
|
|
Pet.after_destroy_output = record.current_user
|
2010-11-11 11:41:15 -05:00
|
|
|
end
|
2009-03-09 09:42:51 -04:00
|
|
|
end
|