diff --git a/app/models/filter/resources.rb b/app/models/filter/resources.rb index bde1a30d1..85950f857 100644 --- a/app/models/filter/resources.rb +++ b/app/models/filter/resources.rb @@ -12,8 +12,6 @@ module Filter::Resources kind = resource.class.model_name.plural send "#{kind}=", send(kind).without(resource) empty? ? destroy! : save! - rescue ActiveRecord::RecordNotUnique - destroy! end def buckets diff --git a/test/models/filter_test.rb b/test/models/filter_test.rb index 7635d0ff7..6d871326c 100644 --- a/test/models/filter_test.rb +++ b/test/models/filter_test.rb @@ -89,11 +89,6 @@ class FilterTest < ActiveSupport::TestCase assert_includes filter.as_params[:bucket_ids], buckets(:writebook).id assert_includes filter.buckets, buckets(:writebook) - users(:david).filters.create! tag_ids: [ tags(:mobile).id, tags(:web).id ], bucket_ids: [ buckets(:writebook).id ] - assert_difference "Filter.count", -1 do - tags(:web).destroy! - end - assert_changes "filter.reload.updated_at" do tags(:mobile).destroy! end