Skip to content

Commit

Permalink
Initialize post with site instance
Browse files Browse the repository at this point in the history
  • Loading branch information
krasnoukhov committed Mar 11, 2015
1 parent 52d40fd commit f977d70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/octodmin/post.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ def self.create(options = {})
rescue RuntimeError
end

def initialize(post)
def initialize(site, post)
@site = site
@post = post
@site = Octodmin::Site.new
end

def path
Expand Down
2 changes: 1 addition & 1 deletion lib/octodmin/site.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def serializable_hash
def posts
reset
@site.read
@site.posts.sort_by(&:date).last(20).reverse.map { |post| Post.new(post) }
@site.posts.sort_by(&:date).last(20).reverse.map { |post| Post.new(self, post) }
end

def reset
Expand Down

0 comments on commit f977d70

Please sign in to comment.