mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Provide test for #4840: to_xml doesn't work in such case: Event.select('title as t').to_xml
This commit is contained in:
parent
fe0db2b805
commit
aa40543022
1 changed files with 6 additions and 0 deletions
|
@ -262,4 +262,10 @@ class DatabaseConnectedXmlSerializationTest < ActiveRecord::TestCase
|
|||
assert array.include? 'github'
|
||||
end
|
||||
|
||||
def test_should_support_aliased_attributes
|
||||
xml = Author.select("name as firstname").to_xml
|
||||
array = Hash.from_xml(xml)['authors']
|
||||
assert_equal array.size, array.select { |author| author.has_key? 'firstname' }.size
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue