lato 0.1.31 → 0.1.32

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
  SHA256:
3
- metadata.gz: 487938754164a63167d2b0a8e40d40dbf08fc73a8f527024ceab4d1ab5415fce
4
- data.tar.gz: 38dad86f2a9aaf5e57453315e8f7d5698cc782b34edb9cfa2fe660a02b073297
3
+ metadata.gz: faf414da4198b779d11712f44baba294d97c38a31a9040599b30e535d0fea6a7
4
+ data.tar.gz: '0236985df9e2cd66f6a9051b1ab5fdd87f5bc7ecee8fae6075ee019e9017a899'
5
5
  SHA512:
6
- metadata.gz: bcd262be49775a227276acf297e3e034bd40ca5e68e24fc0fd2e6035b6a45cc30ffd97a40df575a7f7adcbf840747d2cbc801ffd57543a2581911db48b19f4ce
7
- data.tar.gz: 910142d9daee21343739a80f7040dc42deb2c15a507247beadcc38567dfebc2e8c23da21c566a73691f2054e27d287c4d9c879c853df0577aab33c05f9750634
6
+ metadata.gz: 448aa836e157e84b477102ed20e9589ceeef4c7132ead7326390886976146ddfc210e7cefa817ee0dc0c3c1d2f331c49248832fcf21f6b8710eb7ea3bff4af07
7
+ data.tar.gz: c7abaf771d02c2dc3d5be980f79f026306c3c154834ac752bf6d9a22aabfec3e0139c84ecbcdd767cc47dec2452c51ba91eed1fc3548a4cc134205104c2ca982
data/README.md CHANGED
@@ -95,6 +95,3 @@ $ ruby ./bin/publish.rb
95
95
 
96
96
  ## License
97
97
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
98
-
99
- ## To do
100
- - Gestione abbonamenti e acquisti singoli con integrazione Stripe
@@ -2,7 +2,7 @@ module Lato
2
2
  class AuthenticationController < ApplicationController
3
3
  before_action :not_authenticate_session, only: %i[signin signin_action signup signup_action accept_invitation accept_invitation_action]
4
4
  before_action :authenticate_session, only: %i[signout signout_action]
5
-
5
+
6
6
  before_action :find_user, only: %i[verify_email verify_email_action update_password update_password_action]
7
7
  before_action :find_invitation, only: %i[accept_invitation accept_invitation_action]
8
8
 
@@ -7,6 +7,12 @@ module Lato
7
7
  return unless validate_user_access_to_operation
8
8
  end
9
9
 
10
+ def show_legacy
11
+ Rails.logger.warn('🚨 Legacy route used: operations/show/:id. Please replace operation_show_path with operation_path.')
12
+
13
+ redirect_to lato.operation_path(params[:id])
14
+ end
15
+
10
16
  private
11
17
 
12
18
  def validate_user_access_to_operation
@@ -16,6 +16,7 @@ module Lato
16
16
  ##
17
17
 
18
18
  belongs_to :lato_user, class_name: 'Lato::User', foreign_key: :lato_user_id, optional: true
19
+ belongs_to :inviter_lato_user, class_name: 'Lato::User', foreign_key: :inviter_lato_user_id, optional: true
19
20
 
20
21
  # Hooks
21
22
  ##
@@ -25,6 +25,7 @@ module Lato
25
25
 
26
26
  has_many :lato_operations, class_name: 'Lato::Operation', foreign_key: :lato_user_id, dependent: :nullify
27
27
  has_many :lato_invitations, class_name: 'Lato::Invitation', foreign_key: :lato_user_id, dependent: :nullify
28
+ has_many :lato_invitations_as_inviter, class_name: 'Lato::Invitation', foreign_key: :inviter_lato_user_id, dependent: :nullify
28
29
 
29
30
  has_many :lato_log_user_signins, class_name: 'Lato::Log::UserSignin', foreign_key: :lato_user_id, dependent: :nullify
30
31
 
@@ -208,7 +209,7 @@ module Lato
208
209
  raise ActiveRecord::Rollback unless save && invitation.update(
209
210
  accepted_at: Time.now,
210
211
  lato_user_id: id
211
- )
212
+ )
212
213
 
213
214
  true
214
215
  end
@@ -62,7 +62,7 @@
62
62
  <% end %>
63
63
 
64
64
  <% unless operation.finished? %>
65
- <%= link_to '', lato.operations_show_path(operation), class: 'd-none', data: { lato_operation_target: 'update', turbo_frame: '_self' } %>
65
+ <%= link_to '', lato.operation_path(operation), class: 'd-none', data: { lato_operation_target: 'update', turbo_frame: '_self' } %>
66
66
  <% end %>
67
67
  </div>
68
68
  <% end %>
data/config/routes.rb CHANGED
@@ -23,6 +23,9 @@ Lato::Engine.routes.draw do
23
23
  post 'accept_invitation_action', to: 'authentication#accept_invitation_action', as: :authentication_accept_invitation_action
24
24
  end
25
25
 
26
+ # Account
27
+ ##
28
+
26
29
  scope :account do
27
30
  get '', to: 'account#index', as: :account
28
31
  patch 'update_user_action', to: 'account#update_user_action', as: :account_update_user_action
@@ -33,7 +36,11 @@ Lato::Engine.routes.draw do
33
36
  patch 'update_accepted_terms_and_conditions_version_action', to: 'account#update_accepted_terms_and_conditions_version_action', as: :account_update_accepted_terms_and_conditions_version_action
34
37
  end
35
38
 
36
- scope :operations do
37
- get 'show/:id', to: 'operations#show', as: :operations_show
38
- end
39
+ # Operations
40
+ ##
41
+
42
+ get 'operation/:id', to: 'operations#show', as: :operation
43
+
44
+ # NOTE: Legacy route
45
+ get 'operations/show/:id', to: 'operations#show_legacy', as: :operations_show
39
46
  end
@@ -0,0 +1,5 @@
1
+ class AddInviterLatoUserIdToInvitations < ActiveRecord::Migration[7.0]
2
+ def change
3
+ add_reference :lato_invitations, :inviter_lato_user, foreign_key: { to_table: :lato_users }
4
+ end
5
+ end
data/lib/lato/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "0.1.31"
2
+ VERSION = "0.1.32"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.31
4
+ version: 0.1.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-11 00:00:00.000000000 Z
11
+ date: 2023-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -193,6 +193,7 @@ files:
193
193
  - db/migrate/20221229233844_add_locale_to_lato_user.rb
194
194
  - db/migrate/20230109054412_create_lato_log_user_signins.rb
195
195
  - db/migrate/20230109061533_create_lato_invitations.rb
196
+ - db/migrate/20230212211748_add_inviter_lato_user_id_to_invitations.rb
196
197
  - lib/lato.rb
197
198
  - lib/lato/btstrap.rb
198
199
  - lib/lato/config.rb