Skip to content

Commit

Permalink
Prefer require_relative for internal requires (#78)
Browse files Browse the repository at this point in the history
`require_relative` is preferred over `require` for files within the same
project because it uses paths relative to the current file, making code
more portable and less dependent on the load path.

This change updates internal requires to use `require_relative` for
consistency, performance, and improved portability.

Refs:
- rgeo/rgeo#229
- rubocop/rubocop#8748
  • Loading branch information
tagliala authored Sep 21, 2024
1 parent c70c26e commit b77b3aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/rgeo-activerecord.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# frozen_string_literal: true

require "rgeo/active_record"
require_relative "rgeo/active_record"
13 changes: 7 additions & 6 deletions lib/rgeo/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

require "rgeo"
require "active_record"
require "rgeo/active_record/version"
require "rgeo/active_record/spatial_expressions"
require "rgeo/active_record/spatial_factory_store"
require "rgeo/active_record/arel_spatial_queries"
require "rgeo/active_record/common_adapter_elements"
require "rgeo/active_record/geometry_mixin"

require_relative "active_record/version"
require_relative "active_record/spatial_expressions"
require_relative "active_record/spatial_factory_store"
require_relative "active_record/arel_spatial_queries"
require_relative "active_record/common_adapter_elements"
require_relative "active_record/geometry_mixin"

0 comments on commit b77b3aa

Please sign in to comment.