mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 14:29:31 +00:00
* Many nested levels of associations can now insert their information alongside the original when embed :ids, :include => true is true * Add support for passing options to serializers * Fix Array serializers so they don't try to insert roots for each child object and so they can be provided a root. * TODO: Array serializers should require a root * TODO: Make merging associations at the root more efficient if possible
25 lines
470 B
Ruby
25 lines
470 B
Ruby
require "rubygems"
|
|
require "bundler/setup"
|
|
|
|
require "active_model_serializers"
|
|
require "active_support/json"
|
|
require "test/unit"
|
|
|
|
require 'rails'
|
|
|
|
module TestHelper
|
|
Routes = ActionDispatch::Routing::RouteSet.new
|
|
Routes.draw do
|
|
match ':controller(/:action(/:id))'
|
|
match ':controller(/:action)'
|
|
end
|
|
|
|
ActionController::Base.send :include, Routes.url_helpers
|
|
end
|
|
|
|
ActiveSupport::TestCase.class_eval do
|
|
setup do
|
|
@routes = ::TestHelper::Routes
|
|
end
|
|
end
|