public
Description: Rails Plugin - specify attributes within a model that can be set but not modified
Homepage: http://6brand.com
Clone URL: git://github.com/JackDanger/immutable_attributes.git
Search Repo:
Jack Danger Canty (author)
Thu Mar 27 13:09:59 -0700 2008
commit  611798732ebd560ac6c759976e9eff00dee4f168
tree    1b9b7144dfcdf026b91f65183d1d348a850b65a4
parent  75c1e4a3bd82f5a7286b9e5fdfb6e5f4a2829834
name age message
folder README Fri Aug 03 17:11:14 -0700 2007 legal stuff [studioda]
folder Rakefile Fri Aug 03 16:38:33 -0700 2007 A tiny plugin that allows you to set several at... [studioda]
folder init.rb Fri Aug 03 16:38:33 -0700 2007 A tiny plugin that allows you to set several at... [studioda]
folder install.rb Fri Aug 03 16:47:42 -0700 2007 better readme [studioda]
folder lib/ Fri Aug 03 16:38:33 -0700 2007 A tiny plugin that allows you to set several at... [studioda]
folder rails/ Thu Mar 27 13:09:59 -0700 2008 Configuring for Rails GemLocator [Jack Danger Canty]
folder tasks/ Fri Aug 03 16:38:33 -0700 2007 A tiny plugin that allows you to set several at... [studioda]
folder test/ Fri Aug 03 16:38:33 -0700 2007 A tiny plugin that allows you to set several at... [studioda]
folder uninstall.rb Fri Aug 03 16:38:33 -0700 2007 A tiny plugin that allows you to set several at... [studioda]
README

ImmutableAttributes
===================

When you want to prevent certain attributes from being changed once set you can declare them as immutable:

class MyModel < ActiveRecord::Base
  attr_immutable :permalink, :param_identifier
end

When MyModel.find(:first).permalink = 'anything' is called it will raise an ImmutableAttributeError
MyModel.new.permalink = 'works!' will properly set the value because the record is unsaved.

Created by Jack Danger Canty @ http://6brand.com
Released under the same licence as Rails (MIT)