rodauth-model 0.2.0 → 0.2.1

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: 90b846b0bb3deb42da18175e26ba7447c358abc5d7bba6446546156ddc10ef24
4
- data.tar.gz: b1b56862f8c6aa1c0cbe4ea26e5b67ece16a47c822ba2c6991873f30b5f1a721
3
+ metadata.gz: 59bbf27ffd624fa72ce609fcb9968118bf358e3e3f10893db7d0d73abf356d12
4
+ data.tar.gz: 2c286827b98cef9f1d593f740375ae2f74c759dee7dd2d7c954380a03659ecd4
5
5
  SHA512:
6
- metadata.gz: aa97bba2346a45e8483c655d589dabbf13d1d09958edd68cb81453b7bbdd990f4c19fee5eae013a6ea885298d4d3c9ad991ed6411f1b664311c133d8437788eb
7
- data.tar.gz: 1e93fcfa6f7651d0f45510a448dba2a1ed21df8a3c935d0ecb6453d0ad0ef16a5dec201fbe53ded5f3291c2fa3e801f9af4afc1f5210102408b456bca4eb8bc4
6
+ metadata.gz: a8ef44bd93fc5cdb4fabaf58544bcf3ddc7ab8084a6a38b73777cb26163fe0ad8ded45978975cf4423b8f44b97e1c49dc9d3d01f6ca7aac71f06d120a7bebf5b
7
+ data.tar.gz: 9d8067365baec855fed3ad8f2db189d8842e3244b2867ca6b67413715ddd15465aa7f5db1d416f80e4925df2b226f7edda80e68cd40a83a0697e7a1cfe669644
data/CHANGELOG.md CHANGED
@@ -1,9 +1,13 @@
1
+ ## 0.2.1 (2022-10-26)
2
+
3
+ * Fix `elsif` warning in sequel code (@janko)
4
+
1
5
  ## 0.2.0 (2022-05-11)
2
6
 
3
- * Add support for Sequel models
7
+ * Add support for Sequel models (@janko)
4
8
 
5
- * Delete associated authentication audit logs after destroying account
9
+ * Delete associated authentication audit logs after destroying account (@janko)
6
10
 
7
11
  ## 0.1.0 (2022-05-07)
8
12
 
9
- * Initial release
13
+ * Initial release (@janko)
data/README.md CHANGED
@@ -10,7 +10,7 @@ $ bundle add rodauth-model
10
10
 
11
11
  ## Usage
12
12
 
13
- Assuming with have a `RodauthApp` Roda subclass with Rodauth configured, we can build the mixin from a Rodauth class, and include it into the account model:
13
+ The model mixin is built by calling `Rodauth::Model(...)` with the Rodauth auth class, and included into the account model:
14
14
 
15
15
  ```rb
16
16
  require "rodauth/model" # require before enabling any authentication features
@@ -71,7 +71,7 @@ You can also reference the associated models directly:
71
71
  Account::AuthenticationAuditLog.where(message: "login").group(:account_id)
72
72
  ```
73
73
 
74
- The associated models define the inverse `belongs_to :account` association:
74
+ The associated models define the inverse `account` association:
75
75
 
76
76
  ```rb
77
77
  Account::ActiveSessionKey.eager(:account).map(&:account)
@@ -79,7 +79,7 @@ Account::ActiveSessionKey.eager(:account).map(&:account)
79
79
 
80
80
  ### Association options
81
81
 
82
- By default, all associations except for audit logs have `dependent: :delete` set, to allow for easy deletion of account records in the console. You can use `:association_options` to modify global or per-association options:
82
+ By default, all associations are configured to be deleted when the associated account record is deleted. When using Active Record, you can use `:association_options` to modify global or per-association options:
83
83
 
84
84
  ```rb
85
85
  # don't auto-delete associations when account model is deleted (Active Record)
@@ -36,7 +36,7 @@ module Rodauth
36
36
  attributes = { rodauth.password_hash_id_column => self.password_hash&.pk }.compact
37
37
  if password_hash
38
38
  attributes[rodauth.password_hash_column] = password_hash
39
- elsif
39
+ else
40
40
  attributes[:_delete] = true
41
41
  end
42
42
  self.password_hash_attributes = attributes
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "rodauth-model"
5
- spec.version = "0.2.0"
5
+ spec.version = "0.2.1"
6
6
  spec.authors = ["Janko Marohnić"]
7
7
  spec.email = ["janko@hey.com"]
8
8
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rodauth-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
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-05-11 00:00:00.000000000 Z
11
+ date: 2022-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rodauth