deleted_at 0.1.0 → 0.1.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 +4 -4
- data/README.md +22 -1
- data/lib/deleted_at/active_record/relation.rb +1 -0
- data/lib/deleted_at/railtie.rb +1 -1
- data/lib/deleted_at/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f21d27f294c651f6dbae4c1fb608081a50e61a77
|
4
|
+
data.tar.gz: 3891be06e90471eab8c7f2be5ec695f1f3dd068d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0d01f586a884db030b9e51e2226a139a6ceb05a0e9763c0df5e1acfad0ec8dd86c59ce7d8310bcd9747e1f39abc9cc663a59541a8973622f919fd7023057f25
|
7
|
+
data.tar.gz: a8aa9c11e0ddf3b4ab2f5f4ad4167ab5d0063803b04bc2c8187950095b9bc0346cfe7f2708a397d47cef7f059afd58e8f9f1ced5b79dfe564f1b5c9976d7b8b1
|
data/README.md
CHANGED
@@ -24,7 +24,7 @@ Or install it yourself as:
|
|
24
24
|
|
25
25
|
Using `DeletedAt` is very simple. It follows a familiar pattern seen throughout the rest of the Ruby/Rails community.
|
26
26
|
|
27
|
-
```
|
27
|
+
```ruby
|
28
28
|
class User < ActiveRecord::Base
|
29
29
|
# Feel free to include/extend other modules before or after, as you see fit...
|
30
30
|
|
@@ -32,6 +32,27 @@ class User < ActiveRecord::Base
|
|
32
32
|
|
33
33
|
# the rest of your model code...
|
34
34
|
end
|
35
|
+
```
|
36
|
+
|
37
|
+
You'll (probably) need to migrate your database for `deleted_at` to work properly.
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
class AddDeletedAtColumnToUsers < ActiveRecord::Migration
|
41
|
+
|
42
|
+
def up
|
43
|
+
add_column :users, :deleted_at, 'timestamp with time zone'
|
44
|
+
|
45
|
+
DeletedAt.install(User)
|
46
|
+
end
|
47
|
+
|
48
|
+
def down
|
49
|
+
DeletedAt.uninstall(User)
|
50
|
+
|
51
|
+
remove_column :users, :deleted_at, 'timestamp with time zone'
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
```
|
35
56
|
|
36
57
|
## Development
|
37
58
|
|
data/lib/deleted_at/railtie.rb
CHANGED
@@ -9,7 +9,7 @@ module DeletedAt
|
|
9
9
|
|
10
10
|
initializer 'deleted_at.install' do
|
11
11
|
ActiveSupport.on_load(:active_record) do
|
12
|
-
::ActiveRecord::Relation.send :
|
12
|
+
::ActiveRecord::Relation.send :include, DeletedAt::ActiveRecord::Relation
|
13
13
|
::ActiveRecord::Base.send :include, DeletedAt::ActiveRecord::Base
|
14
14
|
end
|
15
15
|
end
|
data/lib/deleted_at/version.rb
CHANGED
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.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dale Stevens
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|