ar_lazy_preload 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ar_lazy_preload.rb +1 -16
- data/lib/ar_lazy_preload/{ext → active_record}/association.rb +0 -0
- data/lib/ar_lazy_preload/{ext → active_record}/association_relation.rb +0 -0
- data/lib/ar_lazy_preload/{ext → active_record}/base.rb +0 -0
- data/lib/ar_lazy_preload/{ext → active_record}/merger.rb +0 -0
- data/lib/ar_lazy_preload/{ext → active_record}/relation.rb +0 -1
- data/lib/ar_lazy_preload/railtie.rb +26 -0
- data/lib/ar_lazy_preload/version.rb +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44023d59df2053b73589d7b0baadad0933047105fb38986462347ce9c03414b6
|
4
|
+
data.tar.gz: fc4f589d5fec1c1731f82f5b43a3fe379f795445456721db5c6140190d3669a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b434e21ffab60c6008dfb85c9825d0534d635ae464052bcce0544cd6d2fee81b02ec9a9e4a26d542a46f18209efcb03c971f68ca0964b807d3a6e64ec2ca1f7
|
7
|
+
data.tar.gz: e12171b02fd58053e8e189e95a2178cdddb163ac225b134b298f9a2f872117e8edcd7c0119d84e60e7d99f355e3f58bb7f9976d76a9e515edc435aaf1c95da98
|
data/lib/ar_lazy_preload.rb
CHANGED
@@ -1,11 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "ar_lazy_preload/configuration"
|
4
|
-
require "ar_lazy_preload/
|
5
|
-
require "ar_lazy_preload/ext/relation"
|
6
|
-
require "ar_lazy_preload/ext/association"
|
7
|
-
require "ar_lazy_preload/ext/merger"
|
8
|
-
require "ar_lazy_preload/ext/association_relation"
|
4
|
+
require "ar_lazy_preload/railtie"
|
9
5
|
|
10
6
|
module ArLazyPreload
|
11
7
|
class << self
|
@@ -13,15 +9,4 @@ module ArLazyPreload
|
|
13
9
|
@config ||= Configuration.new
|
14
10
|
end
|
15
11
|
end
|
16
|
-
|
17
|
-
ActiveRecord::Base.include(ArLazyPreload::Base)
|
18
|
-
|
19
|
-
ActiveRecord::Relation.prepend(ArLazyPreload::Relation)
|
20
|
-
ActiveRecord::AssociationRelation.prepend(ArLazyPreload::AssociationRelation)
|
21
|
-
ActiveRecord::Relation::Merger.prepend(ArLazyPreload::Merger)
|
22
|
-
|
23
|
-
[
|
24
|
-
ActiveRecord::Associations::CollectionAssociation,
|
25
|
-
ActiveRecord::Associations::Association
|
26
|
-
].each { |klass| klass.prepend(ArLazyPreload::Association) }
|
27
12
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ar_lazy_preload/active_record/base"
|
4
|
+
require "ar_lazy_preload/active_record/relation"
|
5
|
+
require "ar_lazy_preload/active_record/association"
|
6
|
+
require "ar_lazy_preload/active_record/merger"
|
7
|
+
require "ar_lazy_preload/active_record/association_relation"
|
8
|
+
|
9
|
+
module ArLazyPreload
|
10
|
+
class Railtie < Rails::Railtie
|
11
|
+
config.to_prepare do |_app|
|
12
|
+
ActiveSupport.on_load(:active_record) do
|
13
|
+
ActiveRecord::Base.include(Base)
|
14
|
+
|
15
|
+
ActiveRecord::Relation.prepend(Relation)
|
16
|
+
ActiveRecord::AssociationRelation.prepend(AssociationRelation)
|
17
|
+
ActiveRecord::Relation::Merger.prepend(Merger)
|
18
|
+
|
19
|
+
[
|
20
|
+
ActiveRecord::Associations::CollectionAssociation,
|
21
|
+
ActiveRecord::Associations::Association
|
22
|
+
].each { |klass| klass.prepend(Association) }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ar_lazy_preload
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DmitryTsepelev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09
|
11
|
+
date: 2018-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -119,15 +119,16 @@ files:
|
|
119
119
|
- README.md
|
120
120
|
- Rakefile
|
121
121
|
- lib/ar_lazy_preload.rb
|
122
|
+
- lib/ar_lazy_preload/active_record/association.rb
|
123
|
+
- lib/ar_lazy_preload/active_record/association_relation.rb
|
124
|
+
- lib/ar_lazy_preload/active_record/base.rb
|
125
|
+
- lib/ar_lazy_preload/active_record/merger.rb
|
126
|
+
- lib/ar_lazy_preload/active_record/relation.rb
|
122
127
|
- lib/ar_lazy_preload/associated_context_builder.rb
|
123
128
|
- lib/ar_lazy_preload/association_tree_builder.rb
|
124
129
|
- lib/ar_lazy_preload/configuration.rb
|
125
130
|
- lib/ar_lazy_preload/context.rb
|
126
|
-
- lib/ar_lazy_preload/
|
127
|
-
- lib/ar_lazy_preload/ext/association_relation.rb
|
128
|
-
- lib/ar_lazy_preload/ext/base.rb
|
129
|
-
- lib/ar_lazy_preload/ext/merger.rb
|
130
|
-
- lib/ar_lazy_preload/ext/relation.rb
|
131
|
+
- lib/ar_lazy_preload/railtie.rb
|
131
132
|
- lib/ar_lazy_preload/version.rb
|
132
133
|
homepage: https://github.com/DmitryTsepelev/ar_lazy_preload
|
133
134
|
licenses:
|