rodauth-rails 1.6.0 → 1.6.2

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: 879be6e1bbb5238e3f469002e1152d727948f970d2cda658b6ed0348a26f4b46
4
- data.tar.gz: 79042f44b03bb8ab7f2225b79697b3399f79de272dc1c414de5ddc91b788b1cb
3
+ metadata.gz: f29cbaceb49208cac659dd31cbfcb874bf0df2c3b6b0133680f75904ab07a578
4
+ data.tar.gz: 2c9c7ed9e5d91428f15058274c0896298402e93d22a94c90c7d127e33699a1a7
5
5
  SHA512:
6
- metadata.gz: 9cb9d96c3e60c64a3f8367dd122f3eff3448f0c9a147510173a8d781483d7de6a88c264a717db14864e26a830a153c09bcbf6bad4865be97d3be248fcd0265d0
7
- data.tar.gz: 422b0db632d1e0317d0f38c10d60405f2e53daf083919b460fcb29157e238ac0c2e6249660e09dc4a7f452718629d604c7a1211e073d32e4884a0b6ab4fea32a
6
+ metadata.gz: 546070f740b95f26d8f29b632672339215383737e9b6497c64d613c3c07929052477022a4e70051254d267a037c7b794448674aa99927d26edb4322cf274f778
7
+ data.tar.gz: 638ecc60b072197c490180a8241ed5af02ed3d6114f3cf5aa2e621ced9296e175d6d5b579543e43d23283164d3193551eb68efd54b2ef3b68cb79f49462397d8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 1.6.2 (2022-09-19)
2
+
3
+ * Use matching precision for current timestamp default values in Active Record 7.0+ migrations on MySQL (@janko)
4
+
5
+ ## 1.6.1 (2022-09-19)
6
+
7
+ * Fix argument error when calling `RodauthMailer` in default configuration (@janko)
8
+
1
9
  ## 1.6.0 (2022-09-14)
2
10
 
3
11
  * Avoid creating IDENTITY columns for primary foreign keys on SQL Server with Active Record (@janko)
@@ -110,9 +110,19 @@ module Rodauth
110
110
 
111
111
  def current_timestamp
112
112
  if ActiveRecord.version >= Gem::Version.new("5.0")
113
- %(-> { "CURRENT_TIMESTAMP" })
113
+ %(-> { "#{current_timestamp_literal}" })
114
114
  else
115
- %(OpenStruct.new(quoted_id: "CURRENT_TIMESTAMP"))
115
+ %(OpenStruct.new(quoted_id: "#{current_timestamp_literal}"))
116
+ end
117
+ end
118
+
119
+ # Active Record 7+ sets default precision to 6 for timestamp columns,
120
+ # so we need to ensure we match this when setting the default value.
121
+ def current_timestamp_literal
122
+ if ActiveRecord.version >= Gem::Version.new("7.0") && activerecord_adapter == "mysql2" && ActiveRecord::Base.connection.supports_datetime_with_precision?
123
+ "CURRENT_TIMESTAMP(6)"
124
+ else
125
+ "CURRENT_TIMESTAMP"
116
126
  end
117
127
  end
118
128
  else # Sequel
@@ -60,22 +60,22 @@ class RodauthMain < Rodauth::Rails::Auth
60
60
  # ==> Emails
61
61
  # Use a custom mailer for delivering authentication emails.
62
62
  create_reset_password_email do
63
- RodauthMailer.reset_password(*self.class.configuration_name, account_id, reset_password_key_value)
63
+ RodauthMailer.reset_password(self.class.configuration_name, account_id, reset_password_key_value)
64
64
  end
65
65
  create_verify_account_email do
66
- RodauthMailer.verify_account(*self.class.configuration_name, account_id, verify_account_key_value)
66
+ RodauthMailer.verify_account(self.class.configuration_name, account_id, verify_account_key_value)
67
67
  end
68
68
  create_verify_login_change_email do |_login|
69
- RodauthMailer.verify_login_change(*self.class.configuration_name, account_id, verify_login_change_key_value)
69
+ RodauthMailer.verify_login_change(self.class.configuration_name, account_id, verify_login_change_key_value)
70
70
  end
71
71
  create_password_changed_email do
72
- RodauthMailer.password_changed(*self.class.configuration_name, account_id)
72
+ RodauthMailer.password_changed(self.class.configuration_name, account_id)
73
73
  end
74
74
  # create_email_auth_email do
75
- # RodauthMailer.email_auth(*self.class.configuration_name, account_id, email_auth_key_value)
75
+ # RodauthMailer.email_auth(self.class.configuration_name, account_id, email_auth_key_value)
76
76
  # end
77
77
  # create_unlock_account_email do
78
- # RodauthMailer.unlock_account(*self.class.configuration_name, account_id, unlock_account_key_value)
78
+ # RodauthMailer.unlock_account(self.class.configuration_name, account_id, unlock_account_key_value)
79
79
  # end
80
80
  send_email do |email|
81
81
  # queue email delivery on the mailer after the transaction commits
@@ -1,5 +1,5 @@
1
1
  module Rodauth
2
2
  module Rails
3
- VERSION = "1.6.0"
3
+ VERSION = "1.6.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rodauth-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janko Marohnić
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-14 00:00:00.000000000 Z
11
+ date: 2022-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties