module CanonicalRails

Constants

Deprecation
VERSION

Public Class Methods

setup() { |self| ... } click to toggle source

Default way to setup CanonicalRails. Run `rails g canonical_rails:install` to create a fresh initializer with all configuration values.

the configsetup concept politely observed at and borrowed from Devise: github.com/plataformatec/devise/blob/master/lib/devise.rb

# File lib/canonical-rails.rb, line 11
def self.setup
  yield self
end
sym_allowed_parameters() click to toggle source
# File lib/canonical-rails.rb, line 41
def self.sym_allowed_parameters
  @@sym_allowed_parameters ||= if self.whitelisted_parameters.empty?
    self.allowed_parameters.map(&:to_sym)
  else
    CanonicalRails::Deprecation.warn('config.whitelisted_parameters is deprecated, please use config.allowed_parameters instead.')
    self.whitelisted_parameters.map(&:to_sym)
  end
end
sym_collection_actions() click to toggle source
# File lib/canonical-rails.rb, line 37
def self.sym_collection_actions
  @@sym_collection_actions ||= self.collection_actions.map(&:to_sym)
end