Skip to content

Autoload autoloaded ActiveModel constants #3

Open

Description

@bensheldon

Nice library! In reviewing it, I noticed that you require ActiveModel constants that are autoloaded by Rails. This will slow down an application's development boot because it's loading more files than necessary.

Instead, you could structure this project like a Rails Engine and move hyper_active_form/base.rb into app/ in your gem, which will result in it being automatically autoloaded.

Happy to chat more or help.

Activity

  1. Intrepidd commented on Oct 28, 2025

    @Intrepidd
    Owner

    Thanks a lot, I'll try it out !

    If I understand correctly, the only step is to move lib/hyper_active_form/base.rb into app/hyper_active_form/base.rb ? Or is there more to do like explicitely define a Rails Engine ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions