diff options
author | Matthew Draper <matthew@trebex.net> | 2016-01-25 00:28:31 +1030 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2016-01-25 00:28:31 +1030 |
commit | 235c75972e5985e7b95e3326b8c7c1b9a15ac70c (patch) | |
tree | 2064b103741c9f27747e0c3c35872f41f8c8fabd /railties/lib/rails/generators | |
parent | dcdadd5e82eed2e64d21399599b14501c3e16cc3 (diff) | |
parent | 909818b93b8f1bd4d7053a1c5d8135b9b0cbe865 (diff) | |
download | rails-235c75972e5985e7b95e3326b8c7c1b9a15ac70c.tar.gz rails-235c75972e5985e7b95e3326b8c7c1b9a15ac70c.tar.bz2 rails-235c75972e5985e7b95e3326b8c7c1b9a15ac70c.zip |
Merge pull request #23179 from prathamesh-sonpatki/pare-back-default-index-option-to-references
Pare back default `index` option for the migration generator
Diffstat (limited to 'railties/lib/rails/generators')
-rw-r--r-- | railties/lib/rails/generators/generated_attribute.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/railties/lib/rails/generators/generated_attribute.rb b/railties/lib/rails/generators/generated_attribute.rb index 8145a26e22..7e437e7344 100644 --- a/railties/lib/rails/generators/generated_attribute.rb +++ b/railties/lib/rails/generators/generated_attribute.rb @@ -23,8 +23,9 @@ module Rails type = type.to_sym if type if type && reference?(type) - references_index = UNIQ_INDEX_OPTIONS.include?(has_index) ? { unique: true } : true - attr_options[:index] = references_index + if UNIQ_INDEX_OPTIONS.include?(has_index) + attr_options[:index] = { unique: true } + end end new(name, type, has_index, attr_options) |