Skip to content

Readme: Serializer Classes Not Automatically Reloaded #111

@dmin

Description

@dmin

Awesome library!

This is only a possible issue with the readme, in the Getting Started section it gives instructions to add the following code to an initializer:

Dir[Rails.root.join('app/serializers/**/*.rb')].each do |path|
  require path
end

If you are using Rails' standard autoloading/reloading features in development the above initializer will prevent rails from reloading your serializer classes after you change them because of the explicit require statements.

Something more along the lines of

config.autoload_paths += ["#{config.root}/app/serializers"]

in config/application.rb should allow for your serializer classes to be automatically reloaded by rails in development. (this assumes that you have a serializer saved as /app/serializers/model_name_serializer.rb, and the corresponding class in that file named ModelNameSerializer)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions