lato 0.1.30 → 0.1.32

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: 3a81949d95d987f42175e24723dc36bd0450192851888204b552007188be3f4c
4
- data.tar.gz: 12dea2b246934f04b65354b7e53429f54dd3b3e001a947782e3cd0f397f278fb
3
+ metadata.gz: faf414da4198b779d11712f44baba294d97c38a31a9040599b30e535d0fea6a7
4
+ data.tar.gz: '0236985df9e2cd66f6a9051b1ab5fdd87f5bc7ecee8fae6075ee019e9017a899'
5
5
  SHA512:
6
- metadata.gz: 899825db83f85d673bf707872f0e8225ff911f042edce2cb7ae6895d57face9815d04a04c44b630d49c91129be334013afc75c9a9a5d6e351f1197fc57b0ff6e
7
- data.tar.gz: c0d39db6501532947fb1450a963b4840d344cbf7fd8e40f08e628cda8ab4da273591204921367226c160f5bbc913bb110819e48d5580db72abbbabff964836b7
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 %>
@@ -1,7 +1,7 @@
1
1
  <div class="footer <%= Lato.btstrap.footer %>" style="font-size: 14px;">
2
2
  <div class="<%= Lato.btstrap.footer_container %>">
3
3
  <div>
4
- © <%= Date.today.year %> - <%= link_to Lato.config.application_company_name, Lato.config.application_company_url, target: '_blank' %>
4
+ v<%= Lato.config.application_version %> - © <%= Date.today.year %> - <%= link_to Lato.config.application_company_name, Lato.config.application_company_url, target: '_blank' %>
5
5
  </div>
6
6
  <div class="mt-2 mt-md-0">
7
7
  <%= link_to I18n.t('lato.privacy_policy'), Lato.config.legal_privacy_policy_url %> -
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/config.rb CHANGED
@@ -4,7 +4,7 @@ module Lato
4
4
  ##
5
5
  class Config
6
6
  # Applicaction configs
7
- attr_accessor :application_title, :application_company_name, :application_company_url
7
+ attr_accessor :application_title, :application_version, :application_company_name, :application_company_url
8
8
 
9
9
  # Session configs
10
10
  attr_accessor :session_lifetime, :session_root_path
@@ -23,6 +23,7 @@ module Lato
23
23
 
24
24
  def initialize
25
25
  @application_title = 'Lato'
26
+ @application_version = '1.0.0'
26
27
  @application_company_name = 'Lato Team'
27
28
  @application_company_url = 'https://github.com/Lato-GAM'
28
29
 
data/lib/lato/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "0.1.30"
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.30
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