Forum: Ruby on Rails how to implement a status table

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
8133ee52ca72188132b5c7d97dfb967f?d=identicon&s=25 Chris Habgood (chabgood)
on 2009-04-14 22:03
(Received via mailing list)
I have a from that will have a status, "approved", "in
process",denied"... and such.

What is the best approach?
Status table,
One row with each column status type?
The form will have only one status so I will have to manage making
sure all columns that are not "true" will be false.

If I set it up so I populate the table with each row being a status
type then it will be easier to implement.
I could have a drop down to change status dynamically..

Any ideas?
Dd2d775dea75b381edb1bbf0600a0907?d=identicon&s=25 Marnen Laibow-Koser (marnen)
on 2009-04-14 22:58
Chris Habgood wrote:
> I have a from that will have a status, "approved", "in
> process",denied"... and such.
>
> What is the best approach?

If a record can only have one status at a time, then it only needs one
status field.

Consider using aasm -- it's meant for exactly this purpose.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org
280b78a61a968391b7e07e912be102a8?d=identicon&s=25 Robert Walker (robert4723)
on 2009-04-14 23:05
Marnen Laibow-Koser wrote:
> Chris Habgood wrote:
>> I have a from that will have a status, "approved", "in
>> process",denied"... and such.
>>
>> What is the best approach?
>
> If a record can only have one status at a time, then it only needs one
> status field.
>
> Consider using aasm -- it's meant for exactly this purpose.

This is what Marnen suggested, which I concur:
http://github.com/rubyist/aasm/tree/master
8133ee52ca72188132b5c7d97dfb967f?d=identicon&s=25 Chris Habgood (chabgood)
on 2009-04-14 23:07
(Received via mailing list)
OK, cool. thanks, looking now.

On Apr 14, 4:05 pm, Robert Walker <rails-mailing-l...@andreas-s.net>
This topic is locked and can not be replied to.