tramway-admin 1.8.1 → 1.8.1.1

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: 8a551a800d4b6b569101fd97a47e8726b49151847ccdac7f4e649d06dfd71386
4
- data.tar.gz: 4be7b89e6a260b2a61f1b5bd72296e7d517d271f48d8fcf6d24b1a682ba00af9
3
+ metadata.gz: 9e07922ba1b483a831c7465c5670ffbfbef193ba440aa97f94a369aefa37a13e
4
+ data.tar.gz: 49bb8609d24d49ccd4adbc80ac811809722ef7d3036c1883d5a0be86bd3fb41d
5
5
  SHA512:
6
- metadata.gz: b5e2b264a95d877760692bffa7e8edd42ecd482d4a44a6b773b3fb15722d3764571601861c8dba8b5e975c6444c17cc6489f7c2a5fd3483a68c727e2f752037b
7
- data.tar.gz: ab1c1b6f26ff2343eac9f13fb6091bb2f63836caaf6539f4957df610813f9bea7b57d8c292bc862e1aa6f2c99955a81de599101d1f76f1b28a83ba21aef4bdfc
6
+ metadata.gz: 07f04491630dfcf061ac17f98219ed3ae95f2eee6da7fd887b2fe26d7a61a3bc034409f91f1996fbe817dfafd9ab99c396ee18f3fac634b0e6ff14b00cfb508c
7
+ data.tar.gz: c655a6a69f9255c5321bf3a7de49a4e8b9580cc57c4f92727618106d77eb37bf046647546ee9f4726135cec939bf526c48e1c5ad32b9f581931e9399f2270f0f
@@ -1,3 +1,5 @@
1
+ require 'tramway/class_name_helpers'
2
+
1
3
  module Tramway
2
4
  module Admin
3
5
  class ApplicationController < ::Tramway::Core::ApplicationController
@@ -27,26 +29,28 @@ module Tramway
27
29
  end
28
30
  end
29
31
 
32
+ def application
33
+ if ::Tramway::Core.application
34
+ @application = Tramway::Core.application&.model_class&.first || Tramway::Core.application
35
+ end
36
+ end
37
+
38
+ private
39
+
40
+ include Tramway::ClassNameHelpers
41
+
30
42
  def model_class
31
- params[:model].constantize
43
+ model_class_name(params[:model])
32
44
  end
33
45
 
34
46
  def decorator_class
35
- "#{model_class}Decorator".constantize
47
+ decorator_class_name
36
48
  end
37
49
 
38
50
  def form_class
39
- "#{model_class}Form".constantize
51
+ form_class_name
40
52
  end
41
53
 
42
- def application
43
- if ::Tramway::Core.application
44
- @application = Tramway::Core.application&.model_class&.first || Tramway::Core.application
45
- end
46
- end
47
-
48
- private
49
-
50
54
  def model_given?
51
55
  available_models_given? || singleton_models_given?
52
56
  end
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Admin
3
- VERSION = '1.8.1'
3
+ VERSION = '1.8.1.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.8.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-11 00:00:00.000000000 Z
11
+ date: 2019-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootstrap-kaminari-views
@@ -248,7 +248,7 @@ files:
248
248
  - lib/tramway/admin/engine.rb
249
249
  - lib/tramway/admin/record_routes_helper.rb
250
250
  - lib/tramway/admin/version.rb
251
- homepage: https://github.com/kalashnikovisme/tramway-admin
251
+ homepage: https://github.com/kalashnikovisme/tramway-dev
252
252
  licenses:
253
253
  - MIT
254
254
  metadata: {}