aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/support/stubs
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2019-01-14 17:34:44 -0500
committerGitHub <noreply@github.com>2019-01-14 17:34:44 -0500
commitfcd38cf19fa6249d5b62bbe887fde6120408e9c3 (patch)
treec0297862df6c5d706c946799310c1f754ce959b1 /activerecord/test/support/stubs
parent40da1c430bc2d8d5cd9a9349993fbdf62e68529f (diff)
parent74bef0970fff60eaf5faefde30a23f3c36c0b3ee (diff)
downloadrails-fcd38cf19fa6249d5b62bbe887fde6120408e9c3.tar.gz
rails-fcd38cf19fa6249d5b62bbe887fde6120408e9c3.tar.bz2
rails-fcd38cf19fa6249d5b62bbe887fde6120408e9c3.zip
Merge pull request #34891 from gmcgibbon/ac_params_exists
Allow strong params in ActiveRecord::Base#exists?
Diffstat (limited to 'activerecord/test/support/stubs')
-rw-r--r--activerecord/test/support/stubs/strong_parameters.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/activerecord/test/support/stubs/strong_parameters.rb b/activerecord/test/support/stubs/strong_parameters.rb
new file mode 100644
index 0000000000..acba3a4504
--- /dev/null
+++ b/activerecord/test/support/stubs/strong_parameters.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class Parameters
+ def initialize(parameters = {})
+ @parameters = parameters.with_indifferent_access
+ end
+
+ def permitted?
+ true
+ end
+
+ def to_h
+ @parameters.to_h
+ end
+end