adaptive_alias 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2557ac5e97d02789b75b5468e51f3b67d677195cd90111416222bba40d47b79c
4
- data.tar.gz: 54561a2436419e0dec856da7d678e3c01dfb437d6642ee3dc5a162492b848a54
3
+ metadata.gz: 7a49038a810d4dcbbd42effa1664ff3495966c9a097df8939f92632e5fae54ac
4
+ data.tar.gz: 3bee0518e9915af89ac616be205a73da6155e09d9f3d28947cd3cf9145e18660
5
5
  SHA512:
6
- metadata.gz: 68b69b12d2f60509dc9c014d684727f688e57d87cd2baf612ba9cfa4e7efaa7b2e10ec05ecd60d1e83a9c547e4c6f896f816bc529b490ebb8f1a1e76888a5fd1
7
- data.tar.gz: 90e873a39c890cacea169226ca33a78b404d347aa5a238a793e2a753e61d7b43a46507ea52f50b467ac45fbc923f8135e8b60cd3a4763f1061e20ab94c69aecf
6
+ metadata.gz: '094892c502fe7343c74a5dae66ab57b1bd21405a73cf38c390c41b12bfd8d01f39c5d9cec78920ca1a388e93be68e280c95041a3fae4d43f9a7ea9ed931f6d22'
7
+ data.tar.gz: 1c7e437b160e7ae6cbb8bb8624f654a220ed35fdbedae3a5a45a306f616bab4f7e62153c08cc874e59a806a7fd5bdc269a86c231180b597b333e9e2556e13acd
data/CHANGELOG.md CHANGED
@@ -1,45 +1,49 @@
1
- ## Change Log
2
-
3
- ### [v1.1.0](https://github.com/khiav223577/adaptive_alias/compare/v1.0.0...v1.1.0) 2022/09/27
4
- - [#22](https://github.com/khiav223577/adaptive_alias/pull/22) [Fix] creation via autosave(belongs_to) association (@khiav223577)
5
-
6
- ### [v1.0.0](https://github.com/khiav223577/adaptive_alias/compare/v0.2.4...v1.0.0) 2022/09/22
7
- - [#21](https://github.com/khiav223577/adaptive_alias/pull/21) [Fix] Model with ignored_columns or calling find_by directly on model class with aliased column argument will fail (@khiav223577)
8
- - [#20](https://github.com/khiav223577/adaptive_alias/pull/20) [Fix] Problems with STI classes and models that uses same table name (@khiav223577)
9
- - [#19](https://github.com/khiav223577/adaptive_alias/pull/19) [Fix] Rescue the error when doing direct access to target table's field (@khiav223577)
10
-
11
- ### [v0.2.4](https://github.com/khiav223577/adaptive_alias/compare/v0.2.3...v0.2.4) 2022/08/18
12
- - [#18](https://github.com/khiav223577/adaptive_alias/pull/18) [Fix] Get model from a relation with join will not generate right query (after migration) (@khiav223577)
13
-
14
- ### [v0.2.3](https://github.com/khiav223577/adaptive_alias/compare/v0.2.2...v0.2.3) 2022/08/17
15
- - [#17](https://github.com/khiav223577/adaptive_alias/pull/17) [Feature] Support joins (@khiav223577)
16
- - [#16](https://github.com/khiav223577/adaptive_alias/pull/16) [Enhance] No need to clone node (@khiav223577)
17
- - [#15](https://github.com/khiav223577/adaptive_alias/pull/15) [Test] Add test cases to test calling pluck on same model (@khiav223577)
18
-
19
- ### [v0.2.2](https://github.com/khiav223577/adaptive_alias/compare/v0.2.1...v0.2.2) 2022/08/11
20
- - [#14](https://github.com/khiav223577/adaptive_alias/pull/14) [Fix] Fail to use backward-patch when target column has already been migrated (@khiav223577)
21
-
22
- ### [v0.2.1](https://github.com/khiav223577/adaptive_alias/compare/v0.2.0...v0.2.1) 2022/08/11
23
- - [#13](https://github.com/khiav223577/adaptive_alias/pull/13) [Fix] Nested module include is not supported until ruby 3.0 (@khiav223577)
24
- - [#12](https://github.com/khiav223577/adaptive_alias/pull/12) [Test] Add test cases to test column_names (@khiav223577)
25
-
26
- ### [v0.2.0](https://github.com/khiav223577/adaptive_alias/compare/v0.1.0...v0.2.0) 2022/08/05
27
- - [#11](https://github.com/khiav223577/adaptive_alias/pull/11) [Feature] Support polymorphic (@khiav223577)
28
- - [#10](https://github.com/khiav223577/adaptive_alias/pull/10) [Enhance] Prevent adding methods directly in class / module (@khiav223577)
29
- - [#9](https://github.com/khiav223577/adaptive_alias/pull/9) [Enhance] Prevent changing original order of where conditions (@khiav223577)
30
- - [#8](https://github.com/khiav223577/adaptive_alias/pull/8) [Test] Make sure we are reset to use original patch when some test cases fail (@khiav223577)
31
- - [#7](https://github.com/khiav223577/adaptive_alias/pull/7) [Test] Add test cases to test destroy (@khiav223577)
32
-
33
- ### [v0.1.0](https://github.com/khiav223577/adaptive_alias/compare/v0.0.3...v0.1.0) 2022/08/01
34
- - [#6](https://github.com/khiav223577/adaptive_alias/pull/6) [Feature] Deal with creating records (@khiav223577)
35
- - [#5](https://github.com/khiav223577/adaptive_alias/pull/5) [Enhance] Prevent infinite loop if something went wrong (@khiav223577)
36
- - [#4](https://github.com/khiav223577/adaptive_alias/pull/4) [Fix] Attributes writer method should be defined after schema changes (@khiav223577)
37
-
38
- ### [v0.0.3](https://github.com/khiav223577/adaptive_alias/compare/v0.0.2...v0.0.3) 2022/07/27
39
- - [#3](https://github.com/khiav223577/adaptive_alias/pull/3) [Fix] Prevent calling custom column names from raising missing attributes (@khiav223577)
40
-
41
- ### [v0.0.2](https://github.com/khiav223577/adaptive_alias/compare/v0.0.1...v0.0.2) 2022/07/26
42
- - [#2](https://github.com/khiav223577/adaptive_alias/pull/2) [Enhance] Doesn't need rails_compatibility in runtime (@khiav223577)
43
-
44
- ### v0.0.1 2022/07/22
45
- - [#1](https://github.com/khiav223577/adaptive_alias/pull/1) [Feature] Implement adaptive_alias features (@khiav223577)
1
+ ## Change Log
2
+
3
+ ### [v1.1.1](https://github.com/khiav223577/adaptive_alias/compare/v1.1.0...v1.1.1) 2022/10/07
4
+ - [#24](https://github.com/khiav223577/adaptive_alias/pull/24) [Fix] Disappeared value when instantiating all and then create / update multiple models one by one (@khiav223577)
5
+ - [#23](https://github.com/khiav223577/adaptive_alias/pull/23) [Enhance] No need to determine missing value manually (@khiav223577)
6
+
7
+ ### [v1.1.0](https://github.com/khiav223577/adaptive_alias/compare/v1.0.0...v1.1.0) 2022/09/27
8
+ - [#22](https://github.com/khiav223577/adaptive_alias/pull/22) [Fix] Creation via autosave(belongs_to) association (@khiav223577)
9
+
10
+ ### [v1.0.0](https://github.com/khiav223577/adaptive_alias/compare/v0.2.4...v1.0.0) 2022/09/22
11
+ - [#21](https://github.com/khiav223577/adaptive_alias/pull/21) [Fix] Model with ignored_columns or calling find_by directly on model class with aliased column argument will fail (@khiav223577)
12
+ - [#20](https://github.com/khiav223577/adaptive_alias/pull/20) [Fix] Problems with STI classes and models that uses same table name (@khiav223577)
13
+ - [#19](https://github.com/khiav223577/adaptive_alias/pull/19) [Fix] Rescue the error when doing direct access to target table's field (@khiav223577)
14
+
15
+ ### [v0.2.4](https://github.com/khiav223577/adaptive_alias/compare/v0.2.3...v0.2.4) 2022/08/18
16
+ - [#18](https://github.com/khiav223577/adaptive_alias/pull/18) [Fix] Get model from a relation with join will not generate right query (after migration) (@khiav223577)
17
+
18
+ ### [v0.2.3](https://github.com/khiav223577/adaptive_alias/compare/v0.2.2...v0.2.3) 2022/08/17
19
+ - [#17](https://github.com/khiav223577/adaptive_alias/pull/17) [Feature] Support joins (@khiav223577)
20
+ - [#16](https://github.com/khiav223577/adaptive_alias/pull/16) [Enhance] No need to clone node (@khiav223577)
21
+ - [#15](https://github.com/khiav223577/adaptive_alias/pull/15) [Test] Add test cases to test calling pluck on same model (@khiav223577)
22
+
23
+ ### [v0.2.2](https://github.com/khiav223577/adaptive_alias/compare/v0.2.1...v0.2.2) 2022/08/11
24
+ - [#14](https://github.com/khiav223577/adaptive_alias/pull/14) [Fix] Fail to use backward-patch when target column has already been migrated (@khiav223577)
25
+
26
+ ### [v0.2.1](https://github.com/khiav223577/adaptive_alias/compare/v0.2.0...v0.2.1) 2022/08/11
27
+ - [#13](https://github.com/khiav223577/adaptive_alias/pull/13) [Fix] Nested module include is not supported until ruby 3.0 (@khiav223577)
28
+ - [#12](https://github.com/khiav223577/adaptive_alias/pull/12) [Test] Add test cases to test column_names (@khiav223577)
29
+
30
+ ### [v0.2.0](https://github.com/khiav223577/adaptive_alias/compare/v0.1.0...v0.2.0) 2022/08/05
31
+ - [#11](https://github.com/khiav223577/adaptive_alias/pull/11) [Feature] Support polymorphic (@khiav223577)
32
+ - [#10](https://github.com/khiav223577/adaptive_alias/pull/10) [Enhance] Prevent adding methods directly in class / module (@khiav223577)
33
+ - [#9](https://github.com/khiav223577/adaptive_alias/pull/9) [Enhance] Prevent changing original order of where conditions (@khiav223577)
34
+ - [#8](https://github.com/khiav223577/adaptive_alias/pull/8) [Test] Make sure we are reset to use original patch when some test cases fail (@khiav223577)
35
+ - [#7](https://github.com/khiav223577/adaptive_alias/pull/7) [Test] Add test cases to test destroy (@khiav223577)
36
+
37
+ ### [v0.1.0](https://github.com/khiav223577/adaptive_alias/compare/v0.0.3...v0.1.0) 2022/08/01
38
+ - [#6](https://github.com/khiav223577/adaptive_alias/pull/6) [Feature] Deal with creating records (@khiav223577)
39
+ - [#5](https://github.com/khiav223577/adaptive_alias/pull/5) [Enhance] Prevent infinite loop if something went wrong (@khiav223577)
40
+ - [#4](https://github.com/khiav223577/adaptive_alias/pull/4) [Fix] Attributes writer method should be defined after schema changes (@khiav223577)
41
+
42
+ ### [v0.0.3](https://github.com/khiav223577/adaptive_alias/compare/v0.0.2...v0.0.3) 2022/07/27
43
+ - [#3](https://github.com/khiav223577/adaptive_alias/pull/3) [Fix] Prevent calling custom column names from raising missing attributes (@khiav223577)
44
+
45
+ ### [v0.0.2](https://github.com/khiav223577/adaptive_alias/compare/v0.0.1...v0.0.2) 2022/07/26
46
+ - [#2](https://github.com/khiav223577/adaptive_alias/pull/2) [Enhance] Doesn't need rails_compatibility in runtime (@khiav223577)
47
+
48
+ ### v0.0.1 2022/07/22
49
+ - [#1](https://github.com/khiav223577/adaptive_alias/pull/1) [Feature] Implement adaptive_alias features (@khiav223577)
@@ -0,0 +1,16 @@
1
+ require 'active_record'
2
+
3
+ module AdaptiveAlias
4
+ module Hooks
5
+ module Calculations
6
+ def perform_calculation(*)
7
+ AdaptiveAlias.rescue_statement_invalid(relation: self){ super }
8
+ end
9
+ end
10
+ end
11
+ end
12
+
13
+ # Nested module include is not supported until ruby 3.0
14
+ class ActiveRecord::Relation
15
+ prepend AdaptiveAlias::Hooks::Calculations
16
+ end
@@ -1,3 +1,3 @@
1
1
  module AdaptiveAlias
2
- VERSION = '1.1.1'
2
+ VERSION = '1.1.2'
3
3
  end
@@ -15,6 +15,7 @@ require 'adaptive_alias/hooks/singular_association'
15
15
  require 'adaptive_alias/hooks/relation'
16
16
  require 'adaptive_alias/hooks/active_record_core'
17
17
  require 'adaptive_alias/hooks/active_record_persistence'
18
+ require 'adaptive_alias/hooks/calculations'
18
19
 
19
20
  module AdaptiveAlias
20
21
  @log_interval = 10 * 60
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adaptive_alias
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - khiav reoy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-07 00:00:00.000000000 Z
11
+ date: 2022-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -132,6 +132,7 @@ files:
132
132
  - lib/adaptive_alias/hooks/active_record_persistence.rb
133
133
  - lib/adaptive_alias/hooks/association.rb
134
134
  - lib/adaptive_alias/hooks/association_scope.rb
135
+ - lib/adaptive_alias/hooks/calculations.rb
135
136
  - lib/adaptive_alias/hooks/relation.rb
136
137
  - lib/adaptive_alias/hooks/singular_association.rb
137
138
  - lib/adaptive_alias/patches/backward_patch.rb