lib/socialization/actors/follower.rb in socialization-cassandra-0.0.6.pre.alpha vs lib/socialization/actors/follower.rb in socialization-cassandra-0.0.7.pre.alpha
- old
+ new
@@ -15,13 +15,13 @@
# Create a new {Follow follow} relationship.
#
# @param [Followable] followable the object to be followed.
# @return [Boolean]
- def follow!(followable)
+ def follow!(followable, opts = {})
raise Socialization::ArgumentError, "#{followable} is not followable!" unless followable.respond_to?(:is_followable?) && followable.is_followable?
- Socialization.follow_model.follow!(self, followable)
+ Socialization.follow_model.follow!(self, followable, opts)
end
# Delete a {Follow follow} relationship.
#
# @param [Followable] followable the object to unfollow.
@@ -33,16 +33,16 @@
# Toggles a {Follow follow} relationship.
#
# @param [Followable] followable the object to follow/unfollow.
# @return [Boolean]
- def toggle_follow!(followable)
+ def toggle_follow!(followable, opts = {})
raise Socialization::ArgumentError, "#{followable} is not followable!" unless followable.respond_to?(:is_followable?) && followable.is_followable?
if follows?(followable)
unfollow!(followable)
false
else
- follow!(followable)
+ follow!(followable, opts)
true
end
end
# Specifies if self follows a {Followable} object.