aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/support/stubs
diff options
context:
space:
mode:
authorbogdanvlviv <bogdanvlviv@gmail.com>2019-01-17 20:10:01 +0000
committerbogdanvlviv <bogdanvlviv@gmail.com>2019-01-17 20:10:01 +0000
commit6410c70f7caa5045e2f12ebd7aab8d8b6d3e6a0b (patch)
treeec16165424d31dd24f364bf28591cbee63b06a54 /activerecord/test/support/stubs
parent2dee59fed1e78b983aed4db53dc8fc59e49b9200 (diff)
downloadrails-6410c70f7caa5045e2f12ebd7aab8d8b6d3e6a0b.tar.gz
rails-6410c70f7caa5045e2f12ebd7aab8d8b6d3e6a0b.tar.bz2
rails-6410c70f7caa5045e2f12ebd7aab8d8b6d3e6a0b.zip
Ensure that AR::Relation#exists? allows only permitted params
Clarify changelog entry Related to #34891
Diffstat (limited to 'activerecord/test/support/stubs')
-rw-r--r--activerecord/test/support/stubs/strong_parameters.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/activerecord/test/support/stubs/strong_parameters.rb b/activerecord/test/support/stubs/strong_parameters.rb
index acba3a4504..84f93a28b9 100644
--- a/activerecord/test/support/stubs/strong_parameters.rb
+++ b/activerecord/test/support/stubs/strong_parameters.rb
@@ -3,10 +3,16 @@
class Parameters
def initialize(parameters = {})
@parameters = parameters.with_indifferent_access
+ @permitted = false
end
def permitted?
- true
+ @permitted
+ end
+
+ def permit!
+ @permitted = true
+ self
end
def to_h