rails_db 2.0.1 → 2.0.2

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
  SHA1:
3
- metadata.gz: 0744148ce1143f0b21fb547f3e31c94fb93b212f
4
- data.tar.gz: a823e510d679989cea7319df6265309035b7a790
3
+ metadata.gz: 10dbc8b9c76a8fc36b5be202bcf3fd8ca221ccbc
4
+ data.tar.gz: 74d578d77d640bf1f48eadd947d0689bcc04ae1a
5
5
  SHA512:
6
- metadata.gz: 182ea1b5b3fc17b55f43dbfad20830ba21c3e7c99e27b43f053a2c79debb38816b192c81f27a0cf8c4733a40d86bd8c7114f2e8f81c7e67a82f2ada95537daa5
7
- data.tar.gz: 2bd6b7cb10474a435e22383da90a99c8afe968c911a47f98f51cdd39c98a1d99ea15090742bfb8bd5cab5fc8366de7a4e5634d9c8ed88e6b817f85f146f342cc
6
+ metadata.gz: c363fe57bfb187af161d0b04468aa23992991edc6d163a1d64d1957b7fb0a958c04c9e8566a394f9a2d1cf3123f2c494cfb63c4096c1aa979ec9be710cf666b9
7
+ data.tar.gz: de98dbd0da65b2e8ced8880ed88ea458a5f57bb1b2e8576275b7744cc1fe3f8a7814aa952be8688e37d9315a40f112d46ec637b831bec81ac0017c22e16221c3
@@ -12,7 +12,7 @@ GIT
12
12
  PATH
13
13
  remote: .
14
14
  specs:
15
- rails_db (2.0.0)
15
+ rails_db (2.0.1)
16
16
  codemirror-rails
17
17
  kaminari
18
18
  rails (>= 5.0.0)
@@ -1,5 +1,22 @@
1
1
  module RailsDb
2
2
  module ApplicationHelper
3
+
4
+ def rails_db
5
+ super
6
+ rescue NameError
7
+ guess_name
8
+ end
9
+
10
+ # in case engine was added in namespace
11
+ def guess_name
12
+ sections = request.path.split('/').reject(&:blank?)
13
+ if sections.size > 1
14
+ sections[-1] = 'rails_db'
15
+ variable = sections.join("_")
16
+ result = eval(variable)
17
+ end
18
+ end
19
+
3
20
  def rails_db_tables
4
21
  RailsDb::Database.accessible_tables
5
22
  end
@@ -1,3 +1,3 @@
1
1
  module RailsDb
2
- VERSION = "2.0.1"
2
+ VERSION = "2.0.2"
3
3
  end
@@ -87,6 +87,12 @@ class DashboardControllerTest < ActionDispatch::IntegrationTest
87
87
  assert_equal 200, status
88
88
  customer.reload
89
89
  assert_equal 'STI', customer.name
90
+
91
+ get '/x/y/db'
92
+ assert_equal 200, status
93
+ RailsDb::Database.accessible_tables.each do |table|
94
+ assert_match(table, response.body)
95
+ end
90
96
  end
91
97
 
92
98
  end
@@ -7,7 +7,6 @@
7
7
  <%= csrf_meta_tags %>
8
8
  </head>
9
9
  <body>
10
-
11
10
  <div class="container theme-showcase" role="main">
12
11
  <%= yield %>
13
12
  </div>
@@ -2,4 +2,10 @@ Rails.application.routes.draw do
2
2
  root :to => 'home#index'
3
3
 
4
4
  mount RailsDb::Engine => "/rails/db", as: 'rails_db'
5
+
6
+ namespace :x do
7
+ namespace :y do
8
+ mount RailsDb::Engine => '/db', :as => 'rails_db'
9
+ end
10
+ end
5
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_db
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Kasyanchuk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-28 00:00:00.000000000 Z
11
+ date: 2018-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails