lib/roar/rails/json_api.rb in roar-rails-1.0.2 vs lib/roar/rails/json_api.rb in roar-rails-1.1.0
- old
+ new
@@ -1,12 +1,7 @@
require 'roar/json/json_api'
-Roar::JSON::JSONAPI.class_eval do
+# FIXME: Hack. Add another module to Roar JSON API to hook into.
+Roar::JSON::JSONAPI::Document.class_eval do
def to_json_api(*args); to_json(*args); end
- def from_json_api(*args); from_json(*args); end
-end
-
-# allow the same for collections.
-Roar::JSON::JSONAPI::Document::Collection.class_eval do
- def to_json_api(*args); to_json(*args); end
def from_json_api(*args); from_json(*args); end
end