aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/fixtures/topic.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-09-02 21:00:09 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-09-02 21:00:09 +0000
commitd0696d764189996422c3dea649c388b7685a10e5 (patch)
treee0f6245dc606ecbff957317a4279a4dac9fadaba /activerecord/test/fixtures/topic.rb
parentad63005cdd4260b225f097ebde4fa80a36f84729 (diff)
downloadrails-d0696d764189996422c3dea649c388b7685a10e5.tar.gz
rails-d0696d764189996422c3dea649c388b7685a10e5.tar.bz2
rails-d0696d764189996422c3dea649c388b7685a10e5.zip
to_xml: the :methods option works on arrays of records. Closes #5845.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4909 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/fixtures/topic.rb')
-rwxr-xr-xactiverecord/test/fixtures/topic.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/test/fixtures/topic.rb b/activerecord/test/fixtures/topic.rb
index 9b20f02cb0..d7cd52e33e 100755
--- a/activerecord/test/fixtures/topic.rb
+++ b/activerecord/test/fixtures/topic.rb
@@ -9,6 +9,11 @@ class Topic < ActiveRecord::Base
Topic.find(parent_id)
end
+ # trivial method for testing Array#to_xml with :methods
+ def topic_id
+ id
+ end
+
protected
def default_written_on
self.written_on = Time.now unless attribute_present?("written_on")
@@ -17,4 +22,4 @@ class Topic < ActiveRecord::Base
def destroy_children
self.class.delete_all "parent_id = #{id}"
end
-end \ No newline at end of file
+end