discard 1.2.1 → 1.3.0

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: 27523357b203abf0f0928633448c778ec25ca89f36a9ec2e8178149b9a37ab67
4
- data.tar.gz: 0650603e1aa80be6727824df9b74486fa8ad7af81f44074bf4c6db7b5b7c88cd
3
+ metadata.gz: 98ef1bd12f3edc82e8e50b429d39989473cf7b917225ce25068a60e09ef7bb06
4
+ data.tar.gz: 7762b63af8cd7aeeb848f9778242a02a02be7069586943542916ea3ac12e6d51
5
5
  SHA512:
6
- metadata.gz: e77b001ed871ddee9dcc0de5379b15c13370d5976b050cc1690dfd03d99898c6cde6993660bf379fc9d0c01e489655ec1b7d5d2f12bfd8176b9e68fbacc59841
7
- data.tar.gz: d1e59a758e632ff4bfb96ae854e6b79eeb9a6eba76a6d6935f2f6fcad3c7f23fb4ee74e6562dc5055d89ddbc361dcab76440e5d5fa7f3ca6615513c3f763f9c9
6
+ metadata.gz: a43ba463a29c4cd1e1b8c3a79a37b8d140925ef9fe2ee1d23b1aa347c86e746faa390a3a11c60818cf327fb81c0cacd8561a9005a3ddeb9ced016b64258c32ce
7
+ data.tar.gz: 1a3516836d8a2f21ef1e0385d6b126bec5f5ca380071f473a80ac8d8bd5dc9cd275954fff9052b9964f5d0763cbbd0b2ba4e8da9317e042dbbdd5cb42836cf56
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
@@ -11,22 +11,29 @@ on:
11
11
  jobs:
12
12
  build:
13
13
  runs-on: ubuntu-latest
14
- name: Test on Rails ${{ matrix.rails_version }}
14
+ name: Test on Rails ${{ matrix.rails_version }} and Ruby ${{ matrix.ruby_version }}
15
15
  strategy:
16
16
  matrix:
17
- rails_version:
18
- - ~> 5.1.0
19
- - ~> 5.2.0
20
- - ~> 6.0.0
21
- - ~> 6.1.0
22
- - ~> 7.0.0
23
- container: docker://ruby
17
+ include:
18
+ - rails_version: ~> 7.0.0
19
+ ruby_version: 3.2
20
+ - rails_version: ~> 7.0.0
21
+ ruby_version: 3.1
22
+ - rails_version: ~> 6.1.0
23
+ ruby_version: '3.0'
24
+ - rails_version: ~> 6.0.0
25
+ ruby_version: 2.7
26
+ - rails_version: ~> 5.2.0
27
+ ruby_version: 2.6
28
+ - rails_version: ~> 5.1.0
29
+ ruby_version: 2.5
30
+ env:
31
+ RAILS_VERSION: ${{ matrix.rails_version }}
24
32
  steps:
25
- - uses: actions/checkout@v1
26
- - name: Build and test
27
- run: |
28
- gem install bundler
29
- bundle install --jobs 4 --retry 3
30
- bundle exec rake
31
- env:
32
- RAILS_VERSION: ${{ matrix.rails_version }}
33
+ - uses: actions/checkout@v3
34
+ - uses: ruby/setup-ruby@v1
35
+ with:
36
+ ruby-version: ${{ matrix.ruby_version }}
37
+ bundler-cache: true
38
+ - name: Test
39
+ run: bundle exec rake
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ### Unreleased
2
2
 
3
+ ### Version 1.3.0
4
+ Release date: 2023-08-17
5
+
6
+ * Fix `undiscard` so it returns false instead of nil when the record isn't
7
+ discarded (#95, #96)
8
+
3
9
  ### Version 1.2.1
4
10
  Release date: 2021-12-16
5
11
 
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Discard [![Build Status](https://travis-ci.org/jhawthorn/discard.svg?branch=master)](https://travis-ci.org/jhawthorn/discard)
1
+ # Discard [![Test](https://github.com/jhawthorn/discard/actions/workflows/test.yml/badge.svg)](https://github.com/jhawthorn/discard/actions/workflows/test.yml)
2
2
 
3
3
  Soft deletes for ActiveRecord done right.
4
4
 
@@ -265,6 +265,8 @@ Discard takes a different approach. It doesn't override any ActiveRecord
265
265
  methods and instead simply provides convenience methods and scopes for
266
266
  discarding (hiding), restoring, and querying records.
267
267
 
268
+ You can find more information about the history and purpose of Discard in [this blog post](https://supergood.software/introduction-to-discard/).
269
+
268
270
  ## Development
269
271
 
270
272
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/discard.gemspec CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.add_dependency "activerecord", ">= 4.2", "< 8"
26
26
  spec.add_development_dependency "bundler"
27
- spec.add_development_dependency "rake", "~> 10.0"
27
+ spec.add_development_dependency "rake", ">= 10.0"
28
28
  spec.add_development_dependency "rspec", "~> 3.5.0"
29
29
  spec.add_development_dependency "database_cleaner", "~> 1.5"
30
30
  spec.add_development_dependency "with_model", "~> 2.0"
data/lib/discard/model.rb CHANGED
@@ -138,7 +138,7 @@ module Discard
138
138
  #
139
139
  # @return [Boolean] true if successful, otherwise false
140
140
  def undiscard
141
- return unless discarded?
141
+ return false unless discarded?
142
142
  run_callbacks(:undiscard) do
143
143
  update_attribute(self.class.discard_column, nil)
144
144
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Discard
4
4
  # Discard version
5
- VERSION = "1.2.1".freeze
5
+ VERSION = "1.3.0".freeze
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: discard
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Hawthorn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-16 00:00:00.000000000 Z
11
+ date: 2023-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -48,14 +48,14 @@ dependencies:
48
48
  name: rake
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - "~>"
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: '10.0'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - "~>"
58
+ - - ">="
59
59
  - !ruby/object:Gem::Version
60
60
  version: '10.0'
61
61
  - !ruby/object:Gem::Dependency
@@ -124,6 +124,7 @@ extra_rdoc_files: []
124
124
  files:
125
125
  - ".github/ISSUE_TEMPLATE/bug-report.md"
126
126
  - ".github/ISSUE_TEMPLATE/feature-proposal.md"
127
+ - ".github/dependabot.yml"
127
128
  - ".github/workflows/test.yml"
128
129
  - ".gitignore"
129
130
  - ".rspec"
@@ -161,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
162
  - !ruby/object:Gem::Version
162
163
  version: '0'
163
164
  requirements: []
164
- rubygems_version: 3.2.22
165
+ rubygems_version: 3.4.10
165
166
  signing_key:
166
167
  specification_version: 4
167
168
  summary: ActiveRecord soft-deletes done right