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

Use Active Support lazy load hooks #232

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

tagliala
Copy link
Member

@tagliala tagliala commented Sep 24, 2023

Extend ActiveRecord::Base functionality only after ActiveRecord has
been fully loaded.

Also:

  • Require Railtie as suggested by APIs
  • Patch DBConsole only if needed
  • Move application configuration check in an after initialize lazy load hook
    to be sure that Rails.application is available at the moment of the check

Ref:

Close #231

Todo:

  • Check what happens at startup, ex: "ChronoModel metadata for action_text_rich_texts"
  • Fix railtie
  • Migration buttons does not work (Rake tasks not supported by 'chronomodel' adapter)

@tagliala tagliala force-pushed the bugfix/231-fix-preload-of-patches branch 2 times, most recently from 3898582 to fd6272d Compare September 24, 2023 11:54
@tagliala tagliala marked this pull request as draft September 26, 2023 08:26
@tagliala tagliala force-pushed the bugfix/231-fix-preload-of-patches branch 5 times, most recently from 928d8a5 to 0237900 Compare October 8, 2023 17:04
@tagliala tagliala marked this pull request as ready for review October 8, 2023 17:07
@tagliala tagliala force-pushed the bugfix/231-fix-preload-of-patches branch from 0237900 to b4f097e Compare October 8, 2023 17:19
@tagliala tagliala changed the title Use active support on load hooks Use active support lazy load hooks Oct 8, 2023
@tagliala tagliala force-pushed the bugfix/231-fix-preload-of-patches branch 6 times, most recently from c4611b7 to 7676fda Compare October 20, 2023 18:35
@tagliala tagliala force-pushed the bugfix/231-fix-preload-of-patches branch from 7676fda to ae1d9b7 Compare November 1, 2023 15:26
@tagliala tagliala marked this pull request as draft November 2, 2023 13:49
@tagliala tagliala force-pushed the bugfix/231-fix-preload-of-patches branch 3 times, most recently from fd546d5 to 78bc0cd Compare November 4, 2023 22:47
Extend `ActiveRecord::Base` functionality only after `ActiveRecord` has
been fully loaded.

Also:
- Require Railtie as suggested by APIs
- Patch DBConsole only if needed
- Move application configuration check in an after initialize lazy load hook
  to be sure that `Rails.application` is available at the moment of the check

Ref:
- thoughtbot/factory_bot_rails#426
- https://edgeapi.rubyonrails.org/classes/Rails/Railtie.html#class-Rails::Railtie-label-Creating+a+Railtie

Close #231
@tagliala tagliala force-pushed the bugfix/231-fix-preload-of-patches branch from 78bc0cd to 869454a Compare November 4, 2023 22:49
@tagliala tagliala changed the title Use active support lazy load hooks Use Active Support lazy load hooks Nov 4, 2023
@tagliala tagliala marked this pull request as ready for review November 4, 2023 22:53
@tagliala tagliala merged commit 88aab73 into master Nov 8, 2023
35 checks passed
@tagliala tagliala deleted the bugfix/231-fix-preload-of-patches branch January 9, 2024 09:29
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.

Chronomodel breaks compatibility with the upcoming FactoryBot Rails 6.3.0
1 participant