acts_as_trackable 0.3.0 → 0.3.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/Gemfile.lock +1 -1
- data/README.md +12 -0
- data/changelog.md +3 -0
- data/lib/acts_as_trackable/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5bb2629a59e7f11d52350b0bb6bbc994685330a1e047d0263b6f1f7ef6158f1
|
4
|
+
data.tar.gz: f99f747270c0954dc5fd635cc1063a38df43d3d07bbd782f85f3d984aaf9673d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76482ee95e44272d123d88c9a2d99a3d240efe80d677a88ad7d5b1ad2134755c02a3b5b6399a1e40d83bce4318c04fb95c5ee9a8bc0cc13aacf10791ee91cde0
|
7
|
+
data.tar.gz: 4312bb8bbde9fbcfdc758e9589fb1af383d00b3d41fe99e0251f9ce11d11fe1417175568842cb25627704dca4630871f87979077327d715d8dcdd129842e47e3
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -45,6 +45,18 @@ After that run the following commands:
|
|
45
45
|
```ruby
|
46
46
|
acts_as_modifier
|
47
47
|
```
|
48
|
+
- For STI models, set the following attribute to true to save the child class's object type as the parent class's (base_class) object type:
|
49
|
+
```ruby
|
50
|
+
class Post < ActiveRecord::Base
|
51
|
+
self.inheritance_column = :class_name
|
52
|
+
|
53
|
+
acts_as_trackable
|
54
|
+
end
|
55
|
+
|
56
|
+
class Comment < Post
|
57
|
+
acts_as_trackable fallback_to_base_class: true
|
58
|
+
end
|
59
|
+
```
|
48
60
|
- After that, you need to pass the user to the modifier attribute from your controller(or basically anywhere) to your update/create statements as follows(If you don't pass the modifier, track me will simply ignore creating/updating the object activity):
|
49
61
|
```ruby
|
50
62
|
YourTrackableModel.update(modifier: @current_user)
|
data/changelog.md
CHANGED