Jeremy Baker
2012-Sep-30 22:06 UTC
Protecting certain model attributes from being exposed in an API
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/16064/protecting-certain-model-attributes-from-being-exposed-in-an-api Your thoughts are much appreciated. Thanks in advance. Jeremy -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/SgLzY2BcotAJ. For more options, visit https://groups.google.com/groups/opt_out.