Skip to content

Commit

Permalink
Merge pull request #114 from comma-csv/issue-113
Browse files Browse the repository at this point in the history
Fix #113
  • Loading branch information
eitoball committed Apr 30, 2019
2 parents 8db2aa5 + 85b70e1 commit 371ec7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/comma/header_extractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def get_association_class(model_class, association)

begin
model_class.reflect_on_association(association)&.klass
rescue NameError
rescue ArgumentError, NameError
# Since Rails 5.2, ArgumentError is raised.
nil
end
end
Expand Down
3 changes: 1 addition & 2 deletions spec/comma/rails/active_record_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ def name

describe 'github pull-request 83' do
it 'should not raise NameError' do
expect { Picture.all.to_comma(:pr_83) }
.not_to raise_exception(NameError)
expect { Picture.all.to_comma(:pr_83) }.not_to raise_error
end
end
end
Expand Down

0 comments on commit 371ec7a

Please sign in to comment.