I am trying to iterate through the versions of my Day model in a view, and want to apply some model methods to it. Here's an example:
<% day.versions.reject!{ |v| v.version == 1 }.each do |d| -> <= d.process_date_this_version > < end %>
I get a "undefined method `process_date_this_version' for #<day::version:0x33b44f0>" error. If I run it against d.day, things run fine, but that's querying the latest revision, which isn't desirable. What would be the preferred way to iterate through the versions, and run models from my Day model on the Day::Version models?
Any help would be appreciated.
Thanks.