Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added *ees alias methods

  • Loading branch information...
commit f956ba4a10cba2f5e090732da55082aeb2f71e20 1 parent 2840270
@cmer authored
View
2  lib/socialization/actors/follower.rb
@@ -68,6 +68,7 @@ def follows?(followable)
def followables(klass, opts = {})
Socialization.follow_model.followables(self, klass, opts)
end
+ alias :followees :followables
# Returns a relation for all the followables of a certain type that are followed by self
#
@@ -77,6 +78,7 @@ def followables(klass, opts = {})
def followables_relation(klass, opts = {})
Socialization.follow_model.followables_relation(self, klass, opts)
end
+ alias :followees_relation :followables_relation
end
end
end
View
2  lib/socialization/actors/liker.rb
@@ -68,6 +68,7 @@ def likes?(likeable)
def likeables(klass, opts = {})
Socialization.like_model.likeables(self, klass, opts)
end
+ alias :likees :likeables
# Returns a relation for all the likeables of a certain type that are liked by self
#
@@ -77,6 +78,7 @@ def likeables(klass, opts = {})
def likeables_relation(klass, opts = {})
Socialization.like_model.likeables_relation(self, klass, opts)
end
+ alias :likees_relation :likeables_relation
end
end
end
View
2  lib/socialization/actors/mentioner.rb
@@ -68,6 +68,7 @@ def mentions?(mentionable)
def mentionables(klass, opts = {})
Socialization.mention_model.mentionables(self, klass, opts)
end
+ alias :mentionees :mentionables
# Returns a relation for all the mentionables of a certain type that are mentioned by self
#
@@ -77,6 +78,7 @@ def mentionables(klass, opts = {})
def mentionables_relation(klass, opts = {})
Socialization.mention_model.mentionables_relation(self, klass, opts)
end
+ alias :mentionees_relation :mentionables_relation
end
end
end
View
15 test/actors/follower_test.rb
@@ -71,11 +71,26 @@ class FollowerTest < Test::Unit::TestCase
end
end
+ context "#followees" do
+ should "call $Follow.followables" do
+ $Follow.expects(:followables).with(@follower, @followable.class, { :foo => :bar })
+ @follower.followees(@followable.class, { :foo => :bar })
+ end
+ end
+
context "#followables_relation" do
should "call $Follow.followables_relation" do
$Follow.expects(:followables_relation).with(@follower, @followable.class, { :foo => :bar })
@follower.followables_relation(@followable.class, { :foo => :bar })
end
end
+
+ context "#followees_relation" do
+ should "call $Follow.followables_relation" do
+ $Follow.expects(:followables_relation).with(@follower, @followable.class, { :foo => :bar })
+ @follower.followees_relation(@followable.class, { :foo => :bar })
+ end
+ end
+
end
end
View
15 test/actors/liker_test.rb
@@ -71,11 +71,26 @@ class LikerTest < Test::Unit::TestCase
end
end
+ context "#likees" do
+ should "call $Like.likeables" do
+ $Like.expects(:likeables).with(@liker, @likeable.class, { :foo => :bar })
+ @liker.likees(@likeable.class, { :foo => :bar })
+ end
+ end
+
context "#likeables_relation" do
should "call $Follow.likeables_relation" do
$Like.expects(:likeables_relation).with(@liker, @likeable.class, { :foo => :bar })
@liker.likeables_relation(@likeable.class, { :foo => :bar })
end
end
+
+ context "#likees_relation" do
+ should "call $Follow.likeables_relation" do
+ $Like.expects(:likeables_relation).with(@liker, @likeable.class, { :foo => :bar })
+ @liker.likees_relation(@likeable.class, { :foo => :bar })
+ end
+ end
+
end
end
View
14 test/actors/mentioner_test.rb
@@ -71,11 +71,25 @@ class MentionerTest < Test::Unit::TestCase
end
end
+ context "#mentionees" do
+ should "call $Mention.mentionables" do
+ $Mention.expects(:mentionables).with(@mentioner, @mentionable.class, { :foo => :bar })
+ @mentioner.mentionees(@mentionable.class, { :foo => :bar })
+ end
+ end
+
context "#mentionables_relation" do
should "call $Mention.mentionables_relation" do
$Mention.expects(:mentionables_relation).with(@mentioner, @mentionable.class, { :foo => :bar })
@mentioner.mentionables_relation(@mentionable.class, { :foo => :bar })
end
end
+
+ context "#mentionees_relation" do
+ should "call $Mention.mentionables_relation" do
+ $Mention.expects(:mentionables_relation).with(@mentioner, @mentionable.class, { :foo => :bar })
+ @mentioner.mentionees_relation(@mentionable.class, { :foo => :bar })
+ end
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.