Merge branch 'stable' into develop
This commit is contained in:
commit
17d0ddab41
3 changed files with 25 additions and 12 deletions
|
|
@ -68,6 +68,7 @@ With the port to Bootstrap 3, app/views/terms/default.haml has a new structure.
|
||||||
* Prevent multiple comment boxes on mobile [#6363](https://github.com/diaspora/diaspora/pull/6363)
|
* Prevent multiple comment boxes on mobile [#6363](https://github.com/diaspora/diaspora/pull/6363)
|
||||||
* Correctly display location in post preview [#6429](https://github.com/diaspora/diaspora/pull/6429)
|
* Correctly display location in post preview [#6429](https://github.com/diaspora/diaspora/pull/6429)
|
||||||
* Do not fail when submitting an empty comment in the mobile view [#6543](https://github.com/diaspora/diaspora/pull/6543)
|
* Do not fail when submitting an empty comment in the mobile view [#6543](https://github.com/diaspora/diaspora/pull/6543)
|
||||||
|
* Limit flash message width on small devices [#6529](https://github.com/diaspora/diaspora/pull/6529)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
* Support color themes [#6033](https://github.com/diaspora/diaspora/pull/6033)
|
* Support color themes [#6033](https://github.com/diaspora/diaspora/pull/6033)
|
||||||
|
|
@ -94,7 +95,7 @@ With the port to Bootstrap 3, app/views/terms/default.haml has a new structure.
|
||||||
* Correctly skip setting sidekiq logfile on Heroku [#6500](https://github.com/diaspora/diaspora/pull/6500)
|
* Correctly skip setting sidekiq logfile on Heroku [#6500](https://github.com/diaspora/diaspora/pull/6500)
|
||||||
* Fix notifications for interactions by non-contacts [#6498](https://github.com/diaspora/diaspora/pull/6498)
|
* Fix notifications for interactions by non-contacts [#6498](https://github.com/diaspora/diaspora/pull/6498)
|
||||||
* Fix issue where the publisher was broken on profile pages [#6503](https://github.com/diaspora/diaspora/pull/6503)
|
* Fix issue where the publisher was broken on profile pages [#6503](https://github.com/diaspora/diaspora/pull/6503)
|
||||||
* Limit flash message width on small devices [#6529](https://github.com/diaspora/diaspora/pull/6529)
|
* Prevent participations being created for invalid interactions [#6552](https://github.com/diaspora/diaspora/pull/6552)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
module User::SocialActions
|
module User::SocialActions
|
||||||
def comment!(target, text, opts={})
|
def comment!(target, text, opts={})
|
||||||
update_or_create_participation!(target)
|
Comment::Generator.new(self, target, text).create!(opts).tap do
|
||||||
Comment::Generator.new(self, target, text).create!(opts)
|
update_or_create_participation!(target)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def participate!(target, opts={})
|
def participate!(target, opts={})
|
||||||
|
|
@ -9,21 +10,23 @@ module User::SocialActions
|
||||||
end
|
end
|
||||||
|
|
||||||
def like!(target, opts={})
|
def like!(target, opts={})
|
||||||
update_or_create_participation!(target)
|
Like::Generator.new(self, target).create!(opts).tap do
|
||||||
Like::Generator.new(self, target).create!(opts)
|
update_or_create_participation!(target)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def participate_in_poll!(target, answer, opts={})
|
def participate_in_poll!(target, answer, opts={})
|
||||||
update_or_create_participation!(target)
|
PollParticipation::Generator.new(self, target, answer).create!(opts).tap do
|
||||||
PollParticipation::Generator.new(self, target, answer).create!(opts)
|
update_or_create_participation!(target)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def reshare!(target, opts={})
|
def reshare!(target, opts={})
|
||||||
update_or_create_participation!(target)
|
build_post(:reshare, :root_guid => target.guid).tap do |reshare|
|
||||||
reshare = build_post(:reshare, :root_guid => target.guid)
|
reshare.save!
|
||||||
reshare.save!
|
update_or_create_participation!(target)
|
||||||
Postzord::Dispatcher.defer_build_and_post(self, reshare)
|
Postzord::Dispatcher.defer_build_and_post(self, reshare)
|
||||||
reshare
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_comment(options={})
|
def build_comment(options={})
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,15 @@ describe Comment, :type => :model do
|
||||||
participations = Participation.where(target_id: comment_alice.commentable_id, author_id: comment_alice.author_id)
|
participations = Participation.where(target_id: comment_alice.commentable_id, author_id: comment_alice.author_id)
|
||||||
expect(participations.count).to eq(1)
|
expect(participations.count).to eq(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "does not create a participation if comment validation failed" do
|
||||||
|
begin
|
||||||
|
alice.comment!(status_bob, " ")
|
||||||
|
rescue ActiveRecord::RecordInvalid
|
||||||
|
end
|
||||||
|
participations = Participation.where(target_id: status_bob, author_id: alice.person.id)
|
||||||
|
expect(participations.count).to eq(0)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "counter cache" do
|
describe "counter cache" do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue