Skip to content

Instantly share code, notes, and snippets.

@kirkelifson
Created November 6, 2015 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirkelifson/313867b8bd9ec9d7a047 to your computer and use it in GitHub Desktop.
Save kirkelifson/313867b8bd9ec9d7a047 to your computer and use it in GitHub Desktop.
rails: all_nil? -- returns true if list of object attributes are nil
def all_nil?(object, *options)
options.map { |item| object.send(item) }.compact.empty?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment