Ruby on Rails Friday, August 17, 2018

On Thu, Aug 16, 2018 at 10:55 AM, Stephanie_Snowflake
<spicychemist@gmail.com> wrote:
> I'm looking for a way to split a group of data (ex. Sales Orders)
>
> Currently split (In Progress, On Hold, Shipped, Cancelled)
>
> I would like to split Shipped into two
>
> Shipped (before 1 year)
> Archive Shipped (after 1 year)

As far as I can tell, nothing in the model you show has anything to
do with *setting* a status.

You can add ':archive_shipped' to this (and presumably to the DB
schema),

> enum status: [ :in_progress, :on_hold, :cancelled, :shipped ]

but where is the status set to start with?

Also, in passing, "before one year" and "after one year" probably
leaves a day in the middle ("exactly one year") when things will be
at the least indeterminate. FWIW.

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yCHy48iVQeCGxy8c67x6HUhomnyCL7KWHbG_R1HwXOaBQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment