- adjusted to save errors as soon as an invalid is found.
- drop support rails 6.1.x.
- rename ActiveRecordCompose::InnerModel to ActiveRecordCompose::WrappedModel
- rename ActiveRecordCompose::InnerModelCollection to ActiveRecordCompose::ComposedCollection
- A new callback control flag,
persisted_flag_callback_control
, has been defined. Currently, the default value is false, which does not change the existing behavior, but it will be deprecated in the future. When the flag is set to true, the behavior will be almost the same as the callback sequence in ActiveRecord. (#11)
- fix: type error in
ActiveRecordCompose::Model
subclass definitions. - fixed type errors in subclass callback definitions, etc.
- doc: more detailed gem desciption.
- rewrite readme.
- fix:
delegate_attribute
defined in a subclass had an unintended side effect on the superclass. - support ruby 3.4.x
- refactor: remove some
steep:ignore
by private rbs. - refactor: place definitions that you don't want to be used much in private rbs.
- make
DelegateAttribute
dependent onActiveModel::Attributes
since it will not change in practice.
- refactor: reorganize the overall structure of the test. Change from rspec to minitest
- ci: fix CI for rails new version.
- refactor: limit the scope of methods needed only for internal library purposes.
- support rails 8.0.x
- add optional value
if
to exclude from save (or destroy).
- remove
:context
option. use:destroy
option instead. - remove
:destroy
option fromInnerModelCollection#destroy
.
- Omitted optional argument for
InnerModelCollection#destroy
.InnerModel
equivalence is always performed based on the instance of the innermodel
. Since there are no use cases that depend on the original behavior.
- support
destrpy
option. and deprecatedcontext
option.:context
will be removed in 0.5.0. Use:destroy
option instead. for example,models.push(model, context: :destroy)
is replaced bymodels.push(model, destroy: true)
models.push(model, context: -> { foo? ? :destroy : :save })
is replaced bymodels.push(model, destroy: -> { foo? })
models.push(model, context: ->(m) { m.bar? ? :destroy : :save })
is replaced bymodels.push(model, destroy: ->(m) { m.bar? })
destroy
option can now be specified with aSymbol
representing the method name.
- ci: removed sqlite3 version specifing for new AR.
delegate_attribute
options are now specific and do not acceptprefix
- use steep:ignore
- support
ActiveRecord::Base#with_connection
- rbs maintained.
- relax context proc arity.
- purge nodoc definitions from type signature
- support
ActiveRecord::Base#lease_connection
- strictify type checking
- testing with CI even in the head version of rails
- consolidate the main process of saving into the
#save
method - leave transaction control to ActiveRecord::Transactions
- execution of
before_commit
,after_commit
andafter_rollback
hook is delayed until after the database commit (or rollback).
- in
#save
(without bang),ActiveRecord::RecordInvalid
error is not passed outward.
- add i18n doc.
- add sig/
- add typecheck for ci.
- avoid executing
#save!
fromModel#save
- on save, ignore nil elements from models.
- remove
add_development_dependency
from gemspec - add spec for DelegateAttribute module
- add and refactor doc.
- add doc for
#save
and#save!
. - implement
#save
for symmetry with#save!
- add
InnerModel#initialize
doc.
- when invalid, raises ActiveRecord::RecordInvalid on #save!
- remove uniquely defined exception class.
- fix documentation uri.
- fix and add doc.
- add development dependency
- avoid instance variable name conflict (
@models
to@__models
) - add #empty?, #clear to InnerModelCollection
- add #delete to InnerModelCollection
- fix 0.1.0 release date.
- add doc.
- Make it easier for application developers to work with
#models
- Initial release