Sha256: 4afee423ee9c274edab592c5a535f4ab63fc5bdb6049212f5fa50316f3061b4f

Contents?: true

Size: 362 Bytes

Versions: 7

Compression:

Stored size: 362 Bytes

Contents

class ActiveHashAdapter
  class << self
    def all(klass)
      klass.superclass.superclass.all
    end

    def delete_all
      @klass.superclass.delete_all
    end

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

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
active_repository-0.2.7 lib/active_repository/adapters/active_hash_adapter.rb
active_repository-0.2.6 lib/active_repository/adapters/active_hash_adapter.rb
active_repository-0.2.5 lib/active_repository/adapters/active_hash_adapter.rb
active_repository-0.2.4 lib/active_repository/adapters/active_hash_adapter.rb
active_repository-0.2.3 lib/active_repository/adapters/active_hash_adapter.rb
active_repository-0.2.2 lib/active_repository/adapters/active_hash_adapter.rb
active_repository-0.2.1 lib/active_repository/adapters/active_hash_adapter.rb