Skip to content

Instantly share code, notes, and snippets.

@MGPalmer
MGPalmer / keybase.md
Created January 19, 2015 09:31
keybase.md

Keybase proof

I hereby claim:

  • I am MGPalmer on github.
  • I am mgpalmer (https://keybase.io/mgpalmer) on keybase.
  • I have a public key whose fingerprint is 9715 2FA2 4660 4059 AE22 14C8 B4CC A13C 85E4 8AAF

To claim this, I am signing this object:

@MGPalmer
MGPalmer / disable_mass_assignment.rb
Created March 13, 2012 09:53
Enforce whitelist mode for mass assignment for Rails < 3.2
# 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.
# (this is a config option in Rails 3.2)
ActiveRecord::Base.send(:attr_accessible, nil)
if %W(development test).include?(Rails.env)
# Raise exception on mass assignment protection for ActiveRecord models
# (this is a config option in Rails 3.2)
source :rubygems
source :rubyforge
source :gemcutter
source 'http://gems.github.com'
## For working on a local fork of the rails repo at the 2.3 branch, use this:
#repo = '/home/mt/Development/traveliq/rails'
#gem 'rails', :path => "#{repo}/railties"
#gem 'actionmailer', :path => "#{repo}/actionmailer"
#gem 'actionpack', :path => "#{repo}/actionpack"