Skip to content

Instantly share code, notes, and snippets.

@jonhoman
Created December 31, 2010 20:34
Show Gist options
  • Save jonhoman/761317 to your computer and use it in GitHub Desktop.
Save jonhoman/761317 to your computer and use it in GitHub Desktop.
Why is to_s needed?
puts build_date
# Sun Dec 19 10:35:26 -0600 2010
puts build_date.class
# Time
# This works
feed.update_attributes!(:name => name, :last_build_date => build_date.to_s)
# This fails with wrong number of arguments (1 for 0)
feed.update_attributes!(:name => name, :last_build_date => build_date)
@redsquirrel
Copy link

Can you provide the entire stacktrace of the failure?

@jonhoman
Copy link
Author

Not much in the stacktrace:

  1. FeedWorker stores the name of the feed
    Failure/Error: FeedWorker.perform(feed.id)
    wrong number of arguments (1 for 0)

    ./app/workers/feed_worker.rb:21:in `perform'

    ./spec/workers/feed_worker_spec.rb:7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment