Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with autoload changed file #2416

Open
abratashov opened this issue Mar 15, 2021 · 0 comments
Open

Issue with autoload changed file #2416

abratashov opened this issue Mar 15, 2021 · 0 comments

Comments

@abratashov
Copy link

Expected behavior vs actual behavior

After changing model/library methods should serializer reloads all changes.

Steps to reproduce

When I define and change model method:

# app/models/document.rb

class Document < ApplicationRecord
  def url
    # ...
  end
end

it doesn't autoload in the serializer:

class DocumentSerializer < ActiveModel::Serializer
  attributes :url
end

After request on API it returns the previous version of url, as a result I need to restart Rails server to get changes.

#config/initializers/serializer.rb
ActiveModelSerializers.config.adapter = :json_api

Environment

ActiveModelSerializers Version (commit ref if not on tag):
active_model_serializers (0.10.12)

Output of ruby -e "puts RUBY_DESCRIPTION": ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]

OS Type & Version: Ubuntu 20.04

Integrated application and version (e.g., Rails, Grape, etc): rails (6.1.0) but also (6.1.3)

Other

Also created question
https://stackoverflow.com/questions/66496188/problem-with-active-model-serializer-auto-reloading-after-changed-files-in-rails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant