Skip to content

Commit

Permalink
Simplify if statements
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszx0 committed Aug 25, 2013
1 parent e10a253 commit f6039df
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions actionpack/lib/action_controller/metal/rendering.rb
Expand Up @@ -11,12 +11,10 @@ module BasicRendering
def render(*args, &block) def render(*args, &block)
super(*args, &block) super(*args, &block)
opts = args.first opts = args.first
if (opts.keys & [:text, :nothing]).present? if opts.has_key?(:text) && opts[:text].present?
self.response_body = if opts.has_key?(:text) && opts[:text].present? self.response_body = opts[:text]
opts[:text] elsif opts.has_key?(:nothing) && opts[:nothing]
elsif opts.has_key?(:nothing) && opts[:nothing] self.response_body = " "
" "
end
else else
raise UnsupportedOperationError raise UnsupportedOperationError
end end
Expand Down

0 comments on commit f6039df

Please sign in to comment.