Module: RailsNoDatabaseInView::ControllerInstanceMethods

Defined in:
lib/rails_no_database_in_view/controller_instance_methods.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/rails_no_database_in_view/controller_instance_methods.rb', line 4

def self.included base
  base.instance_eval do
    unless respond_to? :render_without_database_disconnected_for_rendering
      alias_method :render_without_database_disconnected_for_rendering, :render
      alias_method :render, :render_with_database_disconnected_for_rendering
    end
  end
end

Instance Method Details

#render_with_database_disconnected_for_rendering(*args) ⇒ Object



13
14
15
16
17
# File 'lib/rails_no_database_in_view/controller_instance_methods.rb', line 13

def render_with_database_disconnected_for_rendering *args
  with_database_disconnected_for_rendering do
    render_without_database_disconnected_for_rendering *args
  end
end