Add a state attribute to the Tag model

https://www.pivotaltracker.com/story/show/73970734

This adds a new attribute to the Tag model to represent the state of a tag - whether it is ‘draft’ or ‘live’.

Until we have built a workflow for publishing tags, we want to continue creating tags in the ‘live’ state.
Yes - I'm aware of that. My plan is to add a data migration to Panopticon
at the same time when I bump the gem.

On Friday, July 4, 2014, vinayvinay <notifications@github.com> wrote:

> In app/models/tag.rb:
>
> >    field :short_description, type: String
> > -
> > -  field :parent_id, type: String
> > +  field :parent_id,         type: String
> > +  field :state,             type: String, default: 'live'
>
> the 3rd AC mentions that existing tags must be in the "live" state.
> setting default to "live" will ensure that existing tags respond to state
> as "live", because mongoid responds with default value if the field is not
> set on the document. say, going forward we change the default to "draft",
> tags without a state field will respond to state with "draft".
>
> it'll be better to do a data migration and set the state field on
> existing tags with value "live", if we want that existing tags must be in
> "live" state.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/alphagov/govuk_content_models/pull/189/files#r14549515>
> .
>