diff options
author | Azul <azul@leap.se> | 2013-01-25 11:46:22 +0100 |
---|---|---|
committer | Azul <azul@leap.se> | 2013-01-25 11:46:22 +0100 |
commit | dac578781baf73a006cc78e29588dd1f6fdc0fd3 (patch) | |
tree | a56ecff398a87efdd4840a8fc897d6471fbdaa69 /core | |
parent | 75442ad26f3d30519f747bc98bc83cdc76aff750 (diff) | |
parent | 9d053b6c9b61c68bf11f95bcb37631a518f1fba4 (diff) |
Merge branch 'feature/webfinger' of https://github.com/leapcode/leap_web
Conflicts:
users/app/views/users/edit.html.haml
Diffstat (limited to 'core')
-rw-r--r-- | core/lib/extensions/couchrest.rb | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/core/lib/extensions/couchrest.rb b/core/lib/extensions/couchrest.rb index 5938df4..ca4b608 100644 --- a/core/lib/extensions/couchrest.rb +++ b/core/lib/extensions/couchrest.rb @@ -1,23 +1,32 @@ -module CouchRest::Model::Designs +module CouchRest + module Model::Designs - class View + class View - # so we can called Ticket.method.descending or Ticket.method.ascending - def ascending - self + # so we can called Ticket.method.descending or Ticket.method.ascending + def ascending + self + end end - end - class DesignMapper - def load_views(dir) - Dir.glob("#{dir}/*.js") do |js| - name = File.basename(js, '.js') - file = File.open(js, 'r') - view name.to_sym, - :map => file.read, - :reduce => "function(key, values, rereduce) { return sum(values); }" + class DesignMapper + def load_views(dir) + Dir.glob("#{dir}/*.js") do |js| + name = File.basename(js, '.js') + file = File.open(js, 'r') + view name.to_sym, + :map => file.read, + :reduce => "function(key, values, rereduce) { return sum(values); }" + end end end + end + class ModelRailtie + config.action_dispatch.rescue_responses.merge!( + 'CouchRest::Model::DocumentNotFound' => :not_found, + 'RestClient::ResourceNotFound' => :not_found + ) + end end |