Skip to content

Instantly share code, notes, and snippets.

@AJFaraday
Created February 6, 2017 16:03
Show Gist options
  • Save AJFaraday/c819e789d8f15e4d32580d474afbacb3 to your computer and use it in GitHub Desktop.
Save AJFaraday/c819e789d8f15e4d32580d474afbacb3 to your computer and use it in GitHub Desktop.
# Fun fact: Rails relation methods have an argument which doesn't appear to do anything
task = Task.first
task.created_by_user
# a user
task.created_by_user(true)
task.created_by_user('anything here')
task.created_by_user({some: 'irrelevant', attributes: true})
# no errors, user is returned.
task.created_by_user(1,2)
# Wrong number of arguments error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment