Module: DataMapper::Model

Defined in:
lib/sinatra/rest/adapters.rb

Instance Method Summary collapse

Instance Method Details

#delete(id) ⇒ Object



20
21
22
23
# File 'lib/sinatra/rest/adapters.rb', line 20

def delete(id)
  model = self.find_by_id(id)
  model.destroy if model
end

#find_by_id(id) ⇒ Object



16
17
18
# File 'lib/sinatra/rest/adapters.rb', line 16

def find_by_id(id)
  get(id)
end