dynamic-active-model 0.3.1 → 0.3.2

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: 939a4bf825472966414c9210ace20b328cb96b3346c64c81063abf0caf2b6e88
4
- data.tar.gz: 731d11dd2939d33a0a9425258a04c51ef1b5e3c664268fad76a4164e0a04ed69
3
+ metadata.gz: cdcc2e62dea9d605f8b3d2b9082eb6e59c74a719ec83f09b4e5f3ce885e4d6e5
4
+ data.tar.gz: 4009f174fac279cbb93cbcf6b81b9eedfe04d0588aad1dda7bee9e1976331141
5
5
  SHA512:
6
- metadata.gz: 13bbbc17ce25badff6dc5c19fb675813897d80a76b65fd4d4d52562bf7ae0051536506be6f04a293d8a31e9dc2a538649bbce7a9da07c2c19cb737f37e9d14bb
7
- data.tar.gz: 3e3b46e5c905c588ad2d3885bf5b18843806ac61afece97c5a210440c1b6692578bf38a7109a9b45e20420d216b7b2efb0963a6f6a59ab102b2d44cf5f4f6ca3
6
+ metadata.gz: 5dd5dcefb823f3ffafbf16e15d4a996dbd3ca8967753c1465f8cc5952e1d3e47ea82316a4f6f7041e69064edcc8865b9ec4661798a3c133262cc7a302d7fb7e1
7
+ data.tar.gz: 5e878ef66b9fdef4fdef973a5b43ab046934739bf6f5847ed769cacb80993b1615baa7bf1f8ac5ad8656e2a5c4654601c6eab919cbc5c5d3f3c0dc814bcb253d
@@ -5,7 +5,7 @@ module DynamicActiveModel
5
5
  # from attribute_names method in ActiveRecord
6
6
  module DangerousAttributesPatch
7
7
  def self.included(base)
8
- base.singleton_class.alias_method :original_attribute_names, :attribute_names
8
+ base.singleton_class.send(:alias_method, :original_attribute_names, :attribute_names)
9
9
  base.extend ClassMethods
10
10
  end
11
11
 
@@ -63,6 +63,13 @@ module DynamicActiveModel
63
63
  @include_tables + @include_table_matchers
64
64
  end
65
65
 
66
+ def disable_standard_table_inheritance!
67
+ models.each do |model|
68
+ model.inheritance_column = :_type_disabled if model.attribute_names.include?('type')
69
+ end
70
+ end
71
+ alias disable_sti! disable_standard_table_inheritance!
72
+
66
73
  private
67
74
 
68
75
  def skip_table?(table_name)
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.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doug Youch
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-29 00:00:00.000000000 Z
11
+ date: 2020-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -44,7 +44,7 @@ homepage: https://github.com/dougyouch/dynamic-active-model
44
44
  licenses:
45
45
  - MIT
46
46
  metadata: {}
47
- post_install_message:
47
+ post_install_message:
48
48
  rdoc_options: []
49
49
  require_paths:
50
50
  - lib
@@ -59,8 +59,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0'
61
61
  requirements: []
62
- rubygems_version: 3.0.3
63
- signing_key:
62
+ rubygems_version: 3.1.2
63
+ signing_key:
64
64
  specification_version: 4
65
65
  summary: Dynamic ActiveRecord Models
66
66
  test_files: []