adaptive_alias 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 26cc1e7589ccce6ae23b91968e01b0c419efbd482ce217c5c2efceaef33cb35d
4
- data.tar.gz: ef91b943cb0aeb07a1f9ac8370195d5f75fe48ce3c3908cc7f546ead6719fe7a
3
+ metadata.gz: 0375ca9867e41c41fe18b38cb1f37ff2a0067367304f6481250cd573c5dc5be4
4
+ data.tar.gz: bc0ebb4c4d63ea36e203b94f5c3ea0411c4fab408e93ea6c9dc0de5354c2db8c
5
5
  SHA512:
6
- metadata.gz: 9969274e1e866cc6ff99349a0da832044c3171fc654e9603afd4151846f9ac82cd31c76513ff865e4669d0dc96eb7abedd62225331eb46a769bbcb4bed681fec
7
- data.tar.gz: 9fad3f81d3bd1e4d768d43c94e476719a0e0a6b0af0fd7bf82fe89fae0195dcb877f8b73fb91c9d09fd0650ebfd82c12277a61616799fb710d94f9b80b008b97
6
+ metadata.gz: f0d5f519ab910bcf93c982f2ea6ca9c3e944ea0e90a07d6e938668b4575d450d6d019a60b62dd2020c373434e8ece4f7c1d9ea148ca269a4823718b80f8a8c07
7
+ data.tar.gz: 9a699915af111f6e01aa6fac45a888583a629b1f6eb0d75c84a15188f329e3f34401a330a6ee33040453b4e9f2d6a018bca61626e0784944004832c3db6d6bc3
data/CHANGELOG.md CHANGED
@@ -1,15 +1,22 @@
1
1
  ## Change Log
2
2
 
3
+ ### [v0.2.0](https://github.com/khiav223577/adaptive_alias/compare/v0.1.0...v0.2.0) 2022/08/05
4
+ - [#11](https://github.com/khiav223577/adaptive_alias/pull/11) [Feature] Support polymorphic (@khiav223577)
5
+ - [#10](https://github.com/khiav223577/adaptive_alias/pull/10) [Enhance] Prevent adding methods directly in class / module (@khiav223577)
6
+ - [#9](https://github.com/khiav223577/adaptive_alias/pull/9) [Enhance] Prevent changing original order of where conditions (@khiav223577)
7
+ - [#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)
8
+ - [#7](https://github.com/khiav223577/adaptive_alias/pull/7) [Test] Add test cases to test destroy (@khiav223577)
9
+
3
10
  ### [v0.1.0](https://github.com/khiav223577/adaptive_alias/compare/v0.0.3...v0.1.0) 2022/08/01
4
- - [#6](https://github.com/khiav223577/adaptive_alias/pull/6) Deal with creating records (@khiav223577)
5
- - [#5](https://github.com/khiav223577/adaptive_alias/pull/5) Prevent infinite loop if something went wrong (@khiav223577)
6
- - [#4](https://github.com/khiav223577/adaptive_alias/pull/4) Fix: attributes writer method should be defined after schema changes (@khiav223577)
11
+ - [#6](https://github.com/khiav223577/adaptive_alias/pull/6) [Feature] Deal with creating records (@khiav223577)
12
+ - [#5](https://github.com/khiav223577/adaptive_alias/pull/5) [Enhance] Prevent infinite loop if something went wrong (@khiav223577)
13
+ - [#4](https://github.com/khiav223577/adaptive_alias/pull/4) [Fix] Attributes writer method should be defined after schema changes (@khiav223577)
7
14
 
8
15
  ### [v0.0.3](https://github.com/khiav223577/adaptive_alias/compare/v0.0.2...v0.0.3) 2022/07/27
9
- - [#3](https://github.com/khiav223577/adaptive_alias/pull/3) Fix: prevent calling custom column names from raising missing attributes (@khiav223577)
16
+ - [#3](https://github.com/khiav223577/adaptive_alias/pull/3) [Fix] Prevent calling custom column names from raising missing attributes (@khiav223577)
10
17
 
11
18
  ### [v0.0.2](https://github.com/khiav223577/adaptive_alias/compare/v0.0.1...v0.0.2) 2022/07/26
12
- - [#2](https://github.com/khiav223577/adaptive_alias/pull/2) Doesn't need rails_compatibility in runtime (@khiav223577)
19
+ - [#2](https://github.com/khiav223577/adaptive_alias/pull/2) [Enhance] Doesn't need rails_compatibility in runtime (@khiav223577)
13
20
 
14
21
  ### v0.0.1 2022/07/22
15
- - [#1](https://github.com/khiav223577/adaptive_alias/pull/1) Implement adaptive_alias features (@khiav223577)
22
+ - [#1](https://github.com/khiav223577/adaptive_alias/pull/1) [Feature] Implement adaptive_alias features (@khiav223577)
@@ -25,6 +25,7 @@ module AdaptiveAlias
25
25
  end
26
26
  end
27
27
 
28
- module ActiveRecord::AttributeMethods::Read
28
+ # Nested module include is not supported until ruby 3.0
29
+ class ActiveRecord::Base
29
30
  prepend AdaptiveAlias::ActiveModelPatches::ReadAttribute
30
31
  end
@@ -19,6 +19,13 @@ module AdaptiveAlias
19
19
  end
20
20
  end
21
21
 
22
- module ActiveModel::AttributeMethods::ClassMethods
23
- include AdaptiveAlias::ActiveModelPatches::RemoveAliasAttribute
22
+ # Nested module include is not supported until ruby 3.0
23
+ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3')
24
+ AdaptiveAlias::ActiveModelPatches::RemoveAliasAttribute.instance_methods.each do |method|
25
+ ActiveModel::AttributeMethods::ClassMethods.define_method(method, AdaptiveAlias::ActiveModelPatches::RemoveAliasAttribute.instance_method(method))
26
+ end
27
+ else
28
+ module ActiveModel::AttributeMethods::ClassMethods
29
+ include AdaptiveAlias::ActiveModelPatches::RemoveAliasAttribute
30
+ end
24
31
  end
@@ -20,6 +20,6 @@ module AdaptiveAlias
20
20
  end
21
21
  end
22
22
 
23
- module ActiveRecord::AttributeMethods::Write
23
+ class ActiveRecord::Base
24
24
  prepend AdaptiveAlias::ActiveModelPatches::WriteAttribute
25
25
  end
@@ -1,3 +1,3 @@
1
1
  module AdaptiveAlias
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
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: 0.2.0
4
+ version: 0.2.1
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-08-05 00:00:00.000000000 Z
11
+ date: 2022-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler