active_model_cachers 2.1.6 → 2.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +9 -9
- data/.travis.yml +8 -1
- data/CHANGELOG.md +67 -62
- data/CODE_OF_CONDUCT.md +48 -48
- data/LICENSE.txt +21 -21
- data/README.md +1 -1
- data/Rakefile +10 -10
- data/active_model_cachers.gemspec +7 -0
- data/bin/console +14 -14
- data/bin/setup +8 -8
- data/gemfiles/3.2.gemfile +11 -11
- data/gemfiles/4.2.gemfile +11 -11
- data/gemfiles/5.0.gemfile +11 -11
- data/gemfiles/5.1.gemfile +11 -11
- data/gemfiles/5.2.gemfile +11 -11
- data/gemfiles/6.0.gemfile +11 -0
- data/lib/active_model_cachers.rb +0 -0
- data/lib/active_model_cachers/active_record/attr_model.rb +124 -124
- data/lib/active_model_cachers/active_record/cacher.rb +97 -97
- data/lib/active_model_cachers/active_record/extension.rb +119 -119
- data/lib/active_model_cachers/active_record/global_callbacks.rb +67 -67
- data/lib/active_model_cachers/cache_service.rb +151 -151
- data/lib/active_model_cachers/cache_service_factory.rb +55 -55
- data/lib/active_model_cachers/column_value_cache.rb +47 -47
- data/lib/active_model_cachers/config.rb +6 -6
- data/lib/active_model_cachers/false_object.rb +5 -5
- data/lib/active_model_cachers/hook/associations.rb +43 -43
- data/lib/active_model_cachers/hook/dependencies.rb +38 -38
- data/lib/active_model_cachers/hook/on_model_delete.rb +29 -29
- data/lib/active_model_cachers/nil_object.rb +5 -5
- data/lib/active_model_cachers/patches/patch_rails_3.rb +49 -49
- data/lib/active_model_cachers/patches/uninitialized_attribute.rb +9 -9
- data/lib/active_model_cachers/version.rb +4 -4
- metadata +10 -4
@@ -1,5 +1,5 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
module ActiveModelCachers
|
3
|
-
class NilObject
|
4
|
-
end
|
5
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module ActiveModelCachers
|
3
|
+
class NilObject
|
4
|
+
end
|
5
|
+
end
|
@@ -1,49 +1,49 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
module ActiveModelCachers
|
3
|
-
module ActiveRecord
|
4
|
-
module Extension
|
5
|
-
# define #find_by for Rails 3
|
6
|
-
def find_by(*args)
|
7
|
-
where(*args).order('').first
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
module ActiveRecord
|
14
|
-
module Transactions
|
15
|
-
if not method_defined?(:transaction_include_any_action?)
|
16
|
-
def transaction_include_any_action?(fire_on)
|
17
|
-
fire_on.any?{|s| transaction_include_action?(s) }
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
module ActiveRecord
|
24
|
-
module Associations
|
25
|
-
# = Active Record Associations
|
26
|
-
#
|
27
|
-
# This is the root class of all associations ('+ Foo' signifies an included module Foo):
|
28
|
-
#
|
29
|
-
# Association
|
30
|
-
# SingularAssociation
|
31
|
-
# HasOneAssociation
|
32
|
-
# HasOneThroughAssociation + ThroughAssociation
|
33
|
-
# BelongsToAssociation
|
34
|
-
# BelongsToPolymorphicAssociation
|
35
|
-
# CollectionAssociation
|
36
|
-
# HasAndBelongsToManyAssociation
|
37
|
-
# HasManyAssociation
|
38
|
-
# HasManyThroughAssociation + ThroughAssociation
|
39
|
-
class Association #:nodoc:
|
40
|
-
alias_method :scope, :scoped
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
class ActiveModelCachers::ColumnValueCache
|
46
|
-
def pluck_columns(object, relation, columns)
|
47
|
-
object.connection.select_all(relation.select(columns)).map(&:values)
|
48
|
-
end
|
49
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module ActiveModelCachers
|
3
|
+
module ActiveRecord
|
4
|
+
module Extension
|
5
|
+
# define #find_by for Rails 3
|
6
|
+
def find_by(*args)
|
7
|
+
where(*args).order('').first
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
module ActiveRecord
|
14
|
+
module Transactions
|
15
|
+
if not method_defined?(:transaction_include_any_action?)
|
16
|
+
def transaction_include_any_action?(fire_on)
|
17
|
+
fire_on.any?{|s| transaction_include_action?(s) }
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
module ActiveRecord
|
24
|
+
module Associations
|
25
|
+
# = Active Record Associations
|
26
|
+
#
|
27
|
+
# This is the root class of all associations ('+ Foo' signifies an included module Foo):
|
28
|
+
#
|
29
|
+
# Association
|
30
|
+
# SingularAssociation
|
31
|
+
# HasOneAssociation
|
32
|
+
# HasOneThroughAssociation + ThroughAssociation
|
33
|
+
# BelongsToAssociation
|
34
|
+
# BelongsToPolymorphicAssociation
|
35
|
+
# CollectionAssociation
|
36
|
+
# HasAndBelongsToManyAssociation
|
37
|
+
# HasManyAssociation
|
38
|
+
# HasManyThroughAssociation + ThroughAssociation
|
39
|
+
class Association #:nodoc:
|
40
|
+
alias_method :scope, :scoped
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
class ActiveModelCachers::ColumnValueCache
|
46
|
+
def pluck_columns(object, relation, columns)
|
47
|
+
object.connection.select_all(relation.select(columns)).map(&:values)
|
48
|
+
end
|
49
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
if defined?(ActiveRecord::Attribute)
|
2
|
-
class ActiveRecord::Attribute
|
3
|
-
class Uninitialized < self
|
4
|
-
def forgetting_assignment
|
5
|
-
dup
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
1
|
+
if defined?(ActiveRecord::Attribute)
|
2
|
+
class ActiveRecord::Attribute
|
3
|
+
class Uninitialized < self
|
4
|
+
def forgetting_assignment
|
5
|
+
dup
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
module ActiveModelCachers
|
3
|
-
VERSION = '2.1.
|
4
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module ActiveModelCachers
|
3
|
+
VERSION = '2.1.7'
|
4
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_model_cachers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- khiav reoy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -123,6 +123,7 @@ files:
|
|
123
123
|
- gemfiles/5.0.gemfile
|
124
124
|
- gemfiles/5.1.gemfile
|
125
125
|
- gemfiles/5.2.gemfile
|
126
|
+
- gemfiles/6.0.gemfile
|
126
127
|
- lib/active_model_cachers.rb
|
127
128
|
- lib/active_model_cachers/active_record/attr_model.rb
|
128
129
|
- lib/active_model_cachers/active_record/cacher.rb
|
@@ -143,7 +144,12 @@ files:
|
|
143
144
|
homepage: https://github.com/khiav223577/active_model_cachers
|
144
145
|
licenses:
|
145
146
|
- MIT
|
146
|
-
metadata:
|
147
|
+
metadata:
|
148
|
+
homepage_uri: https://github.com/khiav223577/active_model_cachers
|
149
|
+
changelog_uri: https://github.com/khiav223577/active_model_cachers/blob/master/CHANGELOG.md
|
150
|
+
source_code_uri: https://github.com/khiav223577/active_model_cachers
|
151
|
+
documentation_uri: https://www.rubydoc.info/gems/active_model_cachers
|
152
|
+
bug_tracker_uri: https://github.com/khiav223577/active_model_cachers/issues
|
147
153
|
post_install_message:
|
148
154
|
rdoc_options: []
|
149
155
|
require_paths:
|
@@ -160,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
166
|
version: '0'
|
161
167
|
requirements: []
|
162
168
|
rubyforge_project:
|
163
|
-
rubygems_version: 2.
|
169
|
+
rubygems_version: 2.6.14
|
164
170
|
signing_key:
|
165
171
|
specification_version: 4
|
166
172
|
summary: Simply cache whatever you want by using cachers. Support Rails 3, 4, 5.
|