diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-12-21 02:05:27 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2018-12-21 02:05:27 +0900 |
commit | d5699198a45a91250e1adb3ed899b0b46b4ac879 (patch) | |
tree | 1abcd90d226032340cd5434f591fb7b7d158f5e6 /activemodel | |
parent | 8034dde023a64b98c6b3edb80a44e4cc23f8979f (diff) | |
download | rails-d5699198a45a91250e1adb3ed899b0b46b4ac879.tar.gz rails-d5699198a45a91250e1adb3ed899b0b46b4ac879.tar.bz2 rails-d5699198a45a91250e1adb3ed899b0b46b4ac879.zip |
Module#{attr,attr_accessor,attr_reader,attr_writer} become public since Ruby 2.5
https://bugs.ruby-lang.org/issues/14132
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/lib/active_model/validations/acceptance.rb | 4 | ||||
-rw-r--r-- | activemodel/lib/active_model/validations/confirmation.rb | 4 | ||||
-rw-r--r-- | activemodel/lib/active_model/validator.rb | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/activemodel/lib/active_model/validations/acceptance.rb b/activemodel/lib/active_model/validations/acceptance.rb index 9ff342d72b..6fd54270f2 100644 --- a/activemodel/lib/active_model/validations/acceptance.rb +++ b/activemodel/lib/active_model/validations/acceptance.rb @@ -55,8 +55,8 @@ module ActiveModel attr_readers = attributes.reject { |name| klass.attribute_method?(name) } attr_writers = attributes.reject { |name| klass.attribute_method?("#{name}=") } klass.define_attribute_methods - klass.send(:attr_reader, *attr_readers) - klass.send(:attr_writer, *attr_writers) + klass.attr_reader(*attr_readers) + klass.attr_writer(*attr_writers) end private diff --git a/activemodel/lib/active_model/validations/confirmation.rb b/activemodel/lib/active_model/validations/confirmation.rb index 1b5d5b09ab..b549755ba4 100644 --- a/activemodel/lib/active_model/validations/confirmation.rb +++ b/activemodel/lib/active_model/validations/confirmation.rb @@ -19,11 +19,11 @@ module ActiveModel private def setup!(klass) - klass.send(:attr_reader, *attributes.map do |attribute| + klass.attr_reader(*attributes.map do |attribute| :"#{attribute}_confirmation" unless klass.method_defined?(:"#{attribute}_confirmation") end.compact) - klass.send(:attr_writer, *attributes.map do |attribute| + klass.attr_writer(*attributes.map do |attribute| :"#{attribute}_confirmation" unless klass.method_defined?(:"#{attribute}_confirmation=") end.compact) end diff --git a/activemodel/lib/active_model/validator.rb b/activemodel/lib/active_model/validator.rb index e17c3ca7b3..94d53b8dd1 100644 --- a/activemodel/lib/active_model/validator.rb +++ b/activemodel/lib/active_model/validator.rb @@ -90,7 +90,7 @@ module ActiveModel # class MyValidator < ActiveModel::Validator # def initialize(options={}) # super - # options[:class].send :attr_accessor, :custom_attribute + # options[:class].attr_accessor :custom_attribute # end # end class Validator |