class DataMapper::Resource::OrmAdapter

def column_names

get a list of column names for a given class
def column_names
  klass.properties.map(&:name)
end

def create!(attributes = {})

Other tags:
    See: OrmAdapter::Base#create! -
def create!(attributes = {})
  klass.create(attributes)
end

def destroy(object)

Other tags:
    See: OrmAdapter::Base#destroy -
def destroy(object)
  object.destroy if valid_object?(object)
end

def find_all(options = {})

Other tags:
    See: OrmAdapter::Base#find_all -
def find_all(options = {})
  conditions, order, limit, offset = extract_conditions!(options)
  opts = { :conditions => conditions, :order => order_clause(order) }
  opts = opts.merge({ :limit => limit }) unless limit.nil?
  opts = opts.merge({ :offset => offset }) unless offset.nil?
  klass.all opts
end

def find_first(options = {})

Other tags:
    See: OrmAdapter::Base#find_first -
def find_first(options = {})
  conditions, order = extract_conditions!(options)
  klass.first :conditions => conditions, :order => order_clause(order)
end

def get(id)

Other tags:
    See: OrmAdapter::Base#get -
def get(id)
  klass.get(id)
end

def get!(id)

Other tags:
    See: OrmAdapter::Base#get! -
def get!(id)
  klass.get!(id)
end

def order_clause(order)

def order_clause(order)
  order.map {|pair| pair.first.send(pair.last)}
end