public_activity 0.5.2 → 0.5.3
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.
- data/lib/public_activity/activist.rb +5 -4
- data/lib/public_activity/version.rb +1 -1
- metadata +2 -2
@@ -13,9 +13,10 @@ module PublicActivity
|
|
13
13
|
|
14
14
|
# Module extending classes that serve as owners
|
15
15
|
module ClassMethods
|
16
|
-
# Adds
|
16
|
+
# Adds ActiveRecord associations to model to simplify fetching
|
17
17
|
# so you can list activities performed by the owner.
|
18
|
-
# It is completely optional
|
18
|
+
# It is completely optional. Any model can be an owner to an activity
|
19
|
+
# even without being an explicit activist.
|
19
20
|
#
|
20
21
|
# == Usage:
|
21
22
|
# In model:
|
@@ -28,8 +29,8 @@ module PublicActivity
|
|
28
29
|
# User.first.activities
|
29
30
|
#
|
30
31
|
def activist
|
31
|
-
has_many :
|
32
|
-
has_many :
|
32
|
+
has_many :activities_as_owner, :class_name => "PublicActivity::Activity", :as => :owner
|
33
|
+
has_many :activities_as_recipient, :class_name => "PublicActivity::Activity", :as => :recipient
|
33
34
|
end
|
34
35
|
end
|
35
36
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: public_activity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-12-
|
13
|
+
date: 2012-12-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|