diff options
author | Robin Dupret <robin.dupret@gmail.com> | 2012-10-14 12:03:39 +0200 |
---|---|---|
committer | Robin Dupret <robin.dupret@gmail.com> | 2012-10-14 18:26:58 +0200 |
commit | 5ad7f8ab418f0c760dbb584f7c78d94ce32e9ee3 (patch) | |
tree | 9e58227af8a363398a03b8010156d5a84d59dea9 /railties/lib/rails/generators/generated_attribute.rb | |
parent | ca618d473dcb9b5cc4000d057df9322376900622 (diff) | |
download | rails-5ad7f8ab418f0c760dbb584f7c78d94ce32e9ee3.tar.gz rails-5ad7f8ab418f0c760dbb584f7c78d94ce32e9ee3.tar.bz2 rails-5ad7f8ab418f0c760dbb584f7c78d94ce32e9ee3.zip |
Use Ruby 1.9 Hash syntax in railties
Diffstat (limited to 'railties/lib/rails/generators/generated_attribute.rb')
-rw-r--r-- | railties/lib/rails/generators/generated_attribute.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/railties/lib/rails/generators/generated_attribute.rb b/railties/lib/rails/generators/generated_attribute.rb index 231813f774..d8a4f15b4b 100644 --- a/railties/lib/rails/generators/generated_attribute.rb +++ b/railties/lib/rails/generators/generated_attribute.rb @@ -23,7 +23,7 @@ module Rails type = type.to_sym if type if type && reference?(type) - references_index = UNIQ_INDEX_OPTIONS.include?(has_index) ? { :unique => true } : true + references_index = UNIQ_INDEX_OPTIONS.include?(has_index) ? { unique: true } : true attr_options[:index] = references_index end @@ -41,11 +41,11 @@ module Rails def parse_type_and_options(type) case type when /(string|text|binary|integer)\{(\d+)\}/ - return $1, :limit => $2.to_i + return $1, limit: $2.to_i when /decimal\{(\d+)[,.-](\d+)\}/ - return :decimal, :precision => $1.to_i, :scale => $2.to_i + return :decimal, precision: $1.to_i, scale: $2.to_i when /(references|belongs_to)\{polymorphic\}/ - return $1, :polymorphic => true + return $1, polymorphic: true else return type, {} end |