diff options
-rw-r--r-- | actionview/lib/action_view/helpers/tags/color_field.rb | 2 | ||||
-rw-r--r-- | actionview/lib/action_view/helpers/tags/datetime_field.rb | 2 | ||||
-rw-r--r-- | guides/source/migrations.md | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/actionview/lib/action_view/helpers/tags/color_field.rb b/actionview/lib/action_view/helpers/tags/color_field.rb index bab28352ed..b4bbe92746 100644 --- a/actionview/lib/action_view/helpers/tags/color_field.rb +++ b/actionview/lib/action_view/helpers/tags/color_field.rb @@ -4,7 +4,7 @@ module ActionView class ColorField < TextField # :nodoc: def render options = @options.stringify_keys - options["value"] = options.fetch("value") { validate_color_string(value(object)) } + options["value"] ||= validate_color_string(value(object)) @options = options super end diff --git a/actionview/lib/action_view/helpers/tags/datetime_field.rb b/actionview/lib/action_view/helpers/tags/datetime_field.rb index 416d225706..25e7e05ec6 100644 --- a/actionview/lib/action_view/helpers/tags/datetime_field.rb +++ b/actionview/lib/action_view/helpers/tags/datetime_field.rb @@ -4,7 +4,7 @@ module ActionView class DatetimeField < TextField # :nodoc: def render options = @options.stringify_keys - options["value"] = options.fetch("value") { format_date(value(object)) } + options["value"] ||= format_date(value(object)) options["min"] = format_date(options["min"]) options["max"] = format_date(options["max"]) @options = options diff --git a/guides/source/migrations.md b/guides/source/migrations.md index 508e52a77c..035f9499de 100644 --- a/guides/source/migrations.md +++ b/guides/source/migrations.md @@ -314,7 +314,7 @@ will produce a migration that looks like this class AddDetailsToProducts < ActiveRecord::Migration def change add_column :products, :price, precision: 5, scale: 2 - add_reference :products, :user, polymorphic: true, index: true + add_reference :products, :supplier, polymorphic: true, index: true end end ``` |