devise-guests 0.8.1 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/tests.yml +10 -11
- data/CHANGELOG.md +11 -0
- data/Gemfile +1 -1
- data/README.md +8 -1
- data/devise-guests.gemspec +1 -2
- data/lib/devise-guests/version.rb +1 -1
- data/lib/railties/devise_guests.rake +5 -3
- metadata +6 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b23261ae65421aa7d88555b9075bde9d0690afb35637a459a13940d20b8b8e3
|
4
|
+
data.tar.gz: b921863d7ee1566071bc5c3df75271d84007031814f74c137c16026cc56b2a61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c8c31feec580030f094d1d35b5bb186b94726d705a14b225a8a40c437dd14effbddadab967713b6758c68271b980fc9c3b31d08d2bc90b878a20f074f3bcef0
|
7
|
+
data.tar.gz: 8860e74828e72d13bb3bc2e71d855a60878bfc4ec19c63dea6c74f480b65ab8e55adbae159a4fcbb75accbf9c00b9af6606f51e61944f13a07ba1351a1122a48
|
data/.github/workflows/tests.yml
CHANGED
@@ -24,22 +24,23 @@ jobs:
|
|
24
24
|
changelog:
|
25
25
|
runs-on: ubuntu-latest
|
26
26
|
steps:
|
27
|
-
- uses: actions/checkout@
|
27
|
+
- uses: actions/checkout@v4
|
28
28
|
- id: read-version
|
29
29
|
run: |
|
30
30
|
echo "::set-output name=VERSION::`cat lib/devise-guests/version.rb | grep -i version | awk '{ print $3 }' | sed -e 's/\"//g'`"
|
31
|
-
- uses: dangoslen/changelog-enforcer@
|
31
|
+
- uses: dangoslen/changelog-enforcer@v3
|
32
32
|
with:
|
33
33
|
skipLabels: 'skip-changelog'
|
34
34
|
expectedLatestVersion: ${{ steps.read-version.outputs.VERSION }}
|
35
35
|
lint:
|
36
36
|
runs-on: ubuntu-latest
|
37
37
|
steps:
|
38
|
-
- uses: actions/checkout@
|
38
|
+
- uses: actions/checkout@v4
|
39
39
|
- uses: ruby/setup-ruby@v1
|
40
40
|
with:
|
41
|
-
ruby-version: '
|
41
|
+
ruby-version: '3.3'
|
42
42
|
bundler-cache: true
|
43
|
+
cache-version: 1
|
43
44
|
- run: bundle exec standardrb
|
44
45
|
test:
|
45
46
|
needs:
|
@@ -48,17 +49,15 @@ jobs:
|
|
48
49
|
runs-on: ubuntu-latest
|
49
50
|
strategy:
|
50
51
|
matrix:
|
51
|
-
ruby
|
52
|
+
ruby: ['3.0', '3.1', '3.2', '3.3']
|
52
53
|
|
53
54
|
steps:
|
54
|
-
- uses: actions/checkout@
|
55
|
+
- uses: actions/checkout@v4
|
55
56
|
- name: Set up Ruby
|
56
|
-
|
57
|
-
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
58
|
-
# uses: ruby/setup-ruby@v1
|
59
|
-
uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
|
57
|
+
uses: ruby/setup-ruby@v1
|
60
58
|
with:
|
61
|
-
ruby-version: ${{ matrix.ruby
|
59
|
+
ruby-version: ${{ matrix.ruby }}
|
62
60
|
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
61
|
+
cache-version: 1
|
63
62
|
- name: Run tests
|
64
63
|
run: bundle exec rspec
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [0.8.3] - 2024-04-26
|
8
|
+
- Fix issue with passing batch_size to delete_old_guest_users task ([#52](https://github.com/cbeer/devise-guests/pull/52)) by [@whereismyjetpack](https://github.com/whereismyjetpack)
|
9
|
+
|
10
|
+
## [0.8.2] - 2023-12-24
|
11
|
+
### Fixed
|
12
|
+
- Prevent crashing processes due to loading all guest users in memory during delete_old_guest_users task ([#42](https://github.com/cbeer/devise-guests/pull/42)) by [@hackartisan](https://github.com/hackartisan)
|
13
|
+
|
14
|
+
### Changed
|
15
|
+
- Update README with better detail around data migration ([#49](https://github.com/cbeer/devise-guests/pull/49)) by [@joshmenden](https://github.com/joshmenden)
|
16
|
+
- Update supported ruby versions ([#50](https://github.com/cbeer/devise-guests/pull/50)) by [@pacso](https://github.com/pacso)
|
17
|
+
|
7
18
|
## [0.8.1] - 2021-10-26
|
8
19
|
### Changed
|
9
20
|
- Simplify guest transfer ([#38](https://github.com/cbeer/devise-guests/pull/38))
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -41,7 +41,7 @@ guest_user # ( for anonymous users)
|
|
41
41
|
|
42
42
|
### Transferring Guest to User on Login
|
43
43
|
|
44
|
-
During the login process you may want to transfer things from your guest user to the account
|
44
|
+
During the login process you may want to transfer things from your guest user to the account they logged into.
|
45
45
|
To do so, add the following method to your ApplicationController:
|
46
46
|
|
47
47
|
```ruby
|
@@ -58,6 +58,13 @@ def transfer_guest_to_user
|
|
58
58
|
else
|
59
59
|
guest_user.cart.update!(user: current_user)
|
60
60
|
end
|
61
|
+
|
62
|
+
# In this example we've moved `LineItem` records from the guest
|
63
|
+
# user's cart to the logged-in user's cart.
|
64
|
+
#
|
65
|
+
# To prevent these being deleted when the guest user & cart are
|
66
|
+
# destroyed, we need to reload the guest record:
|
67
|
+
guest_user.reload
|
61
68
|
end
|
62
69
|
```
|
63
70
|
|
data/devise-guests.gemspec
CHANGED
@@ -16,14 +16,13 @@ Gem::Specification.new do |s|
|
|
16
16
|
|
17
17
|
s.add_development_dependency "rspec", "~> 3.0"
|
18
18
|
s.add_development_dependency "rake"
|
19
|
-
s.add_development_dependency "combustion", "~> 1.
|
19
|
+
s.add_development_dependency "combustion", "~> 1.3"
|
20
20
|
s.add_development_dependency "rspec-rails"
|
21
21
|
s.add_development_dependency "capybara"
|
22
22
|
s.add_development_dependency "standard"
|
23
23
|
s.add_development_dependency "yard"
|
24
24
|
|
25
25
|
s.files = `git ls-files`.split("\n")
|
26
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
27
26
|
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
28
27
|
s.extra_rdoc_files = [
|
29
28
|
"LICENSE",
|
@@ -4,8 +4,10 @@ namespace :devise_guests do
|
|
4
4
|
# example cron entry to delete users older than 7 days at 2:00 AM every day:
|
5
5
|
# 0 2 * * * cd /path/to/your/app && /path/to/rake devise_guests:delete_old_guest_users[7] RAILS_ENV=your_env
|
6
6
|
desc "Removes entries in the users table for guest users that are older than the number of days given."
|
7
|
-
task :delete_old_guest_users, [:days_old] => [:environment] do |t, args|
|
8
|
-
args.with_defaults(days_old: 7)
|
9
|
-
User
|
7
|
+
task :delete_old_guest_users, [:days_old, :batch_size] => [:environment] do |t, args|
|
8
|
+
args.with_defaults(days_old: 7, batch_size: 1000)
|
9
|
+
User
|
10
|
+
.where("guest = ? and updated_at < ?", true, Time.now - args[:days_old].to_i.days)
|
11
|
+
.find_each(batch_size: args[:batch_size], &:destroy)
|
10
12
|
end
|
11
13
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise-guests
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: devise
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '1.
|
61
|
+
version: '1.3'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '1.
|
68
|
+
version: '1.3'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec-rails
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -182,22 +182,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
182
182
|
- !ruby/object:Gem::Version
|
183
183
|
version: '0'
|
184
184
|
requirements: []
|
185
|
-
rubygems_version: 3.
|
185
|
+
rubygems_version: 3.5.7
|
186
186
|
signing_key:
|
187
187
|
specification_version: 4
|
188
188
|
summary: Guest user implementation for devise
|
189
|
-
test_files:
|
190
|
-
- spec/controllers/application_controller_spec.rb
|
191
|
-
- spec/helpers/devise_guests_helpers_spec.rb
|
192
|
-
- spec/integration/simple_integration_spec.rb
|
193
|
-
- spec/internal/app/assets/config/manifest.js
|
194
|
-
- spec/internal/app/controllers/application_controller.rb
|
195
|
-
- spec/internal/app/models/user.rb
|
196
|
-
- spec/internal/config/database.yml
|
197
|
-
- spec/internal/config/initializers/devise.rb
|
198
|
-
- spec/internal/config/routes.rb
|
199
|
-
- spec/internal/config/storage.yml
|
200
|
-
- spec/internal/db/schema.rb
|
201
|
-
- spec/internal/log/.gitignore
|
202
|
-
- spec/internal/public/favicon.ico
|
203
|
-
- spec/spec_helper.rb
|
189
|
+
test_files: []
|