ruby - Rails - data displayed only after controller is re-saved -
i experiencing weird behavior of rails application.
i have downloaded repo github, , initiated development database. when create event (thats purpose of app), @ right after press 'create' , browser goes to, 'events/1'.
however if navigate main page, of events supposed listed, event not displayed, until re-save controller file (i don't have make changes in it). page reloads not help.
i should mention on previous machine worked fine.
here part of controller:
class eventscontroller < applicationcontroller def index @events_future = event.future_events end
the scope
scope :future_events, order('start_date asc').where('start_date >= ?', date.today)
again, on same mac before had reformatted code worked perfect, don't think coding (well, hope). be? thanks.
thank lawitschka above
defining scope won't work in production mode, since model cached, scope evaluated on load time , date.today cached, well, until restart application. wrap order(...) part in lambda. guess that's causing problems in current setup.
Comments
Post a Comment