Commit c2b7fa402bc06f57a6d99bdc534e8f43c1071214
- Date: Thu Feb 14 01:19:44 +0000 2008
- Committer: Michael Koziarski (michael@koziarski.com)
- Author: Michael Koziarski (michael@koziarski.com)
- Commit SHA1: c2b7fa402bc06f57a6d99bdc534e8f43c1071214
- Tree SHA1: 073fd01e3edd5b62c46ae4606e2a78d3aaf98e99
remove the methods and override accepts
Commit diff
| |   |
| 1 | 1 | # Unaccept |
| 2 | 2 | module Unaccept |
| 3 | 3 | module RequestOverrides |
| 4 | def self.included(base) |
| 5 | base.send :remove_method, :format |
| 6 | base.send :remove_method, :accepts |
| 7 | end |
| 8 | |
| 4 | 9 | def format |
| 5 | 10 | @format ||= Mime::Type.lookup_by_extension(parameters[:format] || 'html') |
| 6 | 11 | end |
| 12 | |
| 13 | def accepts |
| 14 | [format] |
| 15 | end |
| 7 | 16 | end |
| 8 | 17 | end |
| toggle raw diff |
--- a/lib/unaccept.rb
+++ b/lib/unaccept.rb
@@ -1,8 +1,17 @@
# Unaccept
module Unaccept
module RequestOverrides
+ def self.included(base)
+ base.send :remove_method, :format
+ base.send :remove_method, :accepts
+ end
+
def format
@format ||= Mime::Type.lookup_by_extension(parameters[:format] || 'html')
end
+
+ def accepts
+ [format]
+ end
end
end
\ No newline at end of file |