RailsCasts Pro episodes are now free!

Learn more or hide this

sjf-control's Profile

GitHub User: sjf-control

Comments by

Avatar

Did you ever figure out how to use the hooks? I'm trying to figure it out, too.

It appears you need to use a "Custom Job", but I am unable to get the custom job to execute. I see the call to enqueue, I see the record inserted into delayed_jobs table. Then I see the job being locked, and the job being deleted from the table. No other hooks are called, nor is my process.

Avatar

This doesn't seem to work if you are already redefining the logger.
I use the following in the configuration file in order to cycle log files...

ruby
  require 'active_support/core_ext/numeric/bytes'
  config.logger = Logger.new(config.paths['log'].first, 2, 5.megabytes)
  config.logger.level = Logger::DEBUG

Either of the following two lines will cause errors, the first on webrick startup the second on the first call to the logger

ruby
  config.logger.log_tags = [:remote_ip, lambda { |req| Time.now}]
  config.log_tags = [:remote_ip, lambda { |req| Time.now}]

Seems the 'log_tags' method isn't defined

Avatar

The default is to run all tasks in "production' mode. How would you make it run in the default environment?

Avatar

Can somebody give an example of how to use type :date? Is there a way to format the display? I'd like to pick the day/month/year without any time elements. When I use

<%= best_in_place @class_time, :completion_date, type: :date %>

the field is not editable