Skip to content

Commit 207394d

Browse files
author
Arthur Chui
committed
Merge pull request #29 from clio/rails-6
Modify the code structure to make clear how the patches are applied to different versions of Rails: 1. Rename preloader/association.rb to preloader/ar5_association.rb 2. Bump the version to 0.3.0 as the gem now supports Rails 6
1 parent fd85519 commit 207394d

File tree

5 files changed

+7
-74
lines changed

5 files changed

+7
-74
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ build-iPhoneSimulator/
4343

4444
# for a library or gem, you might want to ignore these files since the code is
4545
# intended to run in multiple environments; otherwise, check them in:
46-
# Gemfile.lock
46+
Gemfile.lock
4747
# .ruby-version
4848
# .ruby-gemset
4949

Gemfile.lock

-66
This file was deleted.

lib/jit_preloader.rb

+5-6
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,17 @@
88
require 'jit_preloader/active_record/relation'
99
require 'jit_preloader/active_record/associations/collection_association'
1010
require 'jit_preloader/active_record/associations/singular_association'
11-
if Gem::Version.new(ActiveRecord::VERSION::STRING) < Gem::Version.new("5.2.2")
12-
require 'jit_preloader/active_record/associations/preloader/collection_association'
13-
require 'jit_preloader/active_record/associations/preloader/singular_association'
14-
elsif Gem::Version.new(ActiveRecord::VERSION::STRING) >= Gem::Version.new("6.0.0")
11+
if Gem::Version.new(ActiveRecord::VERSION::STRING) >= Gem::Version.new("6.0.0")
1512
require 'jit_preloader/active_record/associations/preloader/ar6_association'
13+
elsif Gem::Version.new(ActiveRecord::VERSION::STRING) >= Gem::Version.new("5.2.2")
14+
require 'jit_preloader/active_record/associations/preloader/ar5_association'
1615
else
17-
require 'jit_preloader/active_record/associations/preloader/association'
16+
require 'jit_preloader/active_record/associations/preloader/collection_association'
17+
require 'jit_preloader/active_record/associations/preloader/singular_association'
1818
end
1919
require 'jit_preloader/preloader'
2020

2121
module JitPreloader
22-
2322
def self.globally_enabled=(value)
2423
@enabled = value
2524
end

lib/jit_preloader/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module JitPreloader
2-
VERSION = "0.2.5"
2+
VERSION = "0.3.0"
33
end

0 commit comments

Comments
 (0)