OK - I don't understand this - and it doesn't seem to help to add self
I have a personnel.rb model.
There is a definition in this model...
x = 1
while doh.to_date + ( 365 * x ) <= Time.now.to_date
x += 1
doh + ( 365.25 * x ).floor
where doh is an actual column (date of hire)
In my view code, this worked...
<%= @personnel.doh_anniversary %>
but now I am putting it into a loop...
<% for personnel in @personnel %>
<%= personnel.doh_anniversary %>
<% end %>
and that gets me an error - undefined method doh.anniversary
and defining it as
x = 1
while self.doh + (365 * x ) <= Time.now.to_date
while doh + ...
still returns the same undefined method error
Any hints on how to make happy method and less madness?