ruby on rails - How to get earliest and latest dates for associated objects -
I am developing a Rail 4 app and I get two models. One is called project and the second is called work .
Many tasks in project . Related to Work Project .
The task object contains start_at and end_at attributes (datetime).
I tried @project to get the first but it does not work (error found). start_at and the latest end_at for all specific tasks? .tasks.max (: starts_at)
Use
max instead of max . Maximum array is for maximum: [1,2]. Maximum == 2
Comments
Post a Comment