0

By default, the gem active_model_serializer (from rubygems, the version 0.8.1) looks for the serializers in app/serializers.

However, I have a shared directory at the root of Rails project sharing models, serializers, specs with other projects as a git subtree.

How to specify to active_model_serializer to looks for files in app/serializers and shared/serializers ?

Thanks.

yutu
  • 109
  • 1
  • 5

1 Answers1

0

I finally found how to do ... simply by loading the path shared/serializers in my application.rb by this way:

module MyRailsApp
  class Application < Rails::Application
   ...
    config.eager_load_paths << Rails.root.join('shared/serializers').to_s
  end
end
yutu
  • 109
  • 1
  • 5