From 63b5bdea517c47b50c909c1be128d26d598db9a5 Mon Sep 17 00:00:00 2001 From: Chris Salzberg Date: Fri, 12 Apr 2019 23:23:32 +0900 Subject: Remove unused method_name from AttributeMethodMatch --- activemodel/lib/active_model/attribute_methods.rb | 4 ++-- activemodel/test/cases/attribute_methods_test.rb | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb index afeee03d4f..d87528f789 100644 --- a/activemodel/lib/active_model/attribute_methods.rb +++ b/activemodel/lib/active_model/attribute_methods.rb @@ -387,7 +387,7 @@ module ActiveModel class AttributeMethodMatcher #:nodoc: attr_reader :prefix, :suffix, :method_missing_target - AttributeMethodMatch = Struct.new(:target, :attr_name, :method_name) + AttributeMethodMatch = Struct.new(:target, :attr_name) def initialize(options = {}) @prefix, @suffix = options.fetch(:prefix, ""), options.fetch(:suffix, "") @@ -398,7 +398,7 @@ module ActiveModel def match(method_name) if @regex =~ method_name - AttributeMethodMatch.new(method_missing_target, $1, method_name) + AttributeMethodMatch.new(method_missing_target, $1) end end diff --git a/activemodel/test/cases/attribute_methods_test.rb b/activemodel/test/cases/attribute_methods_test.rb index ebb6cc542d..4e228032c3 100644 --- a/activemodel/test/cases/attribute_methods_test.rb +++ b/activemodel/test/cases/attribute_methods_test.rb @@ -264,6 +264,5 @@ class AttributeMethodsTest < ActiveModel::TestCase assert_equal "foo", match.attr_name assert_equal "attribute_test", match.target - assert_equal "foo_test", match.method_name end end -- cgit v1.2.3