Ruby on Rails Sunday, September 30, 2012

In my current project, there are business and security requirements that prevent certain values from being exposed. I was looking for a way to specify which attributes in a model should be protected. This is what I've come up with and I would love feedback as to whether or not it's a valid solution and how I could improve it.

Basically, I'm following the attr_accessible style and defining an attr_private method for setting specific attributes (or methods) as private.

Your thoughts are much appreciated. Thanks in advance.


You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
To unsubscribe from this group, send email to
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment