mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Doesn't need to sort, lets users of attribute_names sort them if they want
This commit is contained in:
parent
6673d88f6f
commit
42c51b8527
2 changed files with 3 additions and 3 deletions
|
@ -1455,9 +1455,9 @@ MSG
|
|||
@attributes.has_key?(attr_name.to_s)
|
||||
end
|
||||
|
||||
# Returns an array of names for the attributes available on this object sorted alphabetically.
|
||||
# Returns an array of names for the attributes available on this object.
|
||||
def attribute_names
|
||||
@attributes.keys.sort
|
||||
@attributes.keys
|
||||
end
|
||||
|
||||
# Returns the value of the attribute identified by <tt>attr_name</tt> after it has been typecast (for example,
|
||||
|
|
|
@ -25,7 +25,7 @@ class ReflectionTest < ActiveRecord::TestCase
|
|||
def test_read_attribute_names
|
||||
assert_equal(
|
||||
%w( id title author_name author_email_address bonus_time written_on last_read content group approved replies_count parent_id parent_title type created_at updated_at ).sort,
|
||||
@first.attribute_names
|
||||
@first.attribute_names.sort
|
||||
)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue