module Ki::Model::QueryInterface

the query interface does not respect before/after filters, unique attributes, required attributes or anything of the sort. it writes directly to the database

Public Instance Methods

class_name() click to toggle source
# File lib/ki/modules/query_interface.rb, line 35
def class_name
  to_s
end
count(hash = {}) click to toggle source
# File lib/ki/modules/query_interface.rb, line 10
def count(hash = {})
  Orm::Db.instance.count class_name, hash
end
create(hash) click to toggle source
# File lib/ki/modules/query_interface.rb, line 18
def create(hash)
  Orm::Db.instance.insert class_name, hash
end
delete(hash) click to toggle source
# File lib/ki/modules/query_interface.rb, line 31
def delete(hash)
  Orm::Db.instance.delete class_name, hash
end
find(hash = {}) click to toggle source
# File lib/ki/modules/query_interface.rb, line 14
def find(hash = {})
  Orm::Db.instance.find class_name, hash
end
find_or_create(hash) click to toggle source
# File lib/ki/modules/query_interface.rb, line 22
def find_or_create(hash)
  r = find hash
  r.empty? ? create(hash) : r
end
update(hash) click to toggle source
# File lib/ki/modules/query_interface.rb, line 27
def update(hash)
  Orm::Db.instance.update class_name, hash
end