dynamic-active-model 0.4.5 → 0.4.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6cc8a936668196298890d1703df7418953b9fa0c6bc661b9bec5d442ada28cf8
4
- data.tar.gz: 7a133dd3834b1cf33b6258c5e51b1e2f82054c08c1c9d1b98ccd0db35336fc57
3
+ metadata.gz: 887a1be666cb15d06e0f517caec88c00513145e96972356ecaae580f5490598a
4
+ data.tar.gz: e5e842896b857a0dcdca0c3f03f57557cb5535f59be6dd3d5187eda291e3f895
5
5
  SHA512:
6
- metadata.gz: 0eeafeee961ab25a6bb201eed73c4086b12e29d87d0874c826b8f875f70af7a1438956424eb8d29544aacddce7e3e29a005c2eafaddc426c5fe101c4ae869142
7
- data.tar.gz: 4bd58dacf41d7ef8935592efa9ff3607b55f30b5d172a0350963aa905cd6100320b58b324ff671f0866470993a206b2cb663439690008edf74f619fdabf64502
6
+ metadata.gz: 2dc58c66d022476449054c486ceff7246367884e22a8752e73faf9cacec169a13a6a8af015aa9168f10934789be0da86920c781185456b9802762a3e9f274fac
7
+ data.tar.gz: acf7207e5939a47d99e2f4e4c6375347da7353b29ebfbf34d6356bc71e1882445239b333a58f621de89117f46ce29fc260cf22d9b7b7e658e7ab17a92cf3cac1
@@ -6,8 +6,15 @@ module DynamicActiveModel
6
6
  module DangerousAttributesPatch
7
7
  def self.included(base)
8
8
  if base.attribute_names
9
- columns_to_ignore = base.attribute_names.select { |name| base.dangerous_attribute_method?(name) }
10
- base.ignored_columns = columns_to_ignore
9
+ columns_to_ignore = base.columns.select do |column|
10
+ if column.type == :boolean
11
+ base.dangerous_attribute_method?(column.name) ||
12
+ base.dangerous_attribute_method?(column.name + '?')
13
+ else
14
+ base.dangerous_attribute_method?(column.name)
15
+ end
16
+ end
17
+ base.ignored_columns = columns_to_ignore.map(&:name)
11
18
  end
12
19
  end
13
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamic-active-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doug Youch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-31 00:00:00.000000000 Z
11
+ date: 2023-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord