Created
July 10, 2024 18:31
-
-
Save stilist/58da83da45e0ba1c2cdd4970035e3827 to your computer and use it in GitHub Desktop.
Monkeypatch relations into Publify Blog model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/config/initializers/model_extensions.rb b/config/initializers/model_extensions.rb | |
new file mode 100644 | |
index 000000000..2db532ba9 | |
--- /dev/null | |
+++ b/config/initializers/model_extensions.rb | |
@@ -0,0 +1 @@ | |
+require "blog_extension" | |
diff --git a/lib/blog_extension.rb b/lib/blog_extension.rb | |
new file mode 100644 | |
index 000000000..01fbcf5b3 | |
--- /dev/null | |
+++ b/lib/blog_extension.rb | |
@@ -0,0 +1,9 @@ | |
+module BlogExtension | |
+ extend ActiveSupport::Concern | |
+ | |
+ included do | |
+ has_many :xyz | |
+ end | |
+end | |
+ | |
+Blog.include BlogExtension |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment