aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/abstract_controller/rendering.rb
diff options
context:
space:
mode:
authorJon Moss <me@jonathanmoss.me>2016-04-15 21:41:19 -0400
committerJon Moss <me@jonathanmoss.me>2017-01-02 19:05:09 -0500
commitfeacb99003813d10425bd861d4dae3a14e4a33fb (patch)
treea9ef80e431938fa930863eef75b2468f5f2db141 /actionpack/lib/abstract_controller/rendering.rb
parent33e60514aed85b3076f2636d5f1ccfb513aace1c (diff)
downloadrails-feacb99003813d10425bd861d4dae3a14e4a33fb.tar.gz
rails-feacb99003813d10425bd861d4dae3a14e4a33fb.tar.bz2
rails-feacb99003813d10425bd861d4dae3a14e4a33fb.zip
Extract variant setter to process method
Provide an API interface similar to how format is handled in Controllers. In situations where variants are not needed (ex: in Action Mailer) the method will simply trigger a no-op, and will not affect end users.
Diffstat (limited to 'actionpack/lib/abstract_controller/rendering.rb')
-rw-r--r--actionpack/lib/abstract_controller/rendering.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb
index d339580435..54af938a93 100644
--- a/actionpack/lib/abstract_controller/rendering.rb
+++ b/actionpack/lib/abstract_controller/rendering.rb
@@ -109,6 +109,9 @@ module AbstractController
def _process_format(format)
end
+ def _process_variant(options)
+ end
+
def _set_html_content_type # :nodoc:
end
@@ -119,10 +122,7 @@ module AbstractController
# :api: private
def _normalize_render(*args, &block)
options = _normalize_args(*args, &block)
- #TODO: remove defined? when we restore AP <=> AV dependency
- if defined?(request) && !request.nil? && request.variant.present?
- options[:variant] = request.variant
- end
+ _process_variant(options)
_normalize_options(options)
options
end