Skip to content

Commit 5a12ae4

Browse files
authored
Merge pull request #187 from kbrock/v72
V72
2 parents 23ad9ad + ae7e998 commit 5a12ae4

File tree

5 files changed

+18
-19
lines changed

5 files changed

+18
-19
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ The versioning of this gem follows ActiveRecord versioning, and does not follow
44

55
## [Unreleased]
66

7+
## [7.2.0.0] - 2025-06-25
8+
9+
* virtual_delegate requires type [#185](https://github.com/ManageIQ/activerecord-virtual_attributes/pull/185)
10+
* Rails 7.2 support [#187](https://github.com/ManageIQ/activerecord-virtual_attributes/pull/187)
11+
712
## [7.1.2] - 2025-06-20
813

914
* Introduce virtual_has_many :through [#191](https://github.com/ManageIQ/activerecord-virtual_attributes/pull/191)
15+
* Use kwargs for virtual_delegate and virtual_column [#190](https://github.com/ManageIQ/activerecord-virtual_attributes/pull/190)
1016

1117
## [7.1.1] - 2025-06-18
1218

@@ -119,7 +125,8 @@ The versioning of this gem follows ActiveRecord versioning, and does not follow
119125
* Initial Release
120126
* Extracted from ManageIQ/manageiq
121127

122-
[Unreleased]: https://github.com/ManageIQ/activerecord-virtual_attributes/compare/v7.1.2...HEAD
128+
[Unreleased]: https://github.com/ManageIQ/activerecord-virtual_attributes/compare/v7.2.0.0...HEAD
129+
[7.2.0.0]: https://github.com/ManageIQ/activerecord-virtual_attributes/compare/v7.1.2...v7.2.0.0
123130
[7.1.2]: https://github.com/ManageIQ/activerecord-virtual_attributes/compare/v7.1.1...v7.1.2
124131
[7.1.1]: https://github.com/ManageIQ/activerecord-virtual_attributes/compare/v7.1.0...v7.1.1
125132
[7.1.0]: https://github.com/ManageIQ/activerecord-virtual_attributes/compare/v7.0.0...v7.1.0

Gemfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,4 @@
22

33
source "https://rubygems.org"
44

5-
gem "activerecord", "~>7.1.5"
6-
gem "mysql2"
7-
gem "pg"
8-
gem "sqlite3", "< 2"
9-
105
gemspec

activerecord-virtual_attributes.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
2828

2929
spec.require_paths = ["lib"]
3030

31-
spec.add_runtime_dependency "activerecord", "~> 7.1", ">=7.1.5.1"
31+
spec.add_runtime_dependency "activerecord", "~> 7.2.2", ">=7.2.2.1"
3232

3333
spec.add_development_dependency "byebug"
3434
spec.add_development_dependency "database_cleaner-active_record", "~> 2.1"
@@ -40,5 +40,5 @@ Gem::Specification.new do |spec|
4040
spec.add_development_dependency "rake", "~> 13.0"
4141
spec.add_development_dependency "rspec", "~> 3.0"
4242
spec.add_development_dependency "simplecov", ">= 0.21.2"
43-
spec.add_development_dependency "sqlite3"
43+
spec.add_development_dependency "sqlite3", "< 2"
4444
end

lib/active_record/virtual_attributes.rb

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,13 @@ def virtual_attribute_names
8787
end
8888
end
8989

90-
private
91-
92-
def load_schema!
93-
super
94-
95-
virtual_attributes_to_define.each do |name, (type, options)|
96-
type = type.call if type.respond_to?(:call)
97-
type = ActiveRecord::Type.lookup(type, **options) if type.kind_of?(Symbol)
98-
99-
define_virtual_attribute(name, type)
90+
def attribute_types
91+
@attribute_types || super.tap do |hash|
92+
virtual_attributes_to_define.each do |name, (type, options)|
93+
type = type.call if type.respond_to?(:call)
94+
type = ActiveRecord::Type.lookup(type, **options) if type.kind_of?(Symbol)
95+
hash[name] = type
96+
end
10097
end
10198
end
10299

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module ActiveRecord
22
module VirtualAttributes
3-
VERSION = "7.1.2".freeze
3+
VERSION = "7.2.0.0".freeze
44
end
55
end

0 commit comments

Comments
 (0)