diff options
author | Pablo Ifran <pabloifran@gmail.com> | 2012-10-22 09:42:42 -0200 |
---|---|---|
committer | Pablo Ifran <pabloifran@gmail.com> | 2012-10-22 09:42:42 -0200 |
commit | e041a50f2917f82950f9e5666f966d8992afd45d (patch) | |
tree | 9f4d2e3aa88f28dba9d7a1d24d46977e0642a1eb /railties/lib/rails/generators/generated_attribute.rb | |
parent | 3e6b2f5d38e0f31db3fb0fcd3bbab92666a0e3e2 (diff) | |
parent | ae27acb342c575ce19d5ad78cb13ba23f826fab1 (diff) | |
download | rails-e041a50f2917f82950f9e5666f966d8992afd45d.tar.gz rails-e041a50f2917f82950f9e5666f966d8992afd45d.tar.bz2 rails-e041a50f2917f82950f9e5666f966d8992afd45d.zip |
Merge branch 'master' of https://github.com/lifo/docrails
Conflicts:
activerecord/lib/active_record/callbacks.rb
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 |