Sha256: a2e03f182082d2d4f349faf8d5f67feffc425343336bd5e0a786d8ee412b66a9

Contents?: true

Size: 741 Bytes

Versions: 1

Compression:

Stored size: 741 Bytes

Contents

module Stationed
  module Generators
    module Plugins
      module StrongParameters
        def self.prepended(base)
          base.class_option :strong_parameters,
            type: :boolean,
            default: true,
            desc: 'Be strict about strong parameters in development'
        end

        def finish_template
          returns uper unless options[:strong_parameters]
          environment nil, env: :development do
            <<-RUBY
# Raise an ActionController::UnpermittedParameters exception when
# a parameter is not explcitly permitted but is passed anyway.
config.action_controller.action_on_unpermitted_parameters = :raise
            RUBY
          end
          super
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stationed-0.1.0 lib/stationed/generators/plugins/strong_parameters.rb