Permalink
Browse files

Remove all references to attr_accessible/protected and old mass_assig…

…nment_sanitizers
  • Loading branch information...
guilleiguaran committed Jul 19, 2012
1 parent 52aa534 commit d695fdbd1181a002595ae2d80e2ee6955801b602
@@ -46,11 +46,6 @@ class Application < Rails::Application
# like if you have constraints or database-specific column types.
# config.active_record.schema_format = :sql
- # Enforce whitelist mode for mass assignment.
- # This will create an empty whitelist of attributes available for mass-assignment for all models
- # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
- # parameters by using an attr_accessible or attr_protected declaration.
- <%= comment_if :skip_active_record %>config.active_record.whitelist_attributes = true
<% unless options.skip_sprockets? -%>
# Enable the asset pipeline.
@@ -23,9 +23,6 @@
config.action_dispatch.best_standards_support = :builtin
<%- unless options.skip_active_record? -%>
- # Raise exception on mass assignment protection for Active Record models.
- config.active_record.mass_assignment_sanitizer = :strict
-
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL).
config.active_record.auto_explain_threshold_in_seconds = 0.5
@@ -31,11 +31,6 @@
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
- <%- unless options.skip_active_record? -%>
- # Raise exception on mass assignment protection for Active Record models.
- config.active_record.mass_assignment_sanitizer = :strict
- <%- end -%>
-
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
@@ -20,7 +20,6 @@ def app
app_file "app/models/post.rb", <<-MODEL
class Post < ActiveRecord::Base
validates_acceptance_of :title, :accept => "omg"
- attr_accessible :title
end
MODEL
@@ -343,15 +343,6 @@ def test_new_hash_style
end
end
- def test_generated_environments_file_for_sanitizer
- run_generator [destination_root, "--skip-active-record"]
- %w(development test).each do |env|
- assert_file "config/environments/#{env}.rb" do |file|
- assert_no_match(/config.active_record.mass_assignment_sanitizer = :strict/, file)
- end
- end
- end
-
def test_generated_environments_file_for_auto_explain
run_generator [destination_root, "--skip-active-record"]
%w(development production).each do |env|
@@ -328,14 +328,4 @@ def test_index_is_skipped_for_references_association
end
end
end
-
- def test_attr_accessible_added_with_non_reference_attributes
- run_generator
- assert_file 'app/models/account.rb', /attr_accessible :age, :name/
- end
-
- def test_attr_accessible_added_with_comments_when_no_attributes_present
- run_generator ["Account"]
- assert_file 'app/models/account.rb', /# attr_accessible :title, :body/
- end
end

0 comments on commit d695fdb

Please sign in to comment.