Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

enum_attr messes up custom setters on .new and .create #29

Open
sheab opened this Issue · 0 comments

1 participant

@sheab
# user.rb
# t.enum :rank
# t.string :name
class User < ActiveRecord::Base
    enum_attr :rank, %w{user administrator}

    def name=(_name)
        self[:name] = "#{_name.upcase} + THE GREAT"
    end
end

Then

User.new(:name => "bob").name =>
"bob"

User.create(:name => "bob").name =>
"bob"

When the return should be "BOB THE GREAT"

When enum_attr is commented out, it works correctly.

Using current version of enumerated_attribute (0.2.16) and Rails 3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.