ArgumentError: interning empty string and enum-column plugin

Hello,

I am a developer who has just started working on a large scale
website in a team of 5 other developers. One of the developers has
introduced some enum columns into the the database. Now, by default,
active record doesn’t support enum column types but I have added the
enum-column plugin into our project. This has worked very well except
for a few instances where he introduced enums that featured and empty
string IE. enum(’’,‘Artist’,‘Venue’,‘Fan’,‘Label’).

This causes the mysql_adapter.rb section of the plugin to throw a
“ArgumentError: interning empty string” error in this section of code:

class MysqlColumnWithEnum < MysqlColumn
      include ActiveRecordEnumerations::Column

      def initialize(name, default, sql_type = nil, null = true)
        if sql_type =~ /^enum/i

          values = sql_type.sub(/^enum\('([^)]+)'\)/i,
'\1').split("','").map { |v| v.intern}

          default = default.intern if default and !default.empty?
        end
        super(name, default, sql_type, null, values)
      end
    end
  end

Does anyone know how I can work around this error?

Thanks for your time!

Clem C

hello,
were you able to find a workaround for this, resolve this empty string
problem? i see that no one ever replied to your post, and i am having
a similar problem at the moment.

On Aug 24 2007, 5:44 am, Clem R. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs