Skip to content

Commit 9e2d6d1

Browse files
committed
improving rubocop over time
1 parent 8dad43d commit 9e2d6d1

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

.rubocop.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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

lib/graphoid/definitions/types.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ def generate(model)
1818
name("#{name}Type")
1919
description("Generated model type for #{name}")
2020

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)
2424
field(name, type)
2525

2626
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
3030
self[method_name] || send(method_name)
3131
end
3232
end

spec/tester_ar/Gemfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: ../..
33
specs:
4-
graphoid (0.0.10)
4+
graphoid (0.1.0)
55
graphql (~> 1.8.0)
66
rails (~> 5)
77

0 commit comments

Comments
 (0)