* Refactored PostSet, splitting it into PostSets::Post and PostSets::Favorite
* Additional functional tests
This commit is contained in:
18
app/logical/post_sets/favorite.rb
Normal file
18
app/logical/post_sets/favorite.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
module PostSets
|
||||
class FavoriteSet < Base
|
||||
attr_accessor :user
|
||||
|
||||
def initialize(options = {})
|
||||
super(options)
|
||||
@user = user
|
||||
end
|
||||
|
||||
def tags
|
||||
"fav:#{user.name}"
|
||||
end
|
||||
|
||||
def load_posts
|
||||
user.favorite_posts(:before_id => before_id)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user