Skip to content

Instantly share code, notes, and snippets.

@maccman
Created April 8, 2009 15:47
Show Gist options
  • Select an option

  • Save maccman/91838 to your computer and use it in GitHub Desktop.

Select an option

Save maccman/91838 to your computer and use it in GitHub Desktop.
module ActiveRecord
class Base
private
def attributes_protected_by_default
default = [ self.class.primary_key, self.class.inheritance_column ]
default.concat ['created_at', 'created_on', 'updated_at', 'updated_on']
default << 'id' unless self.class.primary_key.eql? 'id'
default
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment