ibrain-core 0.5.1 → 0.5.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f233bcfda710916773bb711e76dfb17dbed7422903582e485aa4b74bd16b70a0
|
4
|
+
data.tar.gz: 77b84c056f155144027fdf4383cece09f7846413c0c1148630396e05ca76979f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d7b3295584d532c7056bd8c42f9f0912a1a57415f055d8e779ed0e7379fd3677ab2e481d5336c7378ec380223177fef9f9f695f6d4ec5884f8535eedccfbfc8
|
7
|
+
data.tar.gz: 31df17fd32e208faf2e517e8cc9fdedd4bed1e937a7352ac5e883f9359c81ec9682b1970aab5726a9863107eeb96e20129c9c487eaaba0f1522c973773dc7539
|
@@ -9,7 +9,7 @@ module Ibrain
|
|
9
9
|
connection_type_class(Ibrain::Types::BaseConnection)
|
10
10
|
|
11
11
|
field_class ::Ibrain::Types::BaseField
|
12
|
-
field :
|
12
|
+
field :table_name, String, null: true
|
13
13
|
|
14
14
|
protected
|
15
15
|
|
@@ -20,6 +20,10 @@ module Ibrain
|
|
20
20
|
def current_user
|
21
21
|
context.try(:fetch, :current_user)
|
22
22
|
end
|
23
|
+
|
24
|
+
def table_name
|
25
|
+
object.class.try(:table_name)
|
26
|
+
end
|
23
27
|
end
|
24
28
|
end
|
25
29
|
end
|
@@ -3,8 +3,12 @@
|
|
3
3
|
module Ibrain
|
4
4
|
module Types
|
5
5
|
class BaseType < BaseObject
|
6
|
-
|
7
|
-
|
6
|
+
class << self
|
7
|
+
def graphql_name(name = "")
|
8
|
+
return name if name.present?
|
9
|
+
|
10
|
+
self.name.demodulize.gsub('Type', '').classify.constantize.table_name
|
11
|
+
end
|
8
12
|
end
|
9
13
|
end
|
10
14
|
end
|
data/lib/ibrain/core/version.rb
CHANGED