Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Simplify if statements

  • Loading branch information...
commit f6039df572cf2d06a6e4225112a902da4ae1bf4f 1 parent e10a253
@strzalek strzalek authored
Showing with 4 additions and 6 deletions.
  1. +4 −6 actionpack/lib/action_controller/metal/rendering.rb
View
10 actionpack/lib/action_controller/metal/rendering.rb
@@ -11,12 +11,10 @@ module BasicRendering
def render(*args, &block)
super(*args, &block)
opts = args.first
- if (opts.keys & [:text, :nothing]).present?
- self.response_body = if opts.has_key?(:text) && opts[:text].present?
- opts[:text]
- elsif opts.has_key?(:nothing) && opts[:nothing]
- " "
- end
+ if opts.has_key?(:text) && opts[:text].present?
+ self.response_body = opts[:text]
+ elsif opts.has_key?(:nothing) && opts[:nothing]
+ self.response_body = " "
else
raise UnsupportedOperationError
end

0 comments on commit f6039df

Please sign in to comment.
Something went wrong with that request. Please try again.