aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/renderer
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-12-20 15:12:38 +0100
committerJosé Valim <jose.valim@gmail.com>2011-12-20 15:12:38 +0100
commit6c57177f2c7f4f934716d588545902d5fc00fa99 (patch)
treedd5fe4b2e1ab708fdc9aa4324ca382de87da9cf3 /actionpack/lib/action_view/renderer
parentcae1768c6a0e3d1cd4a2c2d836ef213438689db6 (diff)
downloadrails-6c57177f2c7f4f934716d588545902d5fc00fa99.tar.gz
rails-6c57177f2c7f4f934716d588545902d5fc00fa99.tar.bz2
rails-6c57177f2c7f4f934716d588545902d5fc00fa99.zip
Remove deprecation warnings from Action Pack.
Diffstat (limited to 'actionpack/lib/action_view/renderer')
-rw-r--r--actionpack/lib/action_view/renderer/abstract_renderer.rb12
-rw-r--r--actionpack/lib/action_view/renderer/partial_renderer.rb9
-rw-r--r--actionpack/lib/action_view/renderer/template_renderer.rb1
3 files changed, 1 insertions, 21 deletions
diff --git a/actionpack/lib/action_view/renderer/abstract_renderer.rb b/actionpack/lib/action_view/renderer/abstract_renderer.rb
index c0936441ac..5a611e9f63 100644
--- a/actionpack/lib/action_view/renderer/abstract_renderer.rb
+++ b/actionpack/lib/action_view/renderer/abstract_renderer.rb
@@ -22,18 +22,6 @@ module ActionView
details
end
- def extract_format(value, details)
- if value.is_a?(String) && value.sub!(formats_regexp, "")
- ActiveSupport::Deprecation.warn "Passing the format in the template name is deprecated. " \
- "Please pass render with :formats => [:#{$1}] instead.", caller
- details[:formats] ||= [$1.to_sym]
- end
- end
-
- def formats_regexp
- @@formats_regexp ||= /\.(#{Mime::SET.symbols.join('|')})$/
- end
-
def instrument(name, options={})
ActiveSupport::Notifications.instrument("render_#{name}.action_view", options){ yield }
end
diff --git a/actionpack/lib/action_view/renderer/partial_renderer.rb b/actionpack/lib/action_view/renderer/partial_renderer.rb
index 374bdb62f5..e231aade01 100644
--- a/actionpack/lib/action_view/renderer/partial_renderer.rb
+++ b/actionpack/lib/action_view/renderer/partial_renderer.rb
@@ -300,7 +300,6 @@ module ActionView
"and is followed by any combinations of letters, numbers, or underscores.")
end
- extract_format(@path, @details)
self
end
@@ -369,13 +368,7 @@ module ActionView
path = if object.respond_to?(:to_partial_path)
object.to_partial_path
else
- klass = object.class
- if klass.respond_to?(:model_name)
- ActiveSupport::Deprecation.warn "ActiveModel-compatible objects whose classes return a #model_name that responds to #partial_path are deprecated. Please respond to #to_partial_path directly instead."
- klass.model_name.partial_path
- else
- raise ArgumentError.new("'#{object.inspect}' is not an ActiveModel-compatible object that returns a valid partial path.")
- end
+ raise ArgumentError.new("'#{object.inspect}' is not an ActiveModel-compatible object. It must implement :to_partial_path.")
end
@partial_names[path] ||= merge_prefix_into_object_path(@context_prefix, path.dup)
diff --git a/actionpack/lib/action_view/renderer/template_renderer.rb b/actionpack/lib/action_view/renderer/template_renderer.rb
index e131afa279..3e3a44b432 100644
--- a/actionpack/lib/action_view/renderer/template_renderer.rb
+++ b/actionpack/lib/action_view/renderer/template_renderer.rb
@@ -6,7 +6,6 @@ module ActionView
def render(context, options)
@view = context
@details = extract_details(options)
- extract_format(options[:file] || options[:template], @details)
template = determine_template(options)
freeze_formats(template.formats, true)
render_template(template, options[:layout], options[:locals])