Created
January 2, 2009 15:50
-
-
Save thbar/42578 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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