Skip to content

Instantly share code, notes, and snippets.

@nateberkopec
Created January 11, 2019 14:31
Show Gist options
  • Save nateberkopec/c073fbcd560d9fe1b04d476cb538d267 to your computer and use it in GitHub Desktop.
Save nateberkopec/c073fbcd560d9fe1b04d476cb538d267 to your computer and use it in GitHub Desktop.
present test
ActiveRecord::Base.logger = Logger.new(STDOUT)
MODEL = User # enter a model that exists in your app here
users = MODEL.all
puts "users.present?"
users.present?
users = nil
users = MODEL.all
puts "users.empty?"
users.empty?
users = nil
users = MODEL.all
puts "users.any?"
users.any?
users = nil
users = MODEL.all
puts "users.none?"
users.none?
users = nil
users = MODEL.all
puts "users.blank?"
users.blank?
users = nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment