method

any?

any?()
public

No documentation available.

# File activerecord/lib/active_record/relation.rb, line 213
    def any?
      if block_given?
        to_a.any? { |*block_args| yield(*block_args) }
      else
        !empty?
      end
    end

1Note

Should include information about optional block

charleschanlee ยท Mar 21, 20161 thank

If a block exists, will return true if any records in the relation is true for the given block. Otherwise, returns true is there are any records.