Skip to content

Commit 16ff808

Browse files
committed
Update coverage directives for uncovered lines
1 parent 9759c6e commit 16ff808

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

lib/jsonapi/acts_as_resource_controller.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,19 @@ def index_related_resources
6060
end
6161

6262
def get_related_resource
63-
ActiveSupport::Deprecation.warn "In #{self.class.name} you exposed a `get_related_resource`"\
63+
# :nocov:
64+
ActiveSupport::Deprecation.warn "In #{self.class.name} you exposed a `get_related_resource`"\
6465
" action. Please use `show_related_resource` instead."
6566
show_related_resource
67+
# :nocov:
6668
end
6769

6870
def get_related_resources
71+
# :nocov:
6972
ActiveSupport::Deprecation.warn "In #{self.class.name} you exposed a `get_related_resources`"\
7073
" action. Please use `index_related_resource` instead."
7174
index_related_resources
75+
# :nocov:
7276
end
7377

7478
def process_request

lib/jsonapi/link_builder.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ def build_engine_name
6161
unless scopes.empty?
6262
"#{ scopes.first.to_s.camelize }::Engine".safe_constantize
6363
end
64+
# :nocov:
6465
rescue LoadError => _e
6566
nil
67+
# :nocov:
6668
end
6769
end
6870

@@ -139,7 +141,9 @@ def regular_primary_resources_url
139141

140142
def regular_resource_path(source)
141143
if source.is_a?(JSONAPI::CachedResponseFragment)
144+
# :nocov:
142145
"#{regular_resources_path(source.resource_klass)}/#{source.id}"
146+
# :nocov:
143147
else
144148
"#{regular_resources_path(source.class)}/#{source.id}"
145149
end

lib/jsonapi/relationship.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,19 @@ def initialize(name, options = {})
2525
alias_method :polymorphic?, :polymorphic
2626

2727
def primary_key
28+
# :nocov:
2829
@primary_key ||= resource_klass._primary_key
30+
# :nocov:
2931
end
3032

3133
def resource_klass
3234
@resource_klass ||= @parent_resource.resource_klass_for(@class_name)
3335
end
3436

3537
def table_name
38+
# :nocov:
3639
@table_name ||= resource_klass._table_name
40+
# :nocov:
3741
end
3842

3943
def self.polymorphic_types(name)
@@ -72,7 +76,9 @@ def relation_name(options)
7276
end
7377

7478
def belongs_to?
79+
# :nocov:
7580
false
81+
# :nocov:
7682
end
7783

7884
def readonly?
@@ -97,7 +103,9 @@ def initialize(name, options = {})
97103
end
98104

99105
def belongs_to?
106+
# :nocov:
100107
foreign_key_on == :self
108+
# :nocov:
101109
end
102110

103111
def polymorphic_type

0 commit comments

Comments
 (0)