class DataMapper::Resource::OrmAdapter
def column_names
def column_names klass.properties.map(&:name) end
def create!(attributes = {})
- See: OrmAdapter::Base#create! -
def create!(attributes = {}) klass.create(attributes) end
def destroy(object)
- See: OrmAdapter::Base#destroy -
def destroy(object) object.destroy if valid_object?(object) end
def find_all(options = {})
- 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 = {})
- 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)
- See: OrmAdapter::Base#get -
def get(id) klass.get(id) end
def get!(id)
- 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