lato 3.13.4 → 3.13.6

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: 53eff868aa3041025a81fd23b1e874a993a7057fbcaa0300c1028e91e24eba74
4
- data.tar.gz: 967c80e88408aad0dc0bec51f5035fa438ed7cab886eb9559ca5775fe651b354
3
+ metadata.gz: '097682a4841d7e8d6feb894f10d69a23fbc69b194d0e6ee89b5c0b1f611f9207'
4
+ data.tar.gz: 912f7f209c84a5296209ebd004ece53f5d93bed67b1630478b1d5ff11f4bb5bc
5
5
  SHA512:
6
- metadata.gz: d531081996ed2132bfa97bd3f9291c320fb8663e019fe6729c8a416dc18b1004e664bd88401f8788930c2b97a544a4f226725607f6a3fca535bf7015f63338f3
7
- data.tar.gz: 40f9d0c5573cf96667841fae74becc774af7e20a3b955936064eea6778017fab28e8dcb7bd9bdc77a9a6ff30a828cea70acf20a88a546be884e309cfeb55ec0f
6
+ metadata.gz: 3621c5b9f7ba2f7a1b71eb1be35055c50d62e94006fcf1c87157d842a3c0f0d323340df371cd04d013990ebdf7cc8cbf0af45ae817189f0260a2e31db69d71dd
7
+ data.tar.gz: 6d6eb927c381fc9545e647243ce494aba5f3bdd7d5e2849c7246e8f820f9d015e8c0b5089ea95ac0d2fc1acf6867c95ea5d6b44b8b46276ac546d9ceb6d7c06e
data/README.md CHANGED
@@ -19,7 +19,7 @@ The gem is ready to be used with the **latest Rails 7+** features like **[ESM im
19
19
 
20
20
  ## Full documentation
21
21
 
22
- The full documentation is available at: 👉 👉 [THIS LINK](https://auuu.link/s/gh-lato) 👈 👈
22
+ The full documentation is available at: 👉 👉 [THIS LINK](https://auuu.link/s/lato) 👈 👈
23
23
 
24
24
  You can also use the [Lato AI Agent](http://lato.gregoriogalante.com/AI.html) directly on your browser to generate code and get helps with the gem.
25
25
 
@@ -9,7 +9,7 @@ module Lato
9
9
  end
10
10
 
11
11
  def authenticate_session
12
- return true if @session.valid?
12
+ return true if @session.really_valid?
13
13
 
14
14
  respond_to do |format|
15
15
  format.html { redirect_to lato.root_path }
@@ -20,7 +20,7 @@ module Lato
20
20
  end
21
21
 
22
22
  def not_authenticate_session
23
- return true unless @session.valid?
23
+ return true unless @session.really_valid?
24
24
 
25
25
  respond_to do |format|
26
26
  format.html { redirect_to lato.root_path }
@@ -11,7 +11,7 @@ module Lato
11
11
 
12
12
  def index
13
13
  session_root_path = Lato.config.session_root_path ? main_app.send(Lato.config.session_root_path) : lato.account_path
14
- redirect_to @session.valid? ? session_root_path : lato.authentication_signin_path
14
+ redirect_to @session.really_valid? ? session_root_path : lato.authentication_signin_path
15
15
  end
16
16
 
17
17
  def offline
@@ -27,8 +27,10 @@ module Lato
27
27
  end
28
28
 
29
29
  def switch_locale
30
- I18n.locale = params[:locale]
31
- @session.user.update(locale: params[:locale]) if @session.valid?
30
+ locale = I18n.available_locales.map(&:to_s).include?(params[:locale]) ? params[:locale] : I18n.default_locale.to_s
31
+
32
+ @session.user.update(locale: locale) if @session.valid?
33
+ cookies[:lato_locale] = { value: locale, expires: 1.year.from_now }
32
34
  respond_to_redirect_same_page
33
35
  end
34
36
 
@@ -46,7 +48,7 @@ module Lato
46
48
  def set_default_locale
47
49
  return unless @session.valid?
48
50
 
49
- I18n.locale = @session.user.locale || I18n.default_locale
51
+ I18n.locale = @session.user&.locale || cookies[:lato_locale] || I18n.default_locale
50
52
  end
51
53
 
52
54
  def respond_to_redirect_same_page(notice = nil)
@@ -8,8 +8,7 @@ module Lato
8
8
  ##
9
9
 
10
10
  def valid?
11
- # !@session.blank?
12
- really_valid?
11
+ !@session.blank?
13
12
  end
14
13
 
15
14
  def really_valid?
data/lib/lato/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "3.13.4"
2
+ VERSION = "3.13.6"
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: 3.13.4
4
+ version: 3.13.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-27 00:00:00.000000000 Z
11
+ date: 2025-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails