lucasrenan/publish — pull request #6 by rbrancher (2013-02-15 04:06:52+00:00)
Title: define scopes as lazy

when running in production environment, many times a published resource is reported as draft. trying to debug it is really painful, because within console the same resource is correctly reporting as published. every time we did a deploy, restarting unicorn or passenger, the problem “goes away”, and the resource reports as published.

i couldn't really write tests for it, but i'm quite sure the described problem comes from the scope using the class load date (which, in production, can be many days ago), instead of the scope calling date.

so, to prevent scopes from using class loading date instead of the scope calling date, we must define them as lazy.

makes sense?