- Fix nested association does not preload properly. Thanks dannyongtey for reporting and fixing the issue!
- Decrease the package size by 60%.
- Refactor core that ended up with speed boost.
- Fix interface discrepancy for
N1LoaderReflection
. Thanks Denis Talakevich for suggesting it!
Extend the flexibility of loading data comparison. Thanks Nazar Matus for suggesting it!
BREAKING CHANGES:
Loose comparison of loaded data. Before loaded data was initialized with identity comparator in mind:
@loaded = {}.compare_by_identity
Now it will be:
@loaded = {}
This might bring unwanted results for cases when strict comparison was wanted.
On the other hand, it gives more flexibility for many other cases, especially with isolated loader. For example, this will work now, when it wasn't working before.
# ActiveRecord object
object = Entity.first
# Initialize isolated loader
instance = loader.new([object])
# This was working before because the loaded object is identical to passed object by `#object_id`
instance.for(object)
# This wasn't working before because the loaded object is not identical to passed one by `#object_id`
#
# But it will be working now, because object == Entity.find(object.id)
instance.for(Entity.find(object.id))
If you need strict comparison support, please feel free to open the issue or the PR.
- Fix naive check of required arguments. Thanks Nazar Matus for the issue!
- Fix nested preloading for ActiveRecord 7. Thanks Igor Gonchar for the issue!
- Add support of
n1_optimized
ending with?
(question mark). Thanks Ilya Kamenko for the suggestion!
- Performance optimization: avoid unnecessary calls. Thanks Nazar Matus for the contribution.
- Add fund metadata
- Fix ArLazyPreload context setup when using isolated loaders for objects without the context.
- Add support of ArLazyPreload context for isolated loaders.
- Fix support of falsey value of arguments. Thanks Aitor Lopez Beltran for the contribution!
- Add support of Rails 7
- Inject
N1Loader::Loadable
toActiveRecord::Base
automatically - Make
reload
to calln1_clear_cache
- Add
default
support to arguments
- Add n1_clear_cache method which is useful for cases like reload in ActiveRecord
- Fix preloading of invalid objects
- add support of optional arguments
BREAKING CHANGES:
- rework arguments to use single definition through
argument <name>
only - use keyword arguments
- add support of named arguments with
argument <name>
BREAKING CHANGES:
- rename
n1_load
ton1_optimized
- rework
def self.arguments_key
tocache_key
- Introduce arguments support.
- Introduce
fulfill
method to abstract the storage.
- Various of great features.
- Initial release.