MySQL dialect descendant of BasicSelect class
Send missing methods calls to the @caller object, and also handle JOINs, UNIONs and INDEX hints
# File lib/dialects/mysql-constructor.rb, line 49 def method_missing ( method, *args ) # Handle all [*_]join calls: return _addJoin( method, *args ) if method.to_s =~ /^[a-z_]*join$/ # Handle all valid *_index/*_key calls: return _addIndexes( method, *args ) if VALID_INDEX_HINTS.include? method super end
Adds a USE/FORCE/IGNORE INDEX clause for the last objects in for_vals argument.
# File lib/dialects/mysql-constructor.rb, line 65 def _addIndexes ( type, *list ) type = type.to_s type.upcase!.gsub! /_/, ' ' @attr_index_hints ||= [ ] # set the attr_index_hints for the last object in for_vals last_ind = @attr_from.val.length - 1 @attr_index_hints[last_ind] = { :type => type, :list => SQLObject.get( list ) } @string = nil return self end
Generated with the Darkfish Rdoc Generator 2.