dynamic-active-model 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f0fe4e4064390696aa981937739deee953d59afc4e3ace67e597a21c407483c1
4
- data.tar.gz: 7bc960979b944ec721c0c401cbbce323b39a151b8f52751e2810297ecab498d0
3
+ metadata.gz: 20969c7130d6dd1e4d9fd94404fa7c1429657bcf8c2f7a952521e3518585b2d3
4
+ data.tar.gz: 8e0ac474187143c277e4a6534d22a7755a7866bc7f1369c4134502b2e9bf702c
5
5
  SHA512:
6
- metadata.gz: b90fa124c1995a18afa313c22c7d15eb93b7452478ad46b418db4eb406f0bfe6edf880b9286b80e67b3d1b0d6cd5288403a69119e7d93daa28053d76effbda11
7
- data.tar.gz: a3cbf4d03d86d9984973725bf94227e93c353cb8109801885da1934d27d22b79fde4c307f138bd66654ff2737c8478550a1d2cdfc42e121639477f4f5a55cee8
6
+ metadata.gz: e389fb994f7dfc8231f9d464ec5306328c819826b699da3b77345650d2fa7227d1c03cf743334aa4a6ba9a9f1ea6341adc50373a0a14f734c6650aa972fd52d9
7
+ data.tar.gz: cb2dfb3348ee6d301154214a0e51ac638f54779cecfa10d398812845d41531f8f57b7ae4e286d5f393cdbfcf12cb49c629bd4af3c818ca9bc2316c1a645293e3
@@ -5,16 +5,9 @@ module DynamicActiveModel
5
5
  # from attribute_names method in ActiveRecord
6
6
  module DangerousAttributesPatch
7
7
  def self.included(base)
8
- base.singleton_class.send(:alias_method, :original_attribute_names, :attribute_names)
9
- base.extend ClassMethods
10
- end
11
-
12
- # no-doc
13
- module ClassMethods
14
- def attribute_names
15
- names = original_attribute_names.dup
16
- names.reject! { |name| dangerous_attribute_method?(name) }
17
- names
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
18
11
  end
19
12
  end
20
13
  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.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doug Youch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-01 00:00:00.000000000 Z
11
+ date: 2022-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord