On Friday, February 10, 2017 at 1:25:37 PM UTC+1, Colin Law wrote:
>
> On 10 February 2017 at 12:16, 'krfg' via Ruby on Rails: Talk
> <[email protected] <javascript:>> wrote:
> >
> > Ok, thanks for the suggestion.
> > I will try to use tail if it works with such a heavy file, otherwise I
> would
> > need instructions on how to empty the file.
> > The most important thing I have to understand is: where should I place
> > logger.info?
> > In static_pages_controller.rb before the declaration of @atp_tournaments
> > variable?
>
> The purpose of inserting the line is firstly to check that the above
> line is being reached, but secondly to check the value of the
> variable. To check the value of the variable you must put it after the
> line determining @atp_tournaments.
>
> Colin
As you suggested I inserted logger.info immediately after the declaration
of @atp_tournaments in static_pages_controller.rb:
def home
if logged_in? && !current_user.gamer?
...
elsif logged_in? && current_user.gamer?
...
@week_num = Time.now.strftime("%W").to_i
@atp_tournaments = AtpCalendar.where("week @> ?",
"{#{@week_num}}")
logger.info("atp tournaments count = #{@atp_tournaments.count}")
@wta_tournaments = WtaCalendar.where("week @> ?",
"{#{@week_num}}")
end
end
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/95c53e4d-4f1c-4af9-b285-a6f9f42c5f34%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.