diff options
author | Chris Salzberg <chris@dejimata.com> | 2019-04-12 23:23:32 +0900 |
---|---|---|
committer | Chris Salzberg <chris@dejimata.com> | 2019-04-12 23:35:26 +0900 |
commit | 63b5bdea517c47b50c909c1be128d26d598db9a5 (patch) | |
tree | 4f7d1eae0d9592c3553b402a0823bc948b20f2d0 | |
parent | 713f62430a42294dcb156cc8f38b41509a60d7a6 (diff) | |
download | rails-63b5bdea517c47b50c909c1be128d26d598db9a5.tar.gz rails-63b5bdea517c47b50c909c1be128d26d598db9a5.tar.bz2 rails-63b5bdea517c47b50c909c1be128d26d598db9a5.zip |
Remove unused method_name from AttributeMethodMatch
-rw-r--r-- | activemodel/lib/active_model/attribute_methods.rb | 4 | ||||
-rw-r--r-- | 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 |