Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-05-19 07:58:21 +0300
committerStan Hu <stanhu@gmail.com>2019-05-22 09:19:07 +0300
commit52d24e66cec1fa6c0100adb64effd2073869cd8b (patch)
tree86051c00dc257c49769c5f1ccff5769f2580d69c /spec
parentc342c07899ef6637eef7c1df2534f0c5ea67d7bd (diff)
Bump shoulda-matchers to 4.0.1
This removes the warning when using Ruby 2.6: BigDecimal.new is deprecated; use BigDecimal() method instead. This also adds Rails 5 support, which eliminates the need for the monkey patch to handle https://github.com/thoughtbot/shoulda-matchers/issues/913.
Diffstat (limited to 'spec')
-rw-r--r--spec/support/shoulda/matchers/rails_shim.rb27
1 files changed, 0 insertions, 27 deletions
diff --git a/spec/support/shoulda/matchers/rails_shim.rb b/spec/support/shoulda/matchers/rails_shim.rb
deleted file mode 100644
index 8d70598beb5..00000000000
--- a/spec/support/shoulda/matchers/rails_shim.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# monkey patch which fixes serialization matcher in Rails 5
-# https://github.com/thoughtbot/shoulda-matchers/issues/913
-# This can be removed when a new version of shoulda-matchers
-# is released
-module Shoulda
- module Matchers
- class RailsShim
- def self.serialized_attributes_for(model)
- if defined?(::ActiveRecord::Type::Serialized)
- # Rails 5+
- serialized_columns = model.columns.select do |column|
- model.type_for_attribute(column.name).is_a?(
- ::ActiveRecord::Type::Serialized
- )
- end
-
- serialized_columns.inject({}) do |hash, column| # rubocop:disable Style/EachWithObject
- hash[column.name.to_s] = model.type_for_attribute(column.name).coder
- hash
- end
- else
- model.serialized_attributes
- end
- end
- end
- end
-end