mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Clean the code a bit
This commit is contained in:
parent
08f8c8aa52
commit
4eedb3928e
2 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue