Sha256: 14cd03e2625850dda5237625b5c371e941ca2df12e87137c0ef40ab62e8f52da

Contents?: true

Size: 745 Bytes

Versions: 5

Compression:

Stored size: 745 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

5 entries across 5 versions & 1 rubygems

Version Path
stationed-0.6.0 lib/stationed/generators/plugins/strong_parameters.rb
stationed-0.5.0 lib/stationed/generators/plugins/strong_parameters.rb
stationed-0.4.0 lib/stationed/generators/plugins/strong_parameters.rb
stationed-0.3.0 lib/stationed/generators/plugins/strong_parameters.rb
stationed-0.2.0 lib/stationed/generators/plugins/strong_parameters.rb