#765 open
Ahenobarbi

When field is a HoHoboFields::EnumString, field_was is String

Reported by Ahenobarbi | July 23rd, 2010 @ 06:11 PM | in Hobo 1.4

In my app I have

Role = HoboFields::EnumString.for(:recruit, :mentor, :recruiter)

And

class User < ActiveRecord::Base
    # cut
    fields do
      role          Role, :default => 'recruit'
      #cut
    end
    # cut
end

When I use role_was it's String. I'll post steps to reproduce soon.

Comments and changes to this ticket

  • Matt Jones

    Matt Jones September 15th, 2011 @ 06:17 PM

    • State changed from “new” to “open”
    • Milestone set to Hobo 1.3 (Rails 3)
    • Milestone order changed from “197858” to “0”
  • Matt Jones

    Matt Jones September 21st, 2011 @ 03:51 PM

    • Milestone changed from Hobo 1.3 (Rails 3) to Hobo 1.4
    • Milestone order changed from “32” to “0”

    Good catch - unfortunately, this is going to be tricky to fix.

    For now, if you really need the value to be an EnumString, you can do this:

      @some_obj.role.class.new(@some_object.role_was)
    

    which will give you the right thing.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Tags

Pages