Forum: Ruby on Rails Protecting certain model attributes from being exposed in an API

Posted by Jeremy Baker (Guest)
on 2012-10-01 14:28
(Received via mailing list)
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.

http://codereview.stackexchange.com/questions/1606...

Your thoughts are much appreciated. Thanks in advance.

Jeremy
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.