lib/phlex/rails/sgml/overrides.rb in phlex-rails-0.8.1 vs lib/phlex/rails/sgml/overrides.rb in phlex-rails-0.9.0

- old
+ new

@@ -10,15 +10,19 @@ else @_view_context end end - def render(renderable = nil, *args, **kwargs, &block) - return super if renderable.is_a?(Phlex::SGML) - return super if renderable.is_a?(Class) && renderable < Phlex::SGML + def render(*args, **kwargs, &block) + renderable = args[0] - if renderable - @_context.target << @_view_context.render(renderable, *args, **kwargs, &block) + case renderable + when Phlex::SGML, Proc + return super + when Class + return super if renderable < Phlex::SGML + when Enumerable + return super unless renderable.is_a?(ActiveRecord::Relation) else @_context.target << @_view_context.render(*args, **kwargs, &block) end nil