bookingsync_portal 1.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
- SHA1:
3
- metadata.gz: 76cbb051fc7aaba60b8e4f24a45fe3ce20ba88eb
4
- data.tar.gz: 34a4dd0a99cace843610a4f38f8eaaf857d7a709
2
+ SHA256:
3
+ metadata.gz: 1a7b28335200aae2b764cf584e456b51c791cf6f8c24005a43982e4f10c58617
4
+ data.tar.gz: 15e9d79dfd7ba14627dfc1f38a5bfe570f6ba821fc01ab82a7c7187b37829c0e
5
5
  SHA512:
6
- metadata.gz: 3134493e31826cefecb45e6f73264728511ad230e0c4f438f4834d61fe9e6912915fedd627eefe99d1d5a982ac710680dde20c7ca39e41a218ad3bcb5f1ec61b
7
- data.tar.gz: 086aeb339da7eeaed6eecbaf65243392bfaa81d4b6aa1493907add52b254a0a540748e6163dc01cd09118debc50ebbe3c7e3e135fbfd4a62bf5576662d7fddc2
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 `>= 4.0.0` and Ruby `>= 2.1.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 `>= 4.0.0` and Ruby `>= 2.1.0`.
15
15
 
16
16
  ## Installation
17
17
 
18
- BookingSync Portal works with Rails 4.0 onwards and Ruby 2.1 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
@@ -0,0 +1,3 @@
1
+ //= link_tree ../images
2
+ //= link "bookingsync_portal/admin/application.js"
3
+ //= link "bookingsync_portal/admin/application.css"
@@ -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
@@ -1,7 +1,7 @@
1
1
  class BookingsyncPortal::Account < ActiveRecord::Base
2
2
  self.table_name = 'accounts'
3
3
 
4
- include BookingSync::Engine::Model
4
+ include BookingSync::Engine::Models::Account
5
5
 
6
6
  has_many :remote_accounts, class_name: BookingsyncPortal.remote_account_model, dependent: :destroy
7
7
  has_many :remote_rentals, class_name: BookingsyncPortal.remote_rental_model, through: :remote_accounts
@@ -9,8 +9,7 @@ class BookingsyncPortal::Connection < ActiveRecord::Base
9
9
 
10
10
  validate :matching_accounts, if: -> { rental && remote_rental }
11
11
 
12
- after_save :notify_via_message_bus
13
- after_destroy :notify_via_message_bus
12
+ after_commit :notify_via_message_bus
14
13
 
15
14
  def notify_via_message_bus
16
15
  MessageBus.publish "/account-#{rental.account_id}", { refresh_from:
@@ -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 = "1.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: 1.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: 2017-07-03 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: '0'
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: '0'
28
+ version: '7.2'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: sprockets-rails
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -40,6 +40,20 @@ dependencies:
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
42
  version: '0'
43
+ - !ruby/object:Gem::Dependency
44
+ name: sprockets
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '4'
50
+ type: :runtime
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '4'
43
57
  - !ruby/object:Gem::Dependency
44
58
  name: responders
45
59
  requirement: !ruby/object:Gem::Requirement
@@ -60,20 +74,20 @@ dependencies:
60
74
  requirements:
61
75
  - - ">="
62
76
  - !ruby/object:Gem::Version
63
- version: '1'
77
+ version: '4'
64
78
  - - "<"
65
79
  - !ruby/object:Gem::Version
66
- version: '3'
80
+ version: '5'
67
81
  type: :runtime
68
82
  prerelease: false
69
83
  version_requirements: !ruby/object:Gem::Requirement
70
84
  requirements:
71
85
  - - ">="
72
86
  - !ruby/object:Gem::Version
73
- version: '1'
87
+ version: '4'
74
88
  - - "<"
75
89
  - !ruby/object:Gem::Version
76
- version: '3'
90
+ version: '5'
77
91
  - !ruby/object:Gem::Dependency
78
92
  name: redis
79
93
  requirement: !ruby/object:Gem::Requirement
@@ -116,34 +130,48 @@ dependencies:
116
130
  - - "~>"
117
131
  - !ruby/object:Gem::Version
118
132
  version: 6.0.1
133
+ - !ruby/object:Gem::Dependency
134
+ name: bootstrap-sass
135
+ requirement: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - "<"
138
+ - !ruby/object:Gem::Version
139
+ version: '3.5'
140
+ type: :runtime
141
+ prerelease: false
142
+ version_requirements: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - "<"
145
+ - !ruby/object:Gem::Version
146
+ version: '3.5'
119
147
  - !ruby/object:Gem::Dependency
120
148
  name: bootstrap-bookingsync-sass
121
149
  requirement: !ruby/object:Gem::Requirement
122
150
  requirements:
123
151
  - - "~>"
124
152
  - !ruby/object:Gem::Version
125
- version: 1.0.0
153
+ version: 3.0.0
126
154
  type: :runtime
127
155
  prerelease: false
128
156
  version_requirements: !ruby/object:Gem::Requirement
129
157
  requirements:
130
158
  - - "~>"
131
159
  - !ruby/object:Gem::Version
132
- version: 1.0.0
160
+ version: 3.0.0
133
161
  - !ruby/object:Gem::Dependency
134
162
  name: font-awesome-sass
135
163
  requirement: !ruby/object:Gem::Requirement
136
164
  requirements:
137
- - - ">="
165
+ - - '='
138
166
  - !ruby/object:Gem::Version
139
- version: '0'
167
+ version: 4.7.0
140
168
  type: :runtime
141
169
  prerelease: false
142
170
  version_requirements: !ruby/object:Gem::Requirement
143
171
  requirements:
144
- - - ">="
172
+ - - '='
145
173
  - !ruby/object:Gem::Version
146
- version: '0'
174
+ version: 4.7.0
147
175
  - !ruby/object:Gem::Dependency
148
176
  name: handlebars_assets
149
177
  requirement: !ruby/object:Gem::Requirement
@@ -271,21 +299,21 @@ dependencies:
271
299
  - !ruby/object:Gem::Version
272
300
  version: '0'
273
301
  - !ruby/object:Gem::Dependency
274
- name: shoulda
302
+ name: shoulda-matchers
275
303
  requirement: !ruby/object:Gem::Requirement
276
304
  requirements:
277
305
  - - ">="
278
306
  - !ruby/object:Gem::Version
279
- version: '0'
307
+ version: '4'
280
308
  type: :development
281
309
  prerelease: false
282
310
  version_requirements: !ruby/object:Gem::Requirement
283
311
  requirements:
284
312
  - - ">="
285
313
  - !ruby/object:Gem::Version
286
- version: '0'
314
+ version: '4'
287
315
  - !ruby/object:Gem::Dependency
288
- name: factory_girl_rails
316
+ name: factory_bot_rails
289
317
  requirement: !ruby/object:Gem::Requirement
290
318
  requirements:
291
319
  - - ">="
@@ -384,9 +412,7 @@ dependencies:
384
412
  version: '0'
385
413
  description: A common base for creating BookingSync portal applications.
386
414
  email:
387
- - mandaryyyn@gmail.com
388
415
  - dev@bookingsync.com
389
- - artur@bookingsync.com
390
416
  executables: []
391
417
  extensions: []
392
418
  extra_rdoc_files: []
@@ -394,6 +420,7 @@ files:
394
420
  - MIT-LICENSE
395
421
  - README.md
396
422
  - Rakefile
423
+ - app/assets/config/manifest.js
397
424
  - app/assets/images/bookingsync_portal/bookingsync.png
398
425
  - app/assets/images/bookingsync_portal/help/connect.gif
399
426
  - app/assets/javascripts/bookingsync_portal/admin/application.js.coffee
@@ -404,7 +431,7 @@ files:
404
431
  - app/assets/javascripts/bookingsync_portal/admin/rentals.js.coffee
405
432
  - app/assets/javascripts/bookingsync_portal/admin/templates/filter_input.hbs
406
433
  - app/assets/javascripts/bookingsync_portal/admin/vendor/css-contains.js
407
- - app/assets/stylesheets/bookingsync_portal/admin/application.css.scss
434
+ - app/assets/stylesheets/bookingsync_portal/admin/application.scss
408
435
  - app/controllers/bookingsync_portal/admin/base_controller.rb
409
436
  - app/controllers/bookingsync_portal/admin/connections_controller.rb
410
437
  - app/controllers/bookingsync_portal/admin/help_controller.rb
@@ -470,7 +497,7 @@ homepage: https://github.com/BookingSync/bookingsync_portal
470
497
  licenses:
471
498
  - MIT
472
499
  metadata: {}
473
- post_install_message:
500
+ post_install_message:
474
501
  rdoc_options: []
475
502
  require_paths:
476
503
  - lib
@@ -485,9 +512,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
485
512
  - !ruby/object:Gem::Version
486
513
  version: '0'
487
514
  requirements: []
488
- rubyforge_project:
489
- rubygems_version: 2.6.10
490
- signing_key:
515
+ rubygems_version: 3.4.19
516
+ signing_key:
491
517
  specification_version: 4
492
518
  summary: A common base for creating BookingSync portal applications.
493
519
  test_files: []