- Proper dirty tracking in record updating, fixes an issue of setting an attribute to
nil. - Added
has_oneassociation. - Added
before_load,after_load,before_findandafter_findcallbacks. - Added
before_initandafter_initcallbacks. - Added
offsetargument to thelimitcriteria. - Added support for Kaminari pagination.
- Fixed dirty tracking for entities returned from
whereandall. - Fixed a bug where in certain situations duplicated data records are created upon updating an entity.
- Fixed a bug where reversed mapping option
:viagenerates wrong join queries. - New API: Added
matchfor repository. - Added preliminary support for composed search criteria.
- Added
whereas a composable criteria. - Added
matchas a composable criteria. - Added
limitas a composable criteria. - Added
orderas a composable criteria.
- Added
- Added experimental support for associations.
- Added
reference_keyoption tomap_attribute. - Added support for ActiveRecord-style attribute-nesting, e.g.
form.fields_for. - Added validation aggregation for associated entities.
- Added the ability to destroy associated items.
- Added
- Performance optimisations.
- Refactored the way Datamappify walks attributes to allow query optimisations.
- Optimised ActiveRecord queries for entities.
- New API: Introduced
Datamappify.configfor configuring default behaviours. - API change:
wherenow replacesfindfor multiple items. - API change:
map_attributenow takes:toand:providerinstead of a string for specifying data source. - New API: Introduced
groupfor groupingmap_attribute. - Added support for entity namespaces (closes #4).
- Better attributes inspect. Thanks @jamesmoriarty!
- Added support of
:createand:updatecontexts for validations. - Fixed the persistence when
:viais specified in the repository.
- Fixed ruby 1.9 compatibility.
- Added support for mapping to namespaced data models.
- Added support for reverse mapping attributes.
- Fixed an issue with attribute name and validation conflicts.
- Enhanced
findfor searching specific attributes. - Added support for repository inheritance.
attributes_fromnow copies validations as well!findnow raises an exception if the arguments contain an unknown attribute key.
- Added
allto repository. - Added
PersistentStates#mark_as_dirty. - Added
Entity#references. - Implemented nested composable entities!
- Added dirty attribute tracking.
- Implemented attribute lazy loading!
- Query methods (
find,saveanddestroy) no longer support multiple entities.- e.g.
UserRepository.find([1, 2, 3])is no longer valid.
- e.g.
- Added
exists?,create,create!,updateandupdate!to repository. - Implemented callbacks (e.g.
before_saveandafter_save, etc).
- Completely reimplemented Datamappify
- Things are more decoupled and cleaner in general.
- Leaner
Repositorysyntax, i.e.UserRepositoryinstead of the more verboseUserRepository.instance.
- Fixed the leftover
require 'active_record'in the code so the gem works without ActiveRecord.
- Completely rewritten Repository
- Repository now handles data construction from different ORM objects.
- ActiveRecord has now been demoted to being a data provider, it is no longer tightly coupled with Repository, this means we could have multiple data providers!
- Repository is now much more robust.
- As a result of robustness, it fixed an issue where updating an existing entity with new data records from mapped attributes will not persist the new data records correctly.
#saveand#destroynow support accepting an array as their argument.- Added support for Sequel!
- Added support for mapping entity attributes to different ORMs!
- Fixed
#savefor creating new objects. #savenow performs in a transaction.
- Refactored
Repository.Entitycan now have attributes sourced from differentDataobjects. - Removed relationships support - the effort required to make it work is not worth it.
- A total rewrite as a proof-of-concept based on the repository pattern.