Module: Cased::Rails::Config

Defined in:
lib/cased/rails/config.rb

Instance Method Summary collapse

Instance Method Details

#filter_parameters=(new_filter_parameters) ⇒ Object



21
22
23
# File 'lib/cased/rails/config.rb', line 21

def filter_parameters=(new_filter_parameters)
  @filter_parameters = new_filter_parameters
end

#filter_parameters?Boolean

Returns:

  • (Boolean)


25
26
27
28
29
30
31
32
33
# File 'lib/cased/rails/config.rb', line 25

def filter_parameters?
  return @filter_parameters if defined?(@filter_parameters)

  @filter_parameters = if ENV['CASED_FILTER_PARAMETERS']
    parse_bool(ENV['CASED_FILTER_PARAMETERS'])
  else
    ::Rails.env.staging? || ::Rails.env.production?
  end
end

#unfiltered_parametersObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/cased/rails/config.rb', line 10

def unfiltered_parameters
  @unfiltered_parameters ||= [
    # Database record ID's
    'id',
    # Controller actions
    'action',
    # Controller names
    'controller',
  ].freeze
end

#unfiltered_parameters=(new_unfiltered_parameters) ⇒ Object



6
7
8
# File 'lib/cased/rails/config.rb', line 6

def unfiltered_parameters=(new_unfiltered_parameters)
  @unfiltered_parameters = Array.wrap(new_unfiltered_parameters)
end