Skip to content

Use load hook to extend ActiveRecord#25

Open
thlacroix wants to merge 1 commit intofnando:mainfrom
thlacroix:tl/active-record-load-hook
Open

Use load hook to extend ActiveRecord#25
thlacroix wants to merge 1 commit intofnando:mainfrom
thlacroix:tl/active-record-load-hook

Conversation

@thlacroix
Copy link

PR Checklist

PR Structure

  • This PR has reasonably narrow scope (if not, break it down into smaller
    PRs).
  • This PR avoids mixing refactoring changes with feature changes (split into
    two PRs otherwise).
  • This PR's title starts is concise and descriptive.

Thoroughness

  • This PR adds tests for the most critical parts of the new functionality or
    fixes.
  • I've updated any docs, .md files, etc… affected by this change.

What

Wrapping the ActiveRecord::Base extend call with a ActiveSupport.on_load hook.

Why

https://github.com/fnando/ar-sequence/blob/v0.2.1/lib/ar/sequence.rb#L25 causes ActiveRecord::Base to be loaded too early when the gem is loaded, which breaks some rails configurations on initialization. Cf rails/rails#50133

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

Successfully merging this pull request may close these issues.

1 participant