I'd like your feedback on a patch I submitted. I've included an
excerpt from it below.
[PATCH] attr_private for hiding a database column, improves
This is a patch on ActiveRecord that creates 'attr_private'.
attr_private provides a way to make one or more database columns
appear to be private. This allows AR models to be better encapsulated,
meaning that they can hide their implementation details.
class NegotiatingAgent < ActiveRecord::Base
r = NegotiatingAgent.new
r.min_acceptable_price # => NoMethodError
r.min_acceptable_price = 350 # => NoMethodError
r[:min_acceptable_price] # => PrivateAttributeError
r[:min_acceptable_price] = 250 # => PrivateAttributeError
r.attributes # will not include :min_acceptable_price
More information on the motivating reasons (and other workarounds I
tried first) can be found in Trac:
P.S. I'm at RailsConf, please say hi if you see me.