mirror of
https://github.com/redmine/redmine.git
synced 2026-05-06 06:07:08 +02:00
Use ApplicationRecord instead of ActiveRecord::Base (#38975).
Patch by Minoru Maeda (@maeda-m). git-svn-id: https://svn.redmine.org/redmine/trunk@22619 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -27,16 +27,16 @@ class PatchesTest < ActiveSupport::TestCase
|
||||
Setting.default_language = 'en'
|
||||
end
|
||||
|
||||
test "ActiveRecord::Base.human_attribute_name should transform name to field_name" do
|
||||
assert_equal l('field_last_login_on'), ActiveRecord::Base.human_attribute_name('last_login_on')
|
||||
test "ApplicationRecord.human_attribute_name should transform name to field_name" do
|
||||
assert_equal l('field_last_login_on'), ApplicationRecord.human_attribute_name('last_login_on')
|
||||
end
|
||||
|
||||
test "ActiveRecord::Base.human_attribute_name should cut extra _id suffix for better validation" do
|
||||
assert_equal l('field_last_login_on'), ActiveRecord::Base.human_attribute_name('last_login_on_id')
|
||||
test "ApplicationRecord.human_attribute_name should cut extra _id suffix for better validation" do
|
||||
assert_equal l('field_last_login_on'), ApplicationRecord.human_attribute_name('last_login_on_id')
|
||||
end
|
||||
|
||||
test "ActiveRecord::Base.human_attribute_name should default to humanized value if no translation has been found (useful for custom fields)" do
|
||||
assert_equal 'Patch name', ActiveRecord::Base.human_attribute_name('Patch name')
|
||||
test "ApplicationRecord.human_attribute_name should default to humanized value if no translation has been found (useful for custom fields)" do
|
||||
assert_equal 'Patch name', ApplicationRecord.human_attribute_name('Patch name')
|
||||
end
|
||||
|
||||
test 'ActionView::Helpers::FormHelper.date_field should add max=9999-12-31 to limit year value to 4 digits by default' do
|
||||
|
||||
Reference in New Issue
Block a user