aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/support/stubs/strong_parameters.rb
blob: 84f93a28b9607f19a70f630fc71b1b4b1b3b3824 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

class Parameters
  def initialize(parameters = {})
    @parameters = parameters.with_indifferent_access
    @permitted = false
  end

  def permitted?
    @permitted
  end

  def permit!
    @permitted = true
    self
  end

  def to_h
    @parameters.to_h
  end
end