Skip to content

Commit

Permalink
Rails 7.1+ support
Browse files Browse the repository at this point in the history
  • Loading branch information
cgriego committed Oct 12, 2023
1 parent 1999482 commit d228711
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ActiveAttr 0.15.5 (October 10, 2023)
# ActiveAttr 0.16.0 (October 11, 2023)

* ActiveAttr now supports Ruby 3.1
* ActiveAttr now supports Ruby 3.2
Expand Down
12 changes: 10 additions & 2 deletions lib/active_attr/attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def self.filter_attributes=(new_filter_attributes)
class_attribute :filter_attributes, :instance_writer => false
self.filter_attributes = Attributes.filter_attributes

attribute_method_suffix "" if attribute_method_matchers.none? { |matcher| matcher.prefix == "" && matcher.suffix == "" }
attribute_method_suffix "" if attribute_method_patterns.none? { |matcher| matcher.prefix == "" && matcher.suffix == "" }
attribute_method_suffix "="
end

Expand Down Expand Up @@ -323,6 +323,14 @@ def inspect
"#{name}#{attributes_list}"
end

# Renamed in ActiveModel 7.1
#
# @private
# @since 0.16.0
def attribute_method_patterns
attribute_method_matchers
end unless method_defined?(:attribute_method_patterns)

protected

# Assign a set of attribute definitions, used when subclassing models
Expand All @@ -346,7 +354,7 @@ def instance_method_already_implemented?(method_name)
#
# @since 0.6.0
def attribute_methods(name)
attribute_method_matchers.map { |matcher| matcher.method_name name }
attribute_method_patterns.map { |matcher| matcher.method_name name }
end

# Ruby inherited hook to assign superclass attributes to subclasses
Expand Down
2 changes: 1 addition & 1 deletion lib/active_attr/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module ActiveAttr
# Complete version string
# @since 0.1.0
VERSION = "0.15.5"
VERSION = "0.16.0"
end

0 comments on commit d228711

Please sign in to comment.