Class: Peck::Rails::Controller

Inherits:
Object
  • Object
show all
Defined in:
lib/peck_on_rails/controller.rb

Defined Under Namespace

Modules: Fixtures, Helpers Classes: Body, LazyValue, Status

Class Method Summary collapse

Class Method Details

.init(context, context_type, subject) ⇒ Object


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/peck_on_rails/controller.rb', line 4

def self.init(context, context_type, subject)
  if context_type == :controller
    Peck.log("Peck::Rails::Controller.init")
    context.class_eval do
      attr_accessor :controller

      before do
        @routes = ::Rails.application.routes
      end

      def self.determine_default_controller_class(name)
        self._controller_class = Peck::Rails.subject(self)
      end

      Peck::Rails.silence do
        include ::ActionController::TestCase::Behavior
      end
      include ::Peck::Rails::Controller::Helpers
      extend ::Peck::Rails::Controller::Fixtures
    end
  end
end