Skip to content
Browse files

Merge remote branch 'upstream/master'

  • Loading branch information...
2 parents 9cbff44 + e0d50c8 commit b26b541424504786dbaf0ce9ab94681c421cbe6b @dmorley dmorley committed Oct 24, 2012
Showing with 16 additions and 2 deletions.
  1. +4 −0 Changelog.md
  2. +1 −1 app/presenters/post_presenter.rb
  3. +1 −1 config/defaults.yml
  4. +10 −0 spec/presenters/post_presenter_spec.rb
View
4 Changelog.md
@@ -1,3 +1,7 @@
+# 0.0.1.2
+
+Fix exception when the root of a reshare of a reshare got deleted [#3546](https://github.com/diaspora/diaspora/issues/3546)
+
# 0.0.1.1
Fix syntax error in French Javascript pluralization rule.
View
2 app/presenters/post_presenter.rb
@@ -63,7 +63,7 @@ def template_name #kill me, lol, I should be client side
end
def root
- PostPresenter.new(@post.absolute_root, current_user).as_json if @post.respond_to?(:root) && @post.root.present?
+ PostPresenter.new(@post.absolute_root, current_user).as_json if @post.respond_to?(:absolute_root) && @post.absolute_root.present?
end
def user_like
View
2 config/defaults.yml
@@ -4,7 +4,7 @@
defaults:
version:
- number: "0.0.1.1"
+ number: "0.0.1.2"
release: true # Do not touch unless in a merge conflict on doing a release, master should have a commit setting this to true which is not backported to the develop branch.
heroku: false
environment:
View
10 spec/presenters/post_presenter_spec.rb
@@ -44,6 +44,16 @@
end
describe '#root' do
+ it 'does not raise if the absolute_root does not exists' do
+ first_reshare = FactoryGirl.create :reshare
+ first_reshare.root = nil
+ reshare = FactoryGirl.create :reshare, :root => first_reshare
+
+ expect {
+ PostPresenter.new(reshare).root
+ }.to_not raise_error
+ end
+
it 'does not raise if the root does not exists' do
reshare = FactoryGirl.create:reshare
reshare.root = nil

0 comments on commit b26b541

Please sign in to comment.
Something went wrong with that request. Please try again.