bookingsync_portal 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1319288ef7564085052b114efe5080edcef79586
4
- data.tar.gz: 27a32ae0a5b4b801f1c48b8132928ce81dfda36a
3
+ metadata.gz: d58a1b6e1284fcc12a60b7c4e9c4fd8f79dec7dc
4
+ data.tar.gz: ac1983da441a124086a05ba41a1d843b5014aa90
5
5
  SHA512:
6
- metadata.gz: 927ac83466cdf90ba8e6d7d4aeab3242867e2c97f9d7cff2e295c5de58f7d44fb0af34276ac52a2473b1d6668282cdd327fdcf05ed96ba3c11bd96aa8e7a3951
7
- data.tar.gz: 76bab06506eb2fdda286b7616a80691529f1fddf629530500e78503367560d69b1682e33f88d6994a68060fdb26496437a415f3d40e12a47d197b40fb2f86a73
6
+ metadata.gz: 1883e9b0c1cb55885d8c1dfe8e04fbe8c7f05d9ef52ef8081a131530babcc8389aaffc81f9a7fd12942b57d04b1125d73e8003db995c7c4c2fa57064b6125a36
7
+ data.tar.gz: 1e5168f28b4712fe9e1c14da00c1d6b737afdf90b823ffb18878a827866369c6d675d89e8fa8e04a54a6142cc6827ceea608956c06a526896d12d2a682422cb1
@@ -5,7 +5,9 @@ class BookingsyncPortal::Rental < ActiveRecord::Base
5
5
  has_one :connection, class_name: BookingsyncPortal.connection_model, dependent: :destroy
6
6
  has_one :remote_rental, class_name: BookingsyncPortal.remote_rental_model, through: :connection
7
7
  has_many :photos, class_name: BookingsyncPortal.photo_model, dependent: :destroy
8
- has_many :rates, class_name: BookingsyncPortal.rate_model, dependent: :destroy
8
+ if BookingsyncPortal.rate_model.present?
9
+ has_many :rates, class_name: BookingsyncPortal.rate_model, dependent: :destroy
10
+ end
9
11
 
10
12
  validates :synced_id, uniqueness: true, presence: true
11
13
 
@@ -61,5 +61,4 @@
61
61
  </div>
62
62
  </div>
63
63
  </div>
64
- <%= render partial: 'how_to' %>
65
64
  </div>
data/config/routes.rb CHANGED
@@ -8,13 +8,4 @@ BookingsyncPortal::Engine.routes.draw do
8
8
  get 'help', to: 'help#index'
9
9
  root to: 'rentals#index'
10
10
  end
11
-
12
- namespace :admin_api do
13
- # FIXME properly handle cuurent account resource
14
- # jsonapi_resource :account
15
- jsonapi_resources :remote_accounts
16
- jsonapi_resources :rentals, only: [:index, :show]
17
- jsonapi_resources :remote_rentals, only: [:index, :show]
18
- jsonapi_resources :connections
19
- end
20
11
  end
@@ -1,3 +1,3 @@
1
1
  module BookingsyncPortal
2
- VERSION = '0.4.0'
2
+ VERSION = '0.5.0'
3
3
  end
@@ -18,7 +18,7 @@ BookingsyncPortal.setup do |config|
18
18
  # customize photo model class, can extend BookingsyncPortal::Photo
19
19
  config.photo_model = '::Photo'
20
20
 
21
- # customize rate model class, can extend BookingsyncPortal::Rate
21
+ # customize rate model class, can extend BookingsyncPortal::Rate, set to nil if not used
22
22
  config.rate_model = '::Rate'
23
23
 
24
24
  # customize account resource class, can extend BookingsyncPortal::AdminApi::AccountResource
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bookingsync_portal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Marciniak
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-01-19 00:00:00.000000000 Z
13
+ date: 2016-02-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -60,14 +60,14 @@ dependencies:
60
60
  requirements:
61
61
  - - "~>"
62
62
  - !ruby/object:Gem::Version
63
- version: 0.3.1
63
+ version: 0.4.0
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - "~>"
69
69
  - !ruby/object:Gem::Version
70
- version: 0.3.1
70
+ version: 0.4.0
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: jquery-rails
73
73
  requirement: !ruby/object:Gem::Requirement
@@ -347,10 +347,6 @@ files:
347
347
  - app/controllers/bookingsync_portal/admin/help_controller.rb
348
348
  - app/controllers/bookingsync_portal/admin/remote_accounts_controller.rb
349
349
  - app/controllers/bookingsync_portal/admin/rentals_controller.rb
350
- - app/controllers/bookingsync_portal/admin_api/base_controller.rb
351
- - app/controllers/bookingsync_portal/admin_api/connections_controller.rb
352
- - app/controllers/bookingsync_portal/admin_api/remote_rentals_controller.rb
353
- - app/controllers/bookingsync_portal/admin_api/rentals_controller.rb
354
350
  - app/controllers/bookingsync_portal/application_controller.rb
355
351
  - app/helpers/bookingsync_portal/admin/rentals_helper.rb
356
352
  - app/models/bookingsync_portal/account.rb
@@ -360,10 +356,6 @@ files:
360
356
  - app/models/bookingsync_portal/remote_account.rb
361
357
  - app/models/bookingsync_portal/remote_rental.rb
362
358
  - app/models/bookingsync_portal/rental.rb
363
- - app/resources/bookingsync_portal/admin_api/connection_resource.rb
364
- - app/resources/bookingsync_portal/admin_api/remote_account_resource.rb
365
- - app/resources/bookingsync_portal/admin_api/remote_rental_resource.rb
366
- - app/resources/bookingsync_portal/admin_api/rental_resource.rb
367
359
  - app/synchronizers/bookingsync_portal/write/ensure_source_exists.rb
368
360
  - app/synchronizers/bookingsync_portal/write/source.rb
369
361
  - app/views/bookingsync_portal/admin/help/_help.html.erb
@@ -372,7 +364,6 @@ files:
372
364
  - app/views/bookingsync_portal/admin/remote_accounts/_how_to_connect.html.erb
373
365
  - app/views/bookingsync_portal/admin/remote_accounts/new.html.erb
374
366
  - app/views/bookingsync_portal/admin/rentals/_connected_rental.html.erb
375
- - app/views/bookingsync_portal/admin/rentals/_how_to.html.erb
376
367
  - app/views/bookingsync_portal/admin/rentals/_new_remote_account.html.erb
377
368
  - app/views/bookingsync_portal/admin/rentals/_remote_rental.html.erb
378
369
  - app/views/bookingsync_portal/admin/rentals/_rental.html.erb
@@ -426,7 +417,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
426
417
  version: '0'
427
418
  requirements: []
428
419
  rubyforge_project:
429
- rubygems_version: 2.4.5.1
420
+ rubygems_version: 2.4.3
430
421
  signing_key:
431
422
  specification_version: 4
432
423
  summary: A common base for creating BookingSync portal applications.
@@ -1,13 +0,0 @@
1
- module BookingsyncPortal
2
- module AdminApi
3
- class BaseController < BookingsyncApplication::Admin::BaseController
4
-
5
- private
6
-
7
- def messagebus_channel
8
- "/account-#{current_account.id}"
9
- end
10
- helper_method :messagebus_channel
11
- end
12
- end
13
- end
@@ -1,6 +0,0 @@
1
- module BookingsyncPortal
2
- module AdminApi
3
- class ConnectionsController < BookingsyncPortal::AdminApi::BaseController
4
- end
5
- end
6
- end
@@ -1,18 +0,0 @@
1
- module BookingsyncPortal
2
- module AdminApi
3
- class RemoteRentalsController < BookingsyncPortal::AdminApi::BaseController
4
- prepend_before_action :set_resource_klass_name
5
- before_action :fetch_remote_rentals, only: :index
6
-
7
- private
8
-
9
- def fetch_remote_rentals
10
- BookingsyncPortal.fetch_remote_rentals(current_account)
11
- end
12
-
13
- def set_resource_klass_name
14
- @resource_klass_name = BookingsyncPortal.remote_rental_resource
15
- end
16
- end
17
- end
18
- end
@@ -1,18 +0,0 @@
1
- module BookingsyncPortal
2
- module AdminApi
3
- class RentalsController < BookingsyncPortal::AdminApi::BaseController
4
- prepend_before_action :set_resource_klass_name
5
- before_action :synchronize_rentals, only: :index
6
-
7
- private
8
-
9
- def synchronize_rentals
10
- BookingsyncPortal.rental_model.constantize.synchronize(scope: current_account)
11
- end
12
-
13
- def set_resource_klass_name
14
- @resource_klass_name = BookingsyncPortal.rental_resource
15
- end
16
- end
17
- end
18
- end
@@ -1,22 +0,0 @@
1
- module BookingsyncPortal
2
- module AdminApi
3
- class ConnectionResource < JSONAPI::Resource
4
- model_name BookingsyncPortal.connection_model
5
-
6
- attributes :rental_id, :remote_rental_id
7
-
8
- def self.records(options = {})
9
- context = options[:context]
10
- context[:current_account].connections
11
- end
12
-
13
- def save
14
- unless context[:current_account].id == @model.rental.account_id &&
15
- context[:current_account].id == @model.remote_rental.account.id
16
- raise JSONAPI::Exceptions::RecordNotFound.new(@model.rental_id)
17
- end
18
- super
19
- end
20
- end
21
- end
22
- end
@@ -1,14 +0,0 @@
1
- module BookingsyncPortal
2
- module AdminApi
3
- class RemoteAccountResource < JSONAPI::Resource
4
- model_name BookingsyncPortal.remote_account_model
5
-
6
- attributes :uid
7
-
8
- def self.records(options = {})
9
- context = options[:context]
10
- context[:current_account].remote_accounts
11
- end
12
- end
13
- end
14
- end
@@ -1,12 +0,0 @@
1
- module BookingsyncPortal
2
- module AdminApi
3
- class RemoteRentalResource < JSONAPI::Resource
4
- model_name BookingsyncPortal.remote_rental_model
5
-
6
- def self.records(options = {})
7
- context = options[:context]
8
- context[:current_account].remote_rentals
9
- end
10
- end
11
- end
12
- end
@@ -1,12 +0,0 @@
1
- module BookingsyncPortal
2
- module AdminApi
3
- class RentalResource < JSONAPI::Resource
4
- model_name BookingsyncPortal.rental_model
5
-
6
- def self.records(options = {})
7
- context = options[:context]
8
- context[:current_account].rentals
9
- end
10
- end
11
- end
12
- end