Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Commit

Permalink
prevent :index => false from causing AR to create an index
Browse files Browse the repository at this point in the history
  • Loading branch information
ronen committed Dec 30, 2014
1 parent f50d8eb commit 498c3ed
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -128,7 +128,12 @@ def belongs_to_with_schema_plus(*args) #:nodoc:

def column_with_schema_plus(name, type, options = {}) #:nodoc:
schema_plus_normalize_column_options(options)
# prevent AR from seeing :index => false as a request for an index
if noindex = options[:index] == false
options.delete(:index)
end
column_without_schema_plus(name, type, options)
options[:index] = false if noindex
schema_plus_handle_column_options(self.name, name, options, :config => schema_plus_config)
self
end
Expand Down

0 comments on commit 498c3ed

Please sign in to comment.