diff options
author | Akira Matsuda <ronnie@dio.jp> | 2016-12-23 15:51:03 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2016-12-24 00:15:31 +0900 |
commit | fce62f1f839877d4522609cfaa1409bf3ccfd982 (patch) | |
tree | eb915568782464330c4f5021a71880ce3c103a6f /activerecord/test/models | |
parent | 79c17a2d913821e8bb32127e7f435a6d4e3ed058 (diff) | |
download | rails-fce62f1f839877d4522609cfaa1409bf3ccfd982.tar.gz rails-fce62f1f839877d4522609cfaa1409bf3ccfd982.tar.bz2 rails-fce62f1f839877d4522609cfaa1409bf3ccfd982.zip |
Privatize unneededly protected methods in Active Record tests
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/company_in_module.rb | 2 | ||||
-rw-r--r-- | activerecord/test/models/subject.rb | 2 | ||||
-rw-r--r-- | activerecord/test/models/topic.rb | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/models/company_in_module.rb b/activerecord/test/models/company_in_module.rb index 682f99e365..0782c1eff4 100644 --- a/activerecord/test/models/company_in_module.rb +++ b/activerecord/test/models/company_in_module.rb @@ -88,7 +88,7 @@ module MyApplication validate :check_empty_credit_limit - protected + private def check_empty_credit_limit errors.add("credit_card", :blank) if credit_card.blank? diff --git a/activerecord/test/models/subject.rb b/activerecord/test/models/subject.rb index 29e290825e..504f68a296 100644 --- a/activerecord/test/models/subject.rb +++ b/activerecord/test/models/subject.rb @@ -5,7 +5,7 @@ class Subject < ActiveRecord::Base # as otherwise synonym test was failing after_initialize :set_email_address - protected + private def set_email_address unless persisted? self.author_email_address = "test@test.com" diff --git a/activerecord/test/models/topic.rb b/activerecord/test/models/topic.rb index db04735d01..0420e2d15c 100644 --- a/activerecord/test/models/topic.rb +++ b/activerecord/test/models/topic.rb @@ -73,7 +73,7 @@ class Topic < ActiveRecord::Base write_attribute(:approved, val) end - protected + private def default_written_on self.written_on = Time.now unless attribute_present?("written_on") |