deleted_at 0.3.0 → 0.4.0rc1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,28 @@
1
+ ENV['RAILS_ENV'] = 'test'
2
+
3
+ require 'database_cleaner'
4
+ require 'combustion'
5
+
6
+ require 'simplecov'
7
+ SimpleCov.start do
8
+ add_filter 'spec'
9
+ end
10
+
11
+ Combustion.path = 'spec/support/rails'
12
+ Combustion.initialize! :active_record
13
+
14
+ RSpec.configure do |config|
15
+ config.order = 'random'
16
+
17
+ # Configure the DatabaseCleaner
18
+ config.before(:suite) do
19
+ DatabaseCleaner.strategy = :transaction
20
+ DatabaseCleaner.clean_with(:truncation)
21
+ end
22
+
23
+ config.around(:each) do |example|
24
+ DatabaseCleaner.cleaning do
25
+ example.run
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,5 @@
1
+ module Animals
2
+ class Dog < ::ActiveRecord::Base
3
+ with_deleted_at
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ class Comment < ::ActiveRecord::Base
2
+ belongs_to :user
3
+ belongs_to :post
4
+
5
+ self.primary_key = :id
6
+ end
@@ -0,0 +1,7 @@
1
+ class Post < ::ActiveRecord::Base
2
+ self.table_name = "documents"
3
+ with_deleted_at
4
+
5
+ belongs_to :user
6
+ has_many :comments
7
+ end
@@ -0,0 +1,7 @@
1
+ class User < ::ActiveRecord::Base
2
+ with_deleted_at
3
+
4
+ has_many :posts
5
+ has_many :comments
6
+
7
+ end
@@ -0,0 +1,4 @@
1
+ test:
2
+ adapter: postgresql
3
+ encoding: unicode
4
+ database: deleted_at-test
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+ #
3
+ end
@@ -0,0 +1,27 @@
1
+ ActiveRecord::Schema.define do
2
+ self.verbose = false
3
+
4
+ create_table :users, schema: :public, force: true do |t|
5
+ t.string :name
6
+ t.string :email, index: :btree
7
+ t.timestamps null: false, deleted_at: true
8
+ end
9
+
10
+ create_table :documents, id: :bigserial, force: true do |t|
11
+ t.integer :user_id
12
+ t.string :title
13
+ t.timestamps null: false, deleted_at: true
14
+ end
15
+
16
+ create_table :comments, force: true do |t|
17
+ t.string :title
18
+ t.integer :user_id
19
+ t.integer :post_id
20
+ t.timestamps null: false
21
+ end
22
+
23
+ create_table :dogs, force: true do |t|
24
+ t.string :name
25
+ t.timestamps null: false, deleted_at: true
26
+ end
27
+ end
@@ -0,0 +1 @@
1
+ *.log
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deleted_at
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dale Stevens
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-10 00:00:00.000000000 Z
11
+ date: 2017-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg
@@ -30,110 +30,76 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '4.1'
33
+ version: '4'
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
- version: '5'
36
+ version: '6'
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: '4.1'
43
+ version: '4'
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
- version: '5'
46
+ version: '6'
47
47
  - !ruby/object:Gem::Dependency
48
- name: bundler
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: '1.3'
54
- type: :development
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - "~>"
59
- - !ruby/object:Gem::Version
60
- version: '1.3'
61
- - !ruby/object:Gem::Dependency
62
- name: rake
48
+ name: pry-byebug
63
49
  requirement: !ruby/object:Gem::Requirement
64
50
  requirements:
65
51
  - - "~>"
66
52
  - !ruby/object:Gem::Version
67
- version: '10.0'
53
+ version: '3'
68
54
  type: :development
69
55
  prerelease: false
70
56
  version_requirements: !ruby/object:Gem::Requirement
71
57
  requirements:
72
58
  - - "~>"
73
59
  - !ruby/object:Gem::Version
74
- version: '10.0'
60
+ version: '3'
75
61
  - !ruby/object:Gem::Dependency
76
- name: rspec
62
+ name: bundler
77
63
  requirement: !ruby/object:Gem::Requirement
78
64
  requirements:
79
65
  - - "~>"
80
66
  - !ruby/object:Gem::Version
81
- version: '3.0'
67
+ version: '1.3'
82
68
  type: :development
83
69
  prerelease: false
84
70
  version_requirements: !ruby/object:Gem::Requirement
85
71
  requirements:
86
72
  - - "~>"
87
73
  - !ruby/object:Gem::Version
88
- version: '3.0'
74
+ version: '1.3'
89
75
  - !ruby/object:Gem::Dependency
90
- name: pry
76
+ name: rake
91
77
  requirement: !ruby/object:Gem::Requirement
92
78
  requirements:
93
79
  - - "~>"
94
80
  - !ruby/object:Gem::Version
95
- version: '0.10'
81
+ version: '10.0'
96
82
  type: :development
97
83
  prerelease: false
98
84
  version_requirements: !ruby/object:Gem::Requirement
99
85
  requirements:
100
86
  - - "~>"
101
87
  - !ruby/object:Gem::Version
102
- version: '0.10'
103
- - !ruby/object:Gem::Dependency
104
- name: simplecov
105
- requirement: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - ">="
108
- - !ruby/object:Gem::Version
109
- version: 0.9.0
110
- - - "<"
111
- - !ruby/object:Gem::Version
112
- version: 1.0.0
113
- type: :development
114
- prerelease: false
115
- version_requirements: !ruby/object:Gem::Requirement
116
- requirements:
117
- - - ">="
118
- - !ruby/object:Gem::Version
119
- version: 0.9.0
120
- - - "<"
121
- - !ruby/object:Gem::Version
122
- version: 1.0.0
88
+ version: '10.0'
123
89
  - !ruby/object:Gem::Dependency
124
- name: codeclimate-test-reporter
90
+ name: combustion
125
91
  requirement: !ruby/object:Gem::Requirement
126
92
  requirements:
127
93
  - - "~>"
128
94
  - !ruby/object:Gem::Version
129
- version: '1.0'
95
+ version: '0.7'
130
96
  type: :development
131
97
  prerelease: false
132
98
  version_requirements: !ruby/object:Gem::Requirement
133
99
  requirements:
134
100
  - - "~>"
135
101
  - !ruby/object:Gem::Version
136
- version: '1.0'
102
+ version: '0.7'
137
103
  description: Default scopes are bad. Don't delete your data. DeletedAt, I choose you!
138
104
  email:
139
105
  - dale@twilightcoders.net
@@ -149,15 +115,32 @@ files:
149
115
  - LICENSE.txt
150
116
  - README.md
151
117
  - Rakefile
152
- - bin/console
153
- - bin/setup
154
118
  - deleted_at.gemspec
119
+ - gemfiles/activerecord-4.0.Gemfile
120
+ - gemfiles/activerecord-4.1.Gemfile
121
+ - gemfiles/activerecord-4.2.Gemfile
122
+ - gemfiles/activerecord-5.0.Gemfile
123
+ - gemfiles/activerecord-5.1.Gemfile
155
124
  - lib/deleted_at.rb
156
125
  - lib/deleted_at/active_record/base.rb
126
+ - lib/deleted_at/active_record/connection_adapters/abstract/schema_definition.rb
157
127
  - lib/deleted_at/active_record/relation.rb
158
128
  - lib/deleted_at/railtie.rb
159
129
  - lib/deleted_at/version.rb
160
130
  - lib/deleted_at/views.rb
131
+ - spec/deleted_at/active_record/base_spec.rb
132
+ - spec/deleted_at/active_record/relation_spec.rb
133
+ - spec/deleted_at/views_spec.rb
134
+ - spec/spec_helper.rb
135
+ - spec/support/rails/app/models/animals/dog.rb
136
+ - spec/support/rails/app/models/comment.rb
137
+ - spec/support/rails/app/models/post.rb
138
+ - spec/support/rails/app/models/user.rb
139
+ - spec/support/rails/config/database.yml
140
+ - spec/support/rails/config/routes.rb
141
+ - spec/support/rails/db/schema.rb
142
+ - spec/support/rails/log/.gitignore
143
+ - spec/support/rails/public/favicon.ico
161
144
  homepage: https://github.com/TwilightCoders/deleted_at
162
145
  licenses:
163
146
  - MIT
@@ -167,20 +150,34 @@ post_install_message:
167
150
  rdoc_options: []
168
151
  require_paths:
169
152
  - lib
153
+ - spec
170
154
  required_ruby_version: !ruby/object:Gem::Requirement
171
155
  requirements:
172
156
  - - ">="
173
157
  - !ruby/object:Gem::Version
174
- version: 2.0.0
158
+ version: '2.0'
175
159
  required_rubygems_version: !ruby/object:Gem::Requirement
176
160
  requirements:
177
- - - ">="
161
+ - - ">"
178
162
  - !ruby/object:Gem::Version
179
- version: '0'
163
+ version: 1.3.1
180
164
  requirements: []
181
165
  rubyforge_project:
182
- rubygems_version: 2.6.11
166
+ rubygems_version: 2.7.0
183
167
  signing_key:
184
168
  specification_version: 4
185
169
  summary: Soft delete your data, but keep it clean.
186
- test_files: []
170
+ test_files:
171
+ - spec/deleted_at/active_record/base_spec.rb
172
+ - spec/deleted_at/active_record/relation_spec.rb
173
+ - spec/deleted_at/views_spec.rb
174
+ - spec/spec_helper.rb
175
+ - spec/support/rails/app/models/animals/dog.rb
176
+ - spec/support/rails/app/models/comment.rb
177
+ - spec/support/rails/app/models/post.rb
178
+ - spec/support/rails/app/models/user.rb
179
+ - spec/support/rails/config/database.yml
180
+ - spec/support/rails/config/routes.rb
181
+ - spec/support/rails/db/schema.rb
182
+ - spec/support/rails/log/.gitignore
183
+ - spec/support/rails/public/favicon.ico
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "deleted_at"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- require "pry"
10
- Pry.start
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here