recline 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/recline/model_reflection.rb +8 -1
- data/lib/recline/railtie.rb +10 -0
- data/lib/recline/types/diff_type.rb +6 -0
- data/lib/recline/types/version_reflection_type.rb +11 -0
- data/lib/recline/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee53a57c2187d6c4811a6162030d4f319e8ffda7
|
4
|
+
data.tar.gz: dadb52ecb66240227418c5916bb4c6c99d0d4993
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12bdd73f01bdf4a156608b48d15c2bc63e479aca5173f75be160c9722ed487b843ea10800c8152caec95977a7263374a19135f810b7c3615611a6d35cd8e28c5
|
7
|
+
data.tar.gz: ed33d090bb91050887d9ade3f5dfbdeba6c5707c93c703294eec97ee49a17099c2faefdbe5869d228c0ad07cc723025ce939513f82c41974e838b09dec13bdf5
|
@@ -1,7 +1,14 @@
|
|
1
1
|
require 'graphql/rails/active_reflection/model_reflection'
|
2
2
|
|
3
3
|
class Recline::ModelReflection < GraphQL::Rails::ActiveReflection::ModelReflection
|
4
|
-
@schema_name = "
|
4
|
+
@schema_name = "ReclineMode"
|
5
|
+
|
6
|
+
attr_reader :versions
|
7
|
+
|
8
|
+
def initialize(obj, ctx)
|
9
|
+
super
|
10
|
+
@versions = obj.versions if obj.respond_to? :versions
|
11
|
+
end
|
5
12
|
|
6
13
|
def get_attributes
|
7
14
|
@attributes ||= @type.fields.map { |name, field|
|
data/lib/recline/railtie.rb
CHANGED
@@ -2,6 +2,16 @@ module Recline
|
|
2
2
|
class Railtie < Rails::Railtie
|
3
3
|
config.before_configuration do
|
4
4
|
GraphQL::Field.accepts_definitions(recline_appearance: GraphQL::Define.assign_metadata_key(:recline_appearance))
|
5
|
+
|
6
|
+
begin
|
7
|
+
require "paper_trail"
|
8
|
+
require "recline/types/version_reflection_type"
|
9
|
+
Recline::Types::ModelReflectionType.define do
|
10
|
+
field :versions, Recline::Types::VersionReflectionType.to_list_type
|
11
|
+
end
|
12
|
+
rescue LoadError
|
13
|
+
# not installed
|
14
|
+
end
|
5
15
|
end
|
6
16
|
end
|
7
17
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'graphql/rails/active_reflection'
|
2
|
+
require 'graphql/rails/active_reflection/types/attribute_reflection_type'
|
3
|
+
require 'recline/types/diff_type'
|
4
|
+
|
5
|
+
Recline::Types::VersionReflectionType = GraphQL::ObjectType.define do
|
6
|
+
name "ReclineVersion"
|
7
|
+
field :title, types.String
|
8
|
+
field :created_at, types.String
|
9
|
+
|
10
|
+
field :diff, Recline::Types::DiffType.to_list_type
|
11
|
+
end
|
data/lib/recline/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cole Turner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|
@@ -94,7 +94,9 @@ files:
|
|
94
94
|
- lib/recline/railtie.rb
|
95
95
|
- lib/recline/types/appearance_enum_type.rb
|
96
96
|
- lib/recline/types/attribute_reflection_type.rb
|
97
|
+
- lib/recline/types/diff_type.rb
|
97
98
|
- lib/recline/types/model_reflection_type.rb
|
99
|
+
- lib/recline/types/version_reflection_type.rb
|
98
100
|
- lib/recline/version.rb
|
99
101
|
homepage: http://rubygems.org/gems/recline
|
100
102
|
licenses:
|