Skip to content

Commit

Permalink
Doesn't need to sort, lets users of attribute_names sort them if they…
Browse files Browse the repository at this point in the history
… want
  • Loading branch information
spastorino committed Dec 2, 2010
1 parent 6673d88 commit 42c51b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions activerecord/lib/active_record/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1455,9 +1455,9 @@ def has_attribute?(attr_name)
@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,
Expand Down
2 changes: 1 addition & 1 deletion activerecord/test/cases/reflection_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_human_name
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

Expand Down

0 comments on commit 42c51b8

Please sign in to comment.