Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thbar/42578 to your computer and use it in GitHub Desktop.
Save thbar/42578 to your computer and use it in GitHub Desktop.
Index: thinking-sphinx/lib/thinking_sphinx/attribute.rb
===================================================================
--- thinking-sphinx/lib/thinking_sphinx/attribute.rb (revision 809)
+++ thinking-sphinx/lib/thinking_sphinx/attribute.rb (working copy)
@@ -102,14 +102,17 @@
end
def type_to_config
- {
+ supported_types = {
:multi => :sql_attr_multi,
:datetime => :sql_attr_timestamp,
:string => :sql_attr_str2ordinal,
:float => :sql_attr_float,
:boolean => :sql_attr_bool,
:integer => :sql_attr_uint
- }[type]
+ }
+ config = supported_types[type]
+ raise "Cannot automatically determine config for type :#{type} (attribute:#{unique_name}). You may need to specify #{unique_name} :type => X, where X is one of [#{supported_types.keys.map { |k| ":#{k}" }.join(',')}]" if config.nil?
+ config
end
def config_value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment