Comments (3)
I'm sorry but this will not be supported, and even if it somehow starts working, it's not recommended. ActiveRecord is known for its bloated API, using DI and injecting even more stuff into your active record objects is not a good idea. DI is great for objects that are decoupled from the database in general.
from dry-auto_inject.
ActiveRecord uses Class#allocate
while loading objects from DB, this bypasses initializers generated by dry-auto_inject. In a sense, these gems aren't compatible on a fundamental level.
from dry-auto_inject.
Makes sense, thanks for the explanation.
from dry-auto_inject.
Related Issues (20)
- Errors with multiple classes in hierarchy with injectors from different containers
- Handle invalid or separator characters when making local names for dependencies HOT 1
- Allow aliasing of registered classes using AutoInject HOT 2
- Ability to replace container after initialization HOT 3
- Interactions with dry-initializer HOT 1
- dry-auto_inject 0.4.6 can lose values imported into both base and derived classes HOT 1
- v0.5.0 breaks isolation tests with minitest mocks HOT 1
- Injecting in ActiveJob no longer works HOT 3
- How does `include Dry::AutoInject` works underneath HOT 6
- Auto-inject loses parameters if a class defines `initialize` HOT 3
- dry-auto_inject needs new docs HOT 5
- Builder interface HOT 1
- [Security] Workflow sync_configs.yml is using vulnerable action actions/checkout
- undefined method `is_a?' for #<Dry::AutoInject::Builder:0x00007f52d26c51e8> HOT 1
- Kwargs strategy doesn't know how new delegation syntax can be used HOT 1
- kwargs are sent to super class initializer that does not accept kwargs
- Ruby 3.0.3 kwargs error HOT 2
- Injecting 2 containers causes ArgumentError HOT 3
- Release dry-auto_inject 0.x version with support for ruby 3.2.1 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dry-auto_inject.