Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Renamed methods

  • Loading branch information...
commit bfccd8246b6ce3303401fa5bb2feae85d62277ae 1 parent dbc2cce
@cmer authored
View
8 lib/socialization/stores/active_record/follow.rb
@@ -98,14 +98,14 @@ def followables(follower, klass, opts = {})
end
end
- # Destroy all the followers for followable
- def destroy_followers(followable)
+ # Remove all the followers for followable
+ def remove_followers(followable)
self.where(:followable_type => followable.class.name.classify).
where(:followable_id => followable.id).destroy_all
end
- # Destroy all the followables for follower
- def destroy_followables(follower)
+ # Remove all the followables for follower
+ def remove_followables(follower)
self.where(:follower_type => follower.class.name.classify).
where(:follower_id => follower.id).destroy_all
end
View
8 lib/socialization/stores/active_record/like.rb
@@ -98,14 +98,14 @@ def likeables(liker, klass, opts = {})
end
end
- # Destroy all the likers for likeable
- def destroy_likers(likeable)
+ # Remove all the likers for likeable
+ def remove_likers(likeable)
self.where(:likeable_type => likeable.class.name.classify).
where(:likeable_id => likeable.id).destroy_all
end
- # Destroy all the likeables for liker
- def destroy_likeables(liker)
+ # Remove all the likeables for liker
+ def remove_likeables(liker)
self.where(:liker_type => liker.class.name.classify).
where(:liker_id => liker.id).destroy_all
end
View
8 lib/socialization/stores/active_record/mention.rb
@@ -98,14 +98,14 @@ def mentionables(mentioner, klass, opts = {})
end
end
- # Destroy all the mentioners for mentionable
- def destroy_mentioners(mentionable)
+ # Remove all the mentioners for mentionable
+ def remove_mentioners(mentionable)
self.where(:mentionable_type => mentionable.class.name.classify).
where(:mentionable_id => mentionable.id).destroy_all
end
- # Destroy all the mentionables for mentioner
- def destroy_mentionables(mentioner)
+ # Remove all the mentionables for mentioner
+ def remove_mentionables(mentioner)
self.where(:mentioner_type => mentioner.class.name.classify).
where(:mentioner_id => mentioner.id).destroy_all
end
View
8 test/stores/active_record/follow_store_test.rb
@@ -108,20 +108,20 @@ class ActiveRecordFollowStoreTest < Test::Unit::TestCase
end
end
- context "#destroy_followers" do
+ context "#remove_followers" do
should "delete all followers relationships for a followable" do
@follower.follow!(@followable)
assert_equal 1, @followable.followers(@follower.class).count
- @klass.destroy_followers(@followable)
+ @klass.remove_followers(@followable)
assert_equal 0, @followable.followers(@follower.class).count
end
end
- context "#destroy_followables" do
+ context "#remove_followables" do
should "delete all followables relationships for a follower" do
@follower.follow!(@followable)
assert_equal 1, @follower.followables(@followable.class).count
- @klass.destroy_followables(@follower)
+ @klass.remove_followables(@follower)
assert_equal 0, @follower.followables(@followable.class).count
end
end
View
8 test/stores/active_record/like_store_test.rb
@@ -108,20 +108,20 @@ class ActiveRecordLikeStoreTest < Test::Unit::TestCase
end
end
- context "#destroy_likers" do
+ context "#remove_likers" do
should "delete all likers relationships for a likeable" do
@liker.like!(@likeable)
assert_equal 1, @likeable.likers(@liker.class).count
- @klass.destroy_likers(@likeable)
+ @klass.remove_likers(@likeable)
assert_equal 0, @likeable.likers(@liker.class).count
end
end
- context "#destroy_likeables" do
+ context "#remove_likeables" do
should "delete all likeables relationships for a liker" do
@liker.like!(@likeable)
assert_equal 1, @liker.likeables(@likeable.class).count
- @klass.destroy_likeables(@liker)
+ @klass.remove_likeables(@liker)
assert_equal 0, @liker.likeables(@likeable.class).count
end
end
View
8 test/stores/active_record/mention_store_test.rb
@@ -108,20 +108,20 @@ class ActiveRecordMentionStoreTest < Test::Unit::TestCase
end
end
- context "#destroy_mentioners" do
+ context "#remove_mentioners" do
should "delete all mentioners relationships for a mentionable" do
@mentioner.mention!(@mentionable)
assert_equal 1, @mentionable.mentioners(@mentioner.class).count
- @klass.destroy_mentioners(@mentionable)
+ @klass.remove_mentioners(@mentionable)
assert_equal 0, @mentionable.mentioners(@mentioner.class).count
end
end
- context "#destroy_mentionables" do
+ context "#remove_mentionables" do
should "delete all mentionables relationships for a mentioner" do
@mentioner.mention!(@mentionable)
assert_equal 1, @mentioner.mentionables(@mentionable.class).count
- @klass.destroy_mentionables(@mentioner)
+ @klass.remove_mentionables(@mentioner)
assert_equal 0, @mentioner.mentionables(@mentionable.class).count
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.