Friday, 15 March 2013

Does Heroku automatically cache Rails controller actions by default? -


I began to ditch seriously, I have a rail application that stores blog posts in a paragraph model. On the index page model Says a scope and gives the latest articles. However, when I load the page, only a few articles are shown, but when I copy the code into the hierokoc, it shows in the results showing those missing articles.

Here is an index action:

  DIF index = article = article. Feature_published_action.image ("date_time DESC"). The page is here:  
  scope: featured_published_articles, where ("attributes =? And in the situation (?) And date_time & lt; = ??, true, ['published', 'publish-pending'], date time.)   

This method works properly when I tell it to the console But when I load the page, all the results are not displayed any ideas?

This is not heroku specific, but it is accumulating the scope "DateTime.now" when it Has been originally interpreted earlier, datetime. Now when you push your lock, "no" now

You want to use a lambda instead here

  scope: featured_published_articles, - & gt; {Where ("attributes =? And in the situation (?) And date_time   < P> In Rail 4, this will not be a problem (this will give you a load error), but in Rail 3 it will load and cause problems that you see.   

No comments:

Post a Comment