Permalink
Browse files

Clean the code a bit

  • Loading branch information...
spastorino committed Jun 30, 2013
1 parent 08f8c8a commit 4eedb3928e5555e9d766f7c92637a6341c461efb
@@ -4,7 +4,7 @@ module Tags # :nodoc:
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 Tags # :nodoc:
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

0 comments on commit 4eedb39

Please sign in to comment.