deleted_at 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: ee93e0bf9a77ac398902a8c79ba43f1561b86033
4
- data.tar.gz: 8029a0f75a4537d12133c31a8558ab5cc2efcf6b
3
+ metadata.gz: f21d27f294c651f6dbae4c1fb608081a50e61a77
4
+ data.tar.gz: 3891be06e90471eab8c7f2be5ec695f1f3dd068d
5
5
  SHA512:
6
- metadata.gz: 54813d5862acc4864dc9daeada10f7bce78aea8e7f3488cb69cf29e8c50ea97141a7a32eed712aa5b4ec21bd97b7fc1f17f5c929709d4cfcfec278376a369885
7
- data.tar.gz: b14aefcb95ebac5d43d76230b0cde74b485e1120d0bbfd7f1e5d698238966a57152cf1e253060fc1bf1d3f711e800b2cc8735eefd8208bff4d3cf2e4e7473e16
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
 
@@ -5,6 +5,7 @@ module DeletedAt
5
5
  module Relation
6
6
 
7
7
  def deleted_at_attributes
8
+ # We _do_ have klass at this point
8
9
  { klass.deleted_at_column => Time.now.utc }
9
10
  end
10
11
 
@@ -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 :prepend, DeletedAt::ActiveRecord::Relation
12
+ ::ActiveRecord::Relation.send :include, DeletedAt::ActiveRecord::Relation
13
13
  ::ActiveRecord::Base.send :include, DeletedAt::ActiveRecord::Base
14
14
  end
15
15
  end
@@ -1,3 +1,3 @@
1
1
  module DeletedAt
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-30 00:00:00.000000000 Z
11
+ date: 2017-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord