rails_simple_auth 1.0.5 → 1.0.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: 83fb50e708c25bcd5a7115ae8e0935e9921909580aef97ca6ec585100e410e37
4
- data.tar.gz: 1b7a3bcef439ad6c38155404562167e487144aeeb292ea4fa9436c5252ad1e9c
3
+ metadata.gz: 4d04d803a06cf6538074412280d1b8b526b227f62433c6e9431adfb52c0a040d
4
+ data.tar.gz: 86f0719d9a2422895271a8c143856e4fd530f0bb93d2bd6d3f037e22808722a2
5
5
  SHA512:
6
- metadata.gz: df759dcc508dca50b40cd1c85a9c8609a80b2c1a8feb71dfc2ea0a06fe48187bb5c57488a67eecce77eb9e099441bb0609524b48d14b288e318ebcf0e4fec12c
7
- data.tar.gz: f035ac8532d07768a6a4dd5ce7df1eab2454bf4fd49c53734732b0979f68d8280d876bd174576434c7daedd9f793f029d81a6cc0b335a0f6c608bd915c71d71d
6
+ metadata.gz: 02af0cb35354280587ad5ada2e4ffd9d59ba9ce193b28f56120bb61de550a116a0643a0d61b0d10e870db1da5ff6b2a18fee96431e650d52ef5824d7a2dabaa1
7
+ data.tar.gz: ef261bb888584b7ad366b0bea4ae253c2d86fd81ae09072b0a39d0d1e4e52492eedf1d1fdd6a8c366500ec3ae7d101d0b452c1965509a7b6bffe236831f972e2
data/CHANGELOG.md CHANGED
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.0.6] - 2025-01-19
11
+
12
+ ### Added
13
+
14
+ - **Database-level email uniqueness** - Partial unique index ensures permanent users have unique emails at database level (not just Rails validation)
15
+
16
+ ### Changed
17
+
18
+ - Simplified `temporary?` method for cleaner implementation
19
+
10
20
  ## [1.0.5] - 2025-01-19
11
21
 
12
22
  ### Added
@@ -4,5 +4,6 @@ class AddTemporaryToUsers < ActiveRecord::Migration[<%= Rails::VERSION::MAJOR %>
4
4
  def change
5
5
  add_column :users, :temporary, :boolean, default: false, null: false
6
6
  add_index :users, [:temporary, :created_at], name: "index_users_on_temporary_and_created_at"
7
+ add_index :users, :email_address, unique: true, where: "temporary = false", name: "index_users_on_email_address_permanent_unique"
7
8
  end
8
9
  end
@@ -58,7 +58,7 @@ module RailsSimpleAuth
58
58
  temp_user.destroy!
59
59
  end
60
60
 
61
- Rails.logger.info("[RailsSimpleAuth] Destroyed temporary user #{temp_user_id} on sign in")
61
+ Rails.logger.info "[RailsSimpleAuth] Destroyed temporary user #{temp_user_id} on sign in"
62
62
  rescue ActiveRecord::RecordNotDestroyed => e
63
63
  Rails.logger.error("[RailsSimpleAuth] Failed to destroy temporary user #{temp_user_id}: #{e.message}")
64
64
  end
@@ -18,7 +18,7 @@ module RailsSimpleAuth
18
18
  end
19
19
 
20
20
  def temporary?
21
- temporary == true
21
+ temporary
22
22
  end
23
23
 
24
24
  def permanent?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsSimpleAuth
4
- VERSION = '1.0.5'
4
+ VERSION = '1.0.6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_simple_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Kuznetsov