File tree 3 files changed +22
-7
lines changed
3 files changed +22
-7
lines changed Original file line number Diff line number Diff line change
1
+ Metrics/MethodLength :
2
+ Max : 40
3
+ Metrics/LineLength :
4
+ Max : 150
5
+ Metrics/BlockLength :
6
+ Max : 40
7
+ Naming/PredicateName :
8
+ NamePrefixBlacklist :
9
+ - has_
10
+ Metrics/AbcSize :
11
+ Max : 30
12
+ Style/IfUnlessModifier :
13
+ Enabled : false
14
+ Style/Documentation :
15
+ Enabled : false
Original file line number Diff line number Diff line change @@ -18,15 +18,15 @@ def generate(model)
18
18
name ( "#{ name } Type" )
19
19
description ( "Generated model type for #{ name } " )
20
20
21
- Attribute . fields_of ( model ) . each do |_field |
22
- type = Graphoid ::Mapper . convert ( _field )
23
- name = Utils . camelize ( _field . name )
21
+ Attribute . fields_of ( model ) . each do |attribute |
22
+ type = Graphoid ::Mapper . convert ( attribute )
23
+ name = Utils . camelize ( attribute . name )
24
24
field ( name , type )
25
25
26
26
model . class_eval do
27
- if _field . name . include? ( '_' )
28
- define_method :"#{ Utils . camelize ( _field . name ) } " do
29
- method_name = _field . name . to_s
27
+ if attribute . name . include? ( '_' )
28
+ define_method :"#{ Utils . camelize ( attribute . name ) } " do
29
+ method_name = attribute . name . to_s
30
30
self [ method_name ] || send ( method_name )
31
31
end
32
32
end
Original file line number Diff line number Diff line change 1
1
PATH
2
2
remote: ../..
3
3
specs:
4
- graphoid (0.0.10 )
4
+ graphoid (0.1.0 )
5
5
graphql (~> 1.8.0 )
6
6
rails (~> 5 )
7
7
You can’t perform that action at this time.
0 commit comments