diff --git a/app/models/card/watchable.rb b/app/models/card/watchable.rb index 8c5a3696b..f511ddc7e 100644 --- a/app/models/card/watchable.rb +++ b/app/models/card/watchable.rb @@ -13,9 +13,7 @@ module Card::Watchable end def watch_by(user) - if collection.accessible_to?(user) - watches.where(user: user).first_or_create.update!(watching: true) - end + watches.where(user: user).first_or_create.update!(watching: true) end def unwatch_by(user) diff --git a/app/models/collection/accessible.rb b/app/models/collection/accessible.rb index 1436a4d1b..fc99cc217 100644 --- a/app/models/collection/accessible.rb +++ b/app/models/collection/accessible.rb @@ -32,10 +32,6 @@ module Collection::Accessible accesses.find_by(user: user) end - def accessible_to?(user) - access_for(user).present? - end - private def grant_access_to_everyone accesses.grant_to(User.all) if all_access_previously_changed?(to: true) diff --git a/app/models/user/accessor.rb b/app/models/user/accessor.rb index ebf5dde59..89534b777 100644 --- a/app/models/user/accessor.rb +++ b/app/models/user/accessor.rb @@ -9,10 +9,6 @@ module User::Accessor after_create_commit :grant_access_to_collections end - def can_access_card?(card) - card.collection.accessible_to?(self) - end - private def grant_access_to_collections Access.insert_all Collection.all_access.pluck(:id).collect { |collection_id| { collection_id: collection_id, user_id: id } }