rest_rails 1.1.8 → 1.1.9

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: 200b9569c1dae09a67cb8f6b545c045bc0a204881cb9b28534aa7c6cb3e43eb4
4
- data.tar.gz: 88dedfe22ac6693bef11331a85a7b3f884b709f26ed54beadf596bd57de4be34
3
+ metadata.gz: 4bbf6117c22067039afe036aba247c3f20ac9ba930e3d1140349e70aaaf67d01
4
+ data.tar.gz: 88f538adec8d1fd23e67462434fd0845b511777313e30291937c6f89910a51a1
5
5
  SHA512:
6
- metadata.gz: 8727d575c1e4996f3008d14f21d0431b3c0b55ea7a55b267c6a530ec0dbfcf72507a03927de11b4cea082514a23b0f43604714d721eb732dbf61e669aca3c1be
7
- data.tar.gz: 3a5a4b9375a2a4fd6de6fc89743b92a822199914c33797b1d4acce859c5a53f7de057d48e65f853b7e0a9ac254d9bc17f026ffa820d3c05a9d5d23e7a8a5c4b1
6
+ metadata.gz: 9edb560515e507117c98bab2b05d483ab0a0e9455ead8bc820a9ab6d66d608d62dd8c6e8f640e8cac4f7d3e02a2943edb8ce258136659bb999c4a8173478a254
7
+ data.tar.gz: d8758148705b26ce8d1dbcf5cce5c55d501ddc326e417b2a19c65aab8165ddf7994a32bb949de530cd307fdfc5d3185f1af14a10064df937eaf5c601c93a70b2
@@ -87,11 +87,9 @@ module RestRails
87
87
  # ==========================================================================
88
88
 
89
89
  def model_for(table_name)
90
- ignored = ["active_storage_blobs", "active_storage_attachments",
91
- "schema_migrations", "ar_internal_metadata"]
92
- tables = ActiveRecord::Base.connection.tables.reject{ |x| ignored.include?(x) }
90
+ tables = ActiveRecord::Base.descendants.reject(&:abstract_class).index_by(&:table_name)
93
91
 
94
- raise RestRails::Error.new "Table '#{table_name}' does not exist in your database!" unless tables.include?(table_name)
92
+ raise RestRails::Error.new "Table '#{table_name}' does not exist in your database!" unless tables.keys.include?(table_name)
95
93
 
96
94
  # Take the tablename, and make the Model of the relative table_name
97
95
  table_name.classify.constantize # "users" => User
@@ -1,3 +1,3 @@
1
1
  module RestRails
2
- VERSION = '1.1.8'
2
+ VERSION = '1.1.9'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.8
4
+ version: 1.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Rivas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-16 00:00:00.000000000 Z
11
+ date: 2021-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails