[Rails] Re: Hiding Model Attribute

Matias
Wed, 02 Aug 2006 22:05:29 -0000

I think that you could add something like this to your model class:

def self.password_hash
  return ''''
end

the field would be returned by the sql query anyway, but it woun''t
be "readable" by your code.... just an "on the fly" idea...
hope it helps


Doug Selph escribi?:

> I have a model object for which I would like to effectively hide one
> attribute (a password hash) so that it is never returned by a find_*
> call. I have tried several unsuccessful means. Is there a simple way
> to do this that I am overlooking?
>
> Thanks,
> Doug