Hi There,
Wondering if anyone has thoughts on this. Right now my User has lots of
responsibilities. I want to start to move some of them from a User to a
Profile (where a user has-one Profile). I don’t want to do any big
refactorings, so I want to take small steps so I can commit working code
that I could push to master if necessary every hour or so.
I was trying to get User to delegate :bio, :website, :to =>
:@current_profile
(real situation has a lot more complexity, but that’s the first step).
Trying to figure out best approach to this because of course when
factories (Factory_girl) or my code call a user, they want to call
user.bio and user.bio=, so before they call I have to ensure that I have
an @current_profile.
How does Ruby actually call instance variables? Does it make sense for
me to def a method to overload the getter for the current_profile
instance variable that looks to see if the actual instance variable
exists and if not finds/creates it?
Just trying to find the best way to approach the problem. Any input much
appreciated.
Best Wishes,
Peter