Class: Sqreen::Frameworks::Rails3Framework

Inherits:
RailsFramework show all
Defined in:
lib/sqreen/frameworks/rails3.rb

Overview

Handle Rails 3 specifics

Constant Summary

Constants inherited from RailsFramework

Sqreen::Frameworks::RailsFramework::DB_MAPPING, Sqreen::Frameworks::RailsFramework::P_OTHER

Constants inherited from GenericFramework

GenericFramework::LOCALHOST, GenericFramework::PREFERRED_IP_HEADERS, GenericFramework::P_COOKIE, GenericFramework::P_FORM, GenericFramework::P_GRAPE, GenericFramework::P_QUERY, GenericFramework::P_RACK, GenericFramework::P_RACK_ROUTING, GenericFramework::TRUSTED_PROXIES

Instance Attribute Summary

Attributes inherited from GenericFramework

#req_end_cb, #req_start_cb, #sqreen_configuration

Instance Method Summary collapse

Methods inherited from RailsFramework

#application_name, #db_settings, #development?, #framework_infos, #initialize, #ip_headers, parameters_from_request, #rails_client_ip, #rails_params, rails_params, #request_id

Methods inherited from GenericFramework

#application_name, #body, #clean_request, #client_ip, #client_user_agent, cookies_params, #cwd, #datadog_span, #datadog_trace, #db_settings, #development?, #filtered_request_params, form_params, #framework_infos, #full_params_include?, #graphql_args=, #header, #hostname, #http_headers, #initialize, #ip_headers, #mark_request_overtime!, parameters_from_request, #params_include?, query_params, #rack_client_ip, rack_params, #remaining_perf_budget, #remaining_perf_budget=, #remote_addr, #request, #request_id, #request_infos, #request_params, #request_path, #response, #response_infos, #store_request, #store_response, #test?, #whitelisted_ip, #whitelisted_match, #whitelisted_path, #xss_params

Methods included from RequestRecorder

#clean_request_record, #close_request_record, #observe, #observed_items, #observed_items=, #only_metric_observation, #only_metric_observation=, #payload_requests, #payload_requests=

Constructor Details

This class inherits a constructor from Sqreen::Frameworks::RailsFramework

Instance Method Details

#instrument_when_ready!(instrumentor, rules) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/sqreen/frameworks/rails3.rb', line 23

def instrument_when_ready!(instrumentor, rules)
  config = Rails.configuration
  if config.cache_classes
    instrumentor.instrument!(rules, self)
  else
    # FIXME: What needs to be done if no active_record?
    # (probably related to SQREEN-219)
    frm = self
    ActiveSupport.on_load(:active_record) do
      instrumentor.instrument!(rules, frm)
    end
  end
end

#prevent_startupObject



16
17
18
19
20
21
# File 'lib/sqreen/frameworks/rails3.rb', line 16

def prevent_startup
  res = super
  return res if res
  return :rails_console if defined?(Rails::Console)
  nil
end

#rootObject



12
13
14
# File 'lib/sqreen/frameworks/rails3.rb', line 12

def root
  Rails.root
end