- Drop support for ruby prior to 2.7
- Add support for ruby 3.0 and 3.1
- Drop support for rails prior to 6
- Update and lock bookingsync-api at
>= 1
- [feature] Model aliasing. added
endpoint
option to synced to determine the model to sync. For example, in user.rbendpoint: :persons
will look forPerson
class instead ofUser
- [feature] Synced will accept tolerance param which reduces updated_since value by specified amount of seconds.
- [improvement] Move default value of
data_key
fetch to block.
- [feature] Allow to have a transaction per page of fetched objects by using :transaction_per_page option
- [enhancement] Support only Ruby 2.3+
- [bugfix] Fix n + 1 query problems
- [feature] Allow to choose method of fetching data (with auto_paginate or in batches). Fetching in batches should reduce memory usage. Defaults to auto_paginate, hence no changes required after update.
- [improvement] Update bookingsync-api gem to 0.1.4
- [bugfix] For paginated updated_since syncs use the timestamp from the first page. This should prevent any data loss during updated_since synchronization, fixing inconsistencies in the next sync.
- [feature] Make scope no longer required for SyncedPerScopeTimestampStrategy (if you already have created the table, you should remove
null: false
constraint forparent_scope_id
andparent_scope_type
columns)
- [refactor] Delegate
reset_synced
functionality to strategy - [refactor] Extract updated_since timestamps (
synced_all_at
) as a separate strategy, add second timestamps strategy that uses external table instead ofsynced_all_at
fields. - [refactor] Removed dynamic strategy resolution. :updated_since is now a default strategy, to use :full strategy specify it in synced declaration,
synced strategy: :full
- [refactor] Change
search_params
toquery_params
- [bugfix] Do not perform requests for blank has_one associations
- [bugfix] Fix remote_objects array wrapping to allow single remote_object sync to local association
- [feature] Allow to filter records with
search_params
when syncing - [bugfix] Memoize api instance at strategy level to properly return last_response for meta
- [refactor] Remove dummy api class method memoization, as it is an unrealistic scenario
- [improvement] Add
pry
development_dependency
- [feature] Add check strategy, which doesn't do any synchronization it simply compares objects from the API with the one in local database and returns a diff.
- [refactor] Synchronization code has been split into 3 strategies.
- [improvement] Better exception message on missing API client
- [improvement] Update bookingsync-api gem to 0.0.24
- [feature] Add delegate_attributes for easier access to data stored in
synced_data
column
- [bugfix] Fix bug when only_updated: true and remove: true used. It was causing all records to be removed and then synchronized again on the next synchronization.
- [bugfix] Fix selecting data for updated_since when there are object in the relation
- [feature] When using partial updates (updated_since param) it's now possible to synchronize objects from given point in time by passing initial_sync_since option as value or block.
- [bugfix] Fixed synchronization with models using
default_scope
.
- [feature] Add globalized_attributes for handling translated attributes with Globalize
- [feature] .reset_synced added, allows to force syncing all local objects on the next synchronization. It simply nullifies synced_all_at column.
- [improvement] Options keys can be given as strings
- [bugfix] Fixed case when
remote:
options is nil, API request is then performed
- [improvement] Mapper can be defined after synced method - using a block
synced mapper: -> { Mapper }
. - [improvement]
remove:
option can be defined on synced level. - [improvement]
include
option can be defined on synced level. - [feature]
fields:
option can be specified for fetching only selected fields. It's a way to make responses from API smaller. It works on bothsynced
andsynchronize
levels. - [improvement] Options passed to
synced
andsynchronize
are not validated so it's impossible to provide not existing option. - [improvement] Completed README