hi
i have a Project & Task model.
########
Project model has that additional method:
def self.lasttask(project, sort=“DESC”)
Task.find(:first, :conditions=>['project_id = ? ',
project.id], :order => “somedate #{sort}” )
end
########
The Task model has one attribute called “specialtask” which is
boolean.
bewteen
Now, i can do this in the console:
p=Project.find(1)
Project.lasttask§.specialtask
TRUE or FALSE
meaning its working. But doing it in the view it throws me an error
telling me specialtask is unknown.
<%= debug Project.lasttask§.specialtask %>
//the debug shows cleary the attribute.
so, where is my error here? any pointers are welcome.
sidenote: i know i could do this wich “nromal” associations too, but
im in the process of learning the innnerworkings of ruby classes (self
or not self)
thx