bookingsync_portal 3.0.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d421d75ad1576b846c1193f95a99cbdccfc69c3a2e425ce277f9b0f1ee5da96
4
- data.tar.gz: ca119adacdf8c98acb2e307ecb220b74741a3a066ba46531f764b686976f9ae8
3
+ metadata.gz: 1a7b28335200aae2b764cf584e456b51c791cf6f8c24005a43982e4f10c58617
4
+ data.tar.gz: 15e9d79dfd7ba14627dfc1f38a5bfe570f6ba821fc01ab82a7c7187b37829c0e
5
5
  SHA512:
6
- metadata.gz: e943963710bb782ba8bf3f970115a07298de7cd98c5b1bdbd3d59705dc829070ad00f2499584fb33a8b2a1a423a36e554799d6072727d4a6b68671e2901a676a
7
- data.tar.gz: ab637cea334141163a8672ccf1c4d7c6936f8e402babedf5ca52ce5675d7c400e2fab9273662e5726a8fabc502aec963e520412bb58b07e1417fd81953fea539
6
+ metadata.gz: fbd5c94f28ff95d4c8261d0df77d9fcec386745237c4c9bf30b2710083d8633229c8462249ec23278199892acc3dd1cad03445df08b02453ff6d16b2f0f124cd
7
+ data.tar.gz: 840814eb2322e8fb8467cfbb348eb324cb8da89862b09d81c2e8befa9b101ccb1488ad9739f8d8137fd5843470262af08c696411a0cc430f7302187e2f3c72d1
data/README.md CHANGED
@@ -7,7 +7,7 @@ A Rails engine to simplify building BookingSync Portal Applications.
7
7
 
8
8
  ## Requirements
9
9
 
10
- This engine requires Rails `>= 5.2.0` and Ruby `>= 2.5.0`.
10
+ This engine requires Rails `>= 6.0.0` and Ruby `>= 2.7.0`.
11
11
 
12
12
  ## Documentation
13
13
 
@@ -15,7 +15,7 @@ This engine requires Rails `>= 5.2.0` and Ruby `>= 2.5.0`.
15
15
 
16
16
  ## Installation
17
17
 
18
- BookingSync Portal works with Rails 5.2 onwards and Ruby 2.5 onwards. To get started, add it to your Gemfile with:
18
+ BookingSync Portal works with Rails 6.0 onwards and Ruby 2.7 onwards. To get started, add it to your Gemfile with:
19
19
 
20
20
  ```ruby
21
21
  gem 'bookingsync_portal'
@@ -139,6 +139,17 @@ The engine is configured by the following ENV variables:
139
139
  You might want to use [dotenv-rails](https://github.com/bkeepers/dotenv)
140
140
  to make ENV variables management easy.
141
141
 
142
+ Furthermore gem provides hooks to let you ensure displayed data will be up to date.
143
+
144
+ ### Rentals
145
+ By default `BookingsyncPortal.rental_model` synchronization is performed inline using synced gem. You may want to customize this behaviour by specifying some callable. This can be useful if you have larger accounts and would like to synchronize rentals asynchronously, eg.:
146
+
147
+ ```ruby
148
+ BookingsyncPortal.setup do |config|
149
+ config.rentals_synchronizer = ->(account) { AsyncRentalsSynchronizer.perform_async(account.id) }
150
+ end
151
+ ```
152
+
142
153
  Rack::Lock is not recommended with message_bus gem, causing deadlock problems. You might want to add this line to your app `development.rb` file:
143
154
 
144
155
  ```ruby
@@ -19,7 +19,7 @@ module BookingsyncPortal
19
19
  private
20
20
 
21
21
  def synchronize_rentals
22
- BookingsyncPortal.rental_model.constantize.synchronize(scope: current_account)
22
+ BookingsyncPortal.rentals_synchronizer.call(current_account)
23
23
  end
24
24
 
25
25
  def fetch_remote_rentals
@@ -8,8 +8,6 @@ class BookingsyncPortal::RemoteRental < ActiveRecord::Base
8
8
  has_one :connection, class_name: BookingsyncPortal.connection_model, dependent: :destroy
9
9
  has_one :rental, class_name: BookingsyncPortal.rental_model, through: :connection
10
10
 
11
- serialize :remote_data, BookingsyncPortal::MashSerializer
12
-
13
11
  validates :uid, uniqueness: { allow_nil: true }
14
12
  validates :remote_account, presence: true
15
13
 
@@ -3,7 +3,7 @@ class CreateRemoteRentals < ActiveRecord::Migration[4.2]
3
3
  create_table :remote_rentals do |t|
4
4
  t.belongs_to :remote_account, index: true
5
5
  t.integer :uid
6
- t.text :remote_data
6
+ t.jsonb :remote_data
7
7
  t.datetime :synchronized_at
8
8
 
9
9
  t.timestamps null: false
@@ -1,3 +1,3 @@
1
1
  module BookingsyncPortal
2
- VERSION = "3.0.0"
2
+ VERSION = "4.0.0"
3
3
  end
@@ -60,6 +60,10 @@ module BookingsyncPortal
60
60
  # message bus channel scope
61
61
  mattr_accessor :message_bus_channel_scope
62
62
 
63
+ # Define if/how to pre-synchronize rentals before rendering index page. Default is inline sync using synced gem
64
+ mattr_accessor :rentals_synchronizer
65
+ @@rentals_synchronizer = ->(account) { BookingsyncPortal.rental_model.constantize.synchronize(scope: account) }
66
+
63
67
  # fetch remote rentals
64
68
  def self.fetch_remote_rentals(account)
65
69
  # return false if remote account is not present or not valid
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bookingsync_portal
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Marciniak
8
8
  - Sebastien Grosjean
9
9
  - Artur Krzeminski Freda
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-07-21 00:00:00.000000000 Z
13
+ date: 2025-09-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - ">="
20
20
  - !ruby/object:Gem::Version
21
- version: '5.2'
21
+ version: '7.2'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- version: '5.2'
28
+ version: '7.2'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: sprockets-rails
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -313,7 +313,7 @@ dependencies:
313
313
  - !ruby/object:Gem::Version
314
314
  version: '4'
315
315
  - !ruby/object:Gem::Dependency
316
- name: factory_girl_rails
316
+ name: factory_bot_rails
317
317
  requirement: !ruby/object:Gem::Requirement
318
318
  requirements:
319
319
  - - ">="
@@ -358,16 +358,16 @@ dependencies:
358
358
  name: sqlite3
359
359
  requirement: !ruby/object:Gem::Requirement
360
360
  requirements:
361
- - - "~>"
361
+ - - ">="
362
362
  - !ruby/object:Gem::Version
363
- version: '1.4'
363
+ version: '0'
364
364
  type: :development
365
365
  prerelease: false
366
366
  version_requirements: !ruby/object:Gem::Requirement
367
367
  requirements:
368
- - - "~>"
368
+ - - ">="
369
369
  - !ruby/object:Gem::Version
370
- version: '1.4'
370
+ version: '0'
371
371
  - !ruby/object:Gem::Dependency
372
372
  name: rubocop
373
373
  requirement: !ruby/object:Gem::Requirement
@@ -412,9 +412,7 @@ dependencies:
412
412
  version: '0'
413
413
  description: A common base for creating BookingSync portal applications.
414
414
  email:
415
- - mandaryyyn@gmail.com
416
415
  - dev@bookingsync.com
417
- - artur@bookingsync.com
418
416
  executables: []
419
417
  extensions: []
420
418
  extra_rdoc_files: []
@@ -499,7 +497,7 @@ homepage: https://github.com/BookingSync/bookingsync_portal
499
497
  licenses:
500
498
  - MIT
501
499
  metadata: {}
502
- post_install_message:
500
+ post_install_message:
503
501
  rdoc_options: []
504
502
  require_paths:
505
503
  - lib
@@ -514,8 +512,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
514
512
  - !ruby/object:Gem::Version
515
513
  version: '0'
516
514
  requirements: []
517
- rubygems_version: 3.0.1
518
- signing_key:
515
+ rubygems_version: 3.4.19
516
+ signing_key:
519
517
  specification_version: 4
520
518
  summary: A common base for creating BookingSync portal applications.
521
519
  test_files: []