def exists?(conditions = :none)
      if Base === conditions
        raise ArgumentError, <<-MSG.squish
          You are passing an instance of ActiveRecord::Base to `exists?`.
          Please pass the id of the object by calling `.id`.
        MSG
      end

      return false if !conditions || limit_value == 0

      if eager_loading?
        relation = apply_join_dependency(eager_loading: false)
        return relation.exists?(conditions)
      end

      relation = construct_relation_for_exists(conditions)

      skip_query_cache_if_necessary { connection.select_one(relation.arel, "#{name} Exists?") } ? true : false
    end
def exists?(conditions = :none)
      if Base === conditions
        raise ArgumentError, <<-MSG.squish
          You are passing an instance of ActiveRecord::Base to `exists?`.
          Please pass the id of the object by calling `.id`.
        MSG
      end

      return false if !conditions || limit_value == 0

      if eager_loading?
        relation = apply_join_dependency(eager_loading: false)
        return relation.exists?(conditions)
      end

      relation = construct_relation_for_exists(conditions)

      skip_query_cache_if_necessary { connection.select_one(relation.arel, "#{name} Exists?") } ? true : false
    end
Returns true if a record exists in the table that matches the +id+ or
 conditions given, or false otherwise. The argument can take six forms:

 * Integer - Finds the record with this primary key.
 * String - Finds the record with a primary key corresponding to this
   string (such as <tt>'5'</tt>).
 * Array - Finds the record that matches these +find+-style conditions
   (such as <tt>['name LIKE ?', "%#{query}%"]</tt>).
 * Hash - Finds the record that matches these +find+-style conditions
   (such as <tt>{name: 'David'}</tt>).
 * +false+ - Returns always +false+.
 * No args - Returns +false+ if the relation is empty, +true+ otherwise.

 For more information about specifying conditions as a hash or array,
 see the Conditions section in the introduction to ActiveRecord::Base.

 Note: You can't pass in a condition as a string (like <tt>name =
 'Jamie'</tt>), since it would be sanitized and then queried against
 the primary key column, like <tt>id = 'name = \'Jamie\''</tt>.

   Person.exists?(5)
   Person.exists?('5')
   Person.exists?(['name LIKE ?', "%#{query}%"])
   Person.exists?(id: [1, 4, 8])
   Person.exists?(name: 'David')
   Person.exists?(false)
   Person.exists?
   Person.where(name: 'Spartacus', rating: 4).exists?