active_model_cachers 2.1.5 → 2.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +9 -9
- data/.travis.yml +2 -2
- data/CHANGELOG.md +62 -57
- data/CODE_OF_CONDUCT.md +48 -48
- data/LICENSE.txt +21 -21
- data/README.md +23 -10
- data/Rakefile +10 -10
- data/active_model_cachers.gemspec +1 -1
- 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/lib/active_model_cachers.rb +0 -0
- data/lib/active_model_cachers/active_record/attr_model.rb +124 -103
- data/lib/active_model_cachers/active_record/cacher.rb +97 -97
- data/lib/active_model_cachers/active_record/extension.rb +119 -107
- 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 +13 -7
@@ -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.6'
|
4
|
+
end
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- khiav reoy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.17'
|
20
|
+
- - "<"
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
22
|
+
version: 3.x
|
20
23
|
type: :development
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.17'
|
30
|
+
- - "<"
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
32
|
+
version: 3.x
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rake
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -154,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
160
|
version: '0'
|
155
161
|
requirements: []
|
156
162
|
rubyforge_project:
|
157
|
-
rubygems_version: 2.7.
|
163
|
+
rubygems_version: 2.7.7
|
158
164
|
signing_key:
|
159
165
|
specification_version: 4
|
160
166
|
summary: Simply cache whatever you want by using cachers. Support Rails 3, 4, 5.
|