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:
Does anyone know how I can work around this error?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
Thanks for your time!
Clem C





Bookmarks