spec/dummy/app/models/user.rb in private_person-0.3.0 vs spec/dummy/app/models/user.rb in private_person-0.3.1

- old
+ new

@@ -1,11 +1,20 @@ class User < ActiveRecord::Base - acts_as_follower - acts_as_followable - acts_as_permissor :of => [:following_users, :user_followers, :following_of_followings, :follower_of_followers], :class_name => 'User' + def follow(user) + ChalkDust.subscribe(self, :to => user) + end + + def following_users + ChalkDust.publishers_of(self) + end + + def user_followers + ChalkDust.subscribers_of(self) + end + def following_of_followings ids = [] for user in following_users ids |= user.following_users end @@ -16,15 +25,7 @@ ids = [] for user in user_followers ids |= user.user_followers end User.where(:id => ids) - end - - def is_following_user_of?(item) - self.followed_by?(item) - end - - def is_user_follower_of?(item) - item.followed_by?(self) end end