I think you could probably use a UserPresenter presenter class that
accepts a user and wraps all the readers with a method that obfuscates
the data in the display. That way, you're not cluttering up your model
with logic that only relates to the view, and you can also use some
metaprogramming within the presenter to iterate through each of the
user attributes and present it obfuscated.

On Fri, Dec 9, 2011 at 1:02 AM, Scott Olmsted <[email protected]> wrote:
> My client had me build a demo site just like the medical app I've
> created. The demo site has real patient data, but fake patient names
> and other identifying information.
>
> The demo site is a pain to maintain for several reasons I need not go
> into here (mainly because it must keep importing current data). If on
> the production site the client could flip a switch and scramble or
> otherwise obfuscate the patient fields, I think that might suffice. It
> would be easy to write the code to, say, scramble the letters, but how
> to conveniently apply it before displaying the fields?
>
> I could rename the patient fields and add model methods with the
> original names that scramble or replace the field contents when
> needed, or just pass them through otherwise. Straightforward, but a
> bit of work.
>
> Is there an easier way to do this? All patient data fields are already
> encrypted with the 'attr_encrypted' gem (https://github.com/shuber/
> attr_encrypted), but that operates pretty transparently; in code the
> fields are just named 'first', 'last', etc.
>
> Thanks,
>
> Scott Olmsted
>
> --
> SD Ruby mailing list
> [email protected]
> http://groups.google.com/group/sdruby

-- 
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby

Reply via email to