diff options
author | Benjamin Neff <benjamin@coding4coffee.ch> | 2015-05-19 03:23:19 +0300 |
---|---|---|
committer | Jonne Haß <me@jhass.eu> | 2015-05-19 11:42:39 +0300 |
commit | 9a4a7255e7419569d0cb5a217e71384e9d250e83 (patch) | |
tree | 241b9e52304e8e236566cfdb9d9375a712a20f63 | |
parent | 289753e068bd351f1916d4ca280ed68cba38ad2e (diff) |
remove unused older and newer methods for posts
last renamed in 8386179f1621ee96989494fa299a0666491d0757
closes #5970
-rw-r--r-- | Changelog.md | 1 | ||||
-rw-r--r-- | app/models/post.rb | 8 | ||||
-rw-r--r-- | spec/models/post_spec.rb | 15 |
3 files changed, 1 insertions, 23 deletions
diff --git a/Changelog.md b/Changelog.md index 6ace83e70..54c1d22a6 100644 --- a/Changelog.md +++ b/Changelog.md @@ -11,6 +11,7 @@ * Remove unused `hasPhotos` and `hasText` functions [#5969](https://github.com/diaspora/diaspora/pull/5969) * Replace foreman with eye [#5966](https://github.com/diaspora/diaspora/pull/5966) * Improved handling of reshares with deleted roots [#5968](https://github.com/diaspora/diaspora/pull/5968) +* Remove two unused methods [#5970](https://github.com/diaspora/diaspora/pull/5970) ## Bug fixes * Disable auto follow back on aspect deletion [#5846](https://github.com/diaspora/diaspora/pull/5846) diff --git a/app/models/post.rb b/app/models/post.rb index cd3f369b0..3a5636922 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -52,14 +52,6 @@ class Post < ActiveRecord::Base joins(:likes).where(:likes => {:author_id => person.id}) } - def self.newer(post) - where("posts.created_at > ?", post.created_at).reorder('posts.created_at ASC').first - end - - def self.older(post) - where("posts.created_at < ?", post.created_at).reorder('posts.created_at DESC').first - end - def self.visible_from_author(author, current_user=nil) if current_user.present? current_user.posts_from(author) diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb index da641ff26..795c74b59 100644 --- a/spec/models/post_spec.rb +++ b/spec/models/post_spec.rb @@ -149,21 +149,6 @@ describe Post, :type => :model do end end - - # @posts[0] is the newest, @posts[5] is the oldest - describe ".newer" do - it 'returns the next post in the array' do - expect(@posts[3].created_at).to be < @posts[2].created_at #post 2 is newer - expect(Post.newer(@posts[3]).created_at.to_s).to eq(@posts[2].created_at.to_s) #its the newer post, not the newest - end - end - - describe ".older" do - it 'returns the previous post in the array' do - expect(Post.older(@posts[3]).created_at.to_s).to eq(@posts[4].created_at.to_s) #its the older post, not the oldest - expect(@posts[3].created_at).to be > @posts[4].created_at #post 4 is older - end - end end end |