Module: DataMapper::Model

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

Instance Method Summary collapse

Instance Method Details

#delete(id) ⇒ Object



27
28
29
30
# File 'lib/sinatra/rest/adapters.rb', line 27

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

#find_by_id(id) ⇒ Object



23
24
25
# File 'lib/sinatra/rest/adapters.rb', line 23

def find_by_id(id)
  get(id)
end