Just wanted to follow-up on this thread, even though it was answered in another.
A feature addition to disable SP, somewhat similar to how whitelisting was enabled/disabled in Rails 3 was turned down (who knows- maybe that will be reconsidered at some point, but dhh said no). But for SP, in your tests that use Rails 3.2, you may just be able to have models that and some that don't include ActiveModel::ForbiddenAttributesProtection:
include ::ActiveModel::ForbiddenAttributesProtection
or something that was suggested was to use the appraisal gem:
https://github.com/thoughtbot/appraisalAnd some projects like ActiveAdmin also have their own method to test with different gemsets by including logic in the Gemfile, e.g. in v0.5.0's Gemfile (in
https://github.com/gregbell/active_admin/tree/v0.5.0):
ACTIVE_ADMIN_PATH = File.dirname(__FILE__) unless defined?(ACTIVE_ADMIN_PATH)
require File.expand_path('spec/support/detect_rails_version', ACTIVE_ADMIN_PATH)
rails_version = detect_rails_version
gem 'rails', rails_version
#...
case rails_version
when /^3\.0/
# Do nothing, bundler should figure it out
when /^3\.(1|2)/
# These are the gems you have to have for Rails 3.1 to be happy
gem 'sass-rails'
gem 'uglifier'
else
raise "Rails #{rails_version} is not supported yet"
end