Have you tried this?
currentstste=article.lifecycle.state_name
-Owen
On Oct 20, 1:26 am, dd <[email protected]> wrote:
> When you define:
>
> class Article < ActiveRecord::Base
> Status = HoboFields::EnumString.for
> (:draft, :approved, :published)
> fields do
> status Status
> end
> end
>
> You can use the Article::Status::APPROVED instead of the string
> 'approved', and you will avoid any possible typo.
>
> Is there anything like that (i mean constants or accessors) for the
> Lifecycle states?
>
> If you have:
>
> state :foo, :default => true
> state :bar
>
> How can you access the values through a constant? Something like:
> Article::State::FOO or Article::Lifecycle::State::FOO.
>
> I know: I could set the constants manually and use them to define the
> states, but that;s not sexy, specially if there are some internal
> constants already set, but I don't find them.
>
> What is the official way to access any defined state string/symbol?
>
> Thank you
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---