Merge pull request #8254 from tclaus/8106_set_contact_status_on_account_migration

Migration: set share status in contacts

closes #8106
This commit is contained in:
Benjamin Neff 2021-07-13 01:31:33 +02:00
commit 2e6ae8c967
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
3 changed files with 5 additions and 5 deletions

View file

@ -32,7 +32,7 @@ Although the chat was never enabled per default and was marked as experimental,
## Features
* Add client-side cropping of profile image uploads [#7581](https://github.com/diaspora/diaspora/pull/7581)
* Add client-site rescaling of post images if they exceed the maximum possible size [#7734](https://github.com/diaspora/diaspora/pull/7734)
* Add backend for archive import [#7660](https://github.com/diaspora/diaspora/pull/7660)
* Add backend for archive import [#7660](https://github.com/diaspora/diaspora/pull/7660) [#8254](https://github.com/diaspora/diaspora/pull/8254)
* For pods running PostgreSQL, make sure that no upper-case/mixed-case tags exist, and create a `lower(name)` index on tags to speed up ActsAsTaggableOn [#8206](https://github.com/diaspora/diaspora/pull/8206)
* Allow podmins/moderators to see all local public posts to improve moderation [#8232](https://github.com/diaspora/diaspora/pull/8232)

View file

@ -34,7 +34,7 @@ class ArchiveImporter
def create_contact
person = Person.by_account_identifier(json.fetch("account_id"))
user.contacts.create!(person_id: person.id, sharing: false, receiving: json.fetch("receiving"))
user.contacts.create!(person_id: person.id, sharing: json.fetch("sharing"), receiving: json.fetch("receiving"))
end
end
end

View file

@ -287,17 +287,17 @@ describe MigrationService do
contact = user.contacts.find_by(person: Person.by_account_identifier(contact1_diaspora_id))
expect(contact).not_to be_nil
expect(contact.sharing).to be_falsey
expect(contact.sharing).to be_truthy
expect(contact.receiving).to be_falsey
contact = user.contacts.find_by(person: Person.by_account_identifier(contact2_diaspora_id))
expect(contact).not_to be_nil
expect(contact.sharing).to be_falsey
expect(contact.sharing).to be_truthy
expect(contact.receiving).to be_truthy
contact = user.contacts.find_by(person: Person.by_account_identifier(migrated_contact_new_diaspora_id))
expect(contact).not_to be_nil
expect(contact.sharing).to be_falsey
expect(contact.sharing).to be_truthy
expect(contact.receiving).to be_truthy
aspect = user.aspects.find_by(name: "Friends")