# Tracking model status attributes

**URL:** <https://www.ruby-forum.com/t/tracking-model-status-attributes/111402>\
**Category:** Rails\
**Created:** [August 6, 2007, 11:37pm UTC](https://www.ruby-forum.com/t/tracking-model-status-attributes/111402 "2007-08-06T23:37:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![reynar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@reynar](https://www.ruby-forum.com/u/reynar)\
**Post date:** [August 6, 2007, 11:37pm UTC](https://www.ruby-forum.com/t/tracking-model-status-attributes/111402/1 "2007-08-06T23:37:28Z")

</div>

Hi,

I have a number of models that have various states specific to the  
domain. I was wondering how people go about modelling and persisting  
this state and optionally track its progress.

I notice in DHH’s resources on rails speech he included the following  
code snippet,

class Kase \< ActiveRecord::Base  
has\_one :progress  
end

class Progress \< ActiveRecord::Base  
belongs\_to :kase  
belongs\_to :initiator, :class\_name =\> “Person”  
end

class Opened \< Progress  
end

class Reviewed \< Progress  
belongs\_to :verifier, :class\_name =\> “Person”  
end

class Closed \< Progress  
end

As someone still learning Ruby, what would be the best way to  
interrogate a Kase object progress? Is it down to testing for the  
kaseobject.progress type?

I had also considered you would have a Kase model with separate  
attributes for opened, reviewed, and closed. Each Progress object  
containing the time and preserving stage information between progress  
states.

Such as myKase.reviewed? =\> nil or Reviewed object

Do they above couple of points sound reasonable or have I  
misinterpreted what is suggested.

Thanks, Andrew
