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: 18c0c7bfd9e97ce845ab0985d5b81ce8e6bce06a9ed86b4af189d73306c4b04a
4
- data.tar.gz: 27fc885a47de2e85f2967b7b7a68aa6a9c921ca1a446b09950a48e735cb02103
3
+ metadata.gz: f233bcfda710916773bb711e76dfb17dbed7422903582e485aa4b74bd16b70a0
4
+ data.tar.gz: 77b84c056f155144027fdf4383cece09f7846413c0c1148630396e05ca76979f
5
5
  SHA512:
6
- metadata.gz: ed09dd3a8921b1dadd332a5c2bcbcbbd99f1911683b6de121a3d7b34282dc7d9f044415437cbc8572e18f584e2cb56b494fa0562c84402b7730455dcc851fe7d
7
- data.tar.gz: 795535d2d9e8c877499bdb6cdef42d5927613ae831414c6047d594d8a557d8312abe2f89a207bd2725e4e7e54d4e2d5d002ecd737df4522370bedfeaa3bff2e2
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 :graphql_name, String, null: true
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
- def graphql_name
7
- object.class.table_name
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
@@ -1,14 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ibrain
4
- VERSION = "0.5.1"
4
+ VERSION = "0.5.2"
5
5
 
6
6
  def self.ibrain_version
7
7
  VERSION
8
8
  end
9
9
 
10
10
  def self.previous_ibrain_minor_version
11
- '0.5.0'
11
+ '0.5.1'
12
12
  end
13
13
 
14
14
  def self.ibrain_gem_version
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibrain-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tai Nguyen Van