Class: ActiveHashAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/active_repository/adapters/active_hash_adapter.rb

Class Method Summary collapse

Class Method Details

.all(klass) ⇒ Object



3
4
5
# File 'lib/active_repository/adapters/active_hash_adapter.rb', line 3

def all(klass)
  klass.superclass.superclass.all
end

.delete_allObject



7
8
9
# File 'lib/active_repository/adapters/active_hash_adapter.rb', line 7

def delete_all
  @klass.superclass.delete_all
end

.exists?(id) ⇒ Boolean

Returns:



11
12
13
# File 'lib/active_repository/adapters/active_hash_adapter.rb', line 11

def exists?(id)
  @klass.find_by_id(id).present?
end

.where(*args) ⇒ Object



15
16
17
18
# File 'lib/active_repository/adapters/active_hash_adapter.rb', line 15

def where(*args)
  query = ActiveHash::SQLQueryExecutor.args_to_query(args)
  @klass.where(query)
end