devise-guests 0.8.1 → 0.8.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: 7944106e6394d186fa877f614689e47b1059488d6e3d5400ed2eb2204e324f3b
4
- data.tar.gz: 817faf49e6a0ad620f2fe35014f1adf1783f3f5177cc7579e4f9bc4cb2872ecd
3
+ metadata.gz: 1cf09de56176a4e1572a0d31dedb4c8583483f6b93706ef6b026c9ecbc191eaf
4
+ data.tar.gz: a91ee992b8c0302a08946c7dfa3416f0a53200b909188419cfd11c0fbac415cb
5
5
  SHA512:
6
- metadata.gz: 98e77fdda01fa6982fb3f2851eb84870ab0a9aeaae60e0bba91c98f55454a705056953738559caad400a162aa7d6d55b3e0b510427f573e094c16eb05d85b181
7
- data.tar.gz: 4e9d799034284f840332366ae2d79f87c72a1eeaf1f4526287cd76fd8f50126a51d74749977b0c31479e0c6ab8ff377b9ef2a4e932ec2feb9ada9f6901074e7b
6
+ metadata.gz: 3158f2d0423e1153bcc26e34539ae063f4e81fb6a761ee48f26ee3f428b7d060b6604ac3553ca0e41a949f9655918947ae7b2926f7c6d8e9182554f74d789b08
7
+ data.tar.gz: f792e1da66916f9c29ee2aacf8030fb01614f80c1bc66f0477e398b8a63610ccee2bbcf48618e046e087db0a44ea7590ea75858bed7790b365088a9d10cd96b7
@@ -24,7 +24,7 @@ jobs:
24
24
  changelog:
25
25
  runs-on: ubuntu-latest
26
26
  steps:
27
- - uses: actions/checkout@v2
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'`"
@@ -35,11 +35,12 @@ jobs:
35
35
  lint:
36
36
  runs-on: ubuntu-latest
37
37
  steps:
38
- - uses: actions/checkout@v2
39
- - uses: ruby/setup-ruby@v1
38
+ - uses: actions/checkout@v4
39
+ - uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
40
40
  with:
41
- ruby-version: '2.6'
41
+ ruby-version: '3.2'
42
42
  bundler-cache: true
43
+ cache-version: 1
43
44
  - run: bundle exec standardrb
44
45
  test:
45
46
  needs:
@@ -48,17 +49,18 @@ jobs:
48
49
  runs-on: ubuntu-latest
49
50
  strategy:
50
51
  matrix:
51
- ruby-version: ['2.6', '2.7', '3.0']
52
+ ruby: ['2.7', '3.0', '3.1', '3.2']
52
53
 
53
54
  steps:
54
- - uses: actions/checkout@v2
55
+ - uses: actions/checkout@v4
55
56
  - name: Set up Ruby
56
57
  # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
57
58
  # change this to (see https://github.com/ruby/setup-ruby#versioning):
58
59
  # uses: ruby/setup-ruby@v1
59
- uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
60
+ uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
60
61
  with:
61
- ruby-version: ${{ matrix.ruby-version }}
62
+ ruby-version: ${{ matrix.ruby }}
62
63
  bundler-cache: true # runs 'bundle install' and caches installed gems automatically
64
+ cache-version: 1
63
65
  - name: Run tests
64
66
  run: bundle exec rspec
data/CHANGELOG.md CHANGED
@@ -4,6 +4,14 @@ 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.2] - 2023-12-24
8
+ ### Fixed
9
+ - 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))
10
+
11
+ ### Changed
12
+ - Update README with better detail around data migration ([#49](https://github.com/cbeer/devise-guests/pull/49)) by [@joshmenden](https://github.com/joshmenden)
13
+ - Update supported ruby versions ([#50](https://github.com/cbeer/devise-guests/pull/50)) by [@pacso](https://github.com/pacso)
14
+
7
15
  ## [0.8.1] - 2021-10-26
8
16
  ### Changed
9
17
  - Simplify guest transfer ([#38](https://github.com/cbeer/devise-guests/pull/38))
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 the logged into.
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
 
@@ -23,7 +23,6 @@ Gem::Specification.new do |s|
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",
@@ -1,3 +1,3 @@
1
1
  module DeviseGuests
2
- VERSION = "0.8.1"
2
+ VERSION = "0.8.2"
3
3
  end
@@ -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.where("guest = ? and updated_at < ?", true, Time.now - args[:days_old].to_i.days).each { |x| x.destroy }
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: 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.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-26 00:00:00.000000000 Z
11
+ date: 2023-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise
@@ -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.0.9
185
+ rubygems_version: 3.4.10
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: []