active_graphql 0.2.2 → 0.2.3

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: 85a97e0012dc3642d262709d8a17faa2fb541b7a72c940b3ad3b81acb0dbce8a
4
- data.tar.gz: e5dfe901959df0a955fe8e54e190dc07eb1bfe0101563dac97964c18825bf85f
3
+ metadata.gz: aaf55048980ca2784a18fc6200714c1615b8046badbc751b9dd771afbb8c4c18
4
+ data.tar.gz: e5976cdd6a1578eaeccefc6701044d17ea0435b5d8e8c0b83a63105e9da1a749
5
5
  SHA512:
6
- metadata.gz: 04c179c9e92ebe3f67fb9aa844bfa8506bbc704155609b27c1fe416ebfcb2b03cb3ac5fe571318e569cb1233d4b72bd51e026e3daee3aa44a0f63328c6ae2bca
7
- data.tar.gz: e8c9f1e5075a807c701e423f7027b69fc4e55172d8a7fcd5292e13f905b415d6385e6391b680452cc3293303e7af08fc9b570e001aeed8d43f62dab864af4534
6
+ metadata.gz: 5353f4bcbafa578e4733564e639c7040479dfc40b5af22de8feaf5e4310c1055cc7419341d0fc89c3eb6b81e504853f6f04ecccb33068b979b0e6d7b3df59d7c
7
+ data.tar.gz: a826691f99deaf0a639efb762a80bef659c977fd60efba8e00b1baa1cee2f53e73da4b160684f7ffaa0134f57be8a379606d1f8fcbf09999e4b6930b30b52d76
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_graphql (0.2.2)
4
+ active_graphql (0.2.3)
5
5
  activemodel (>= 3.0.0)
6
6
  activesupport (>= 4.0.0)
7
7
  graphlient (~> 0.3)
@@ -69,7 +69,7 @@ GEM
69
69
  pry (~> 0.10)
70
70
  public_suffix (4.0.3)
71
71
  rainbow (3.0.0)
72
- rake (10.5.0)
72
+ rake (13.0.1)
73
73
  rspec (3.9.0)
74
74
  rspec-core (~> 3.9.0)
75
75
  rspec-expectations (~> 3.9.0)
@@ -122,7 +122,7 @@ DEPENDENCIES
122
122
  graphql_rails (>= 0.5.2)
123
123
  pry
124
124
  pry-byebug
125
- rake (~> 10.0)
125
+ rake (~> 13.0)
126
126
  rspec (~> 3.0)
127
127
  rubocop (= 0.75)
128
128
  rubocop-performance
@@ -41,7 +41,7 @@ Gem::Specification.new do |spec|
41
41
  spec.add_development_dependency "bundler", "~> 2.0"
42
42
  spec.add_development_dependency "webmock", "~> 3"
43
43
  spec.add_development_dependency "pry"
44
- spec.add_development_dependency "rake", "~> 10.0"
44
+ spec.add_development_dependency "rake", "~> 13.0"
45
45
  spec.add_development_dependency "rspec", "~> 3.0"
46
46
  spec.add_development_dependency "rubocop", "0.75"
47
47
  spec.add_development_dependency "rubocop-performance"
@@ -3,9 +3,11 @@
3
3
  [![codecov](https://codecov.io/gh/samesystem/active_graphql/branch/master/graph/badge.svg)](https://codecov.io/gh/samesystem/active_graphql)
4
4
  [![Documentation](https://readthedocs.org/projects/ansicolortags/badge/?version=latest)](https://samesystem.github.io/active_graphql)
5
5
 
6
+ ![logo](https://i.imgur.com/J1DJlqq.png)
7
+
6
8
  GraphQL client which allows to interact with graphql using ActiveRecord-like API
7
9
 
8
- Detailed documentation can be found at https://samesystem.github.io/active_graphql
10
+ Detailed documentation can be found at https://samesystem.github.io/active_graphql
9
11
 
10
12
  ## Installation
11
13
 
@@ -74,6 +74,22 @@ module ActiveGraphql
74
74
  self
75
75
  end
76
76
 
77
+ def save
78
+ if primary_key_value.present?
79
+ update(attributes.reject { |attr, _| attr == primary_key })
80
+ else
81
+ self.class.create(attributes)
82
+ end
83
+ end
84
+
85
+ def save!
86
+ if primary_key_value.present?
87
+ update!(attributes.reject { |attr, _| attr == primary_key })
88
+ else
89
+ self.class.create!(attributes)
90
+ end
91
+ end
92
+
77
93
  protected
78
94
 
79
95
  def exec_graphql(*args, &block)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveGraphql
4
- VERSION = '0.2.2'
4
+ VERSION = '0.2.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_graphql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Povilas Jurcys
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-04 00:00:00.000000000 Z
11
+ date: 2020-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '10.0'
117
+ version: '13.0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '10.0'
124
+ version: '13.0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rspec
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -231,7 +231,7 @@ licenses:
231
231
  metadata:
232
232
  homepage_uri: https://github.com/samesystem/active_graphql
233
233
  source_code_uri: https://github.com/samesystem/active_graphql
234
- changelog_uri: https://github.com/samesystem/active_graphql/blob/v0.2.2/CHANGELOG.md
234
+ changelog_uri: https://github.com/samesystem/active_graphql/blob/v0.2.3/CHANGELOG.md
235
235
  post_install_message:
236
236
  rdoc_options: []
237
237
  require_paths: