Hi Graham I'm not entirely sure how enum's work in MySQL, but if there's a function you can use/create to translate the values to integers, then you could wrap it up in your attribute as follows:
has "CONVERT_ENUM_TO_INT(`enum_col`)", :as => :enum_col, :type => :integer Which would save you from migrating the data. Cheers -- Pat On 08/12/2008, at 12:09 PM, Graham Glass wrote: > > Hi everyone, > > One of the columns on my Rails model is represented as an enum in > MySQL. But Sphinx doesn't seem to allow enums as an attribute type > which is important to me. > > What would you recommend that I migrate my enum column to a simple > integer and define constants in my application like enum1=1, enum2=2, > etc.? > > That seems like the simplest solution, but I wanted to get some > feedback before I proceed. > > Thanks, > Graham > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en -~----------~----~----~----~------~----~------~--~---
