Clem Rock
2007-Aug-24 12:44 UTC
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:
[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
[/code]
Does anyone know how I can work around this error?
Thanks for your time!
Clem C
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
