aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/fixtures
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-09-20 23:22:30 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-09-20 23:22:30 +0000
commite86d1cd621ca62af6f71b04032b1e07a66c06bb6 (patch)
tree638a89da26f9066cc333f0ce059c3ce551a97d24 /activerecord/test/fixtures
parentdc399b96c84bc66b7c20e92fb40e9ed00daf99c2 (diff)
downloadrails-e86d1cd621ca62af6f71b04032b1e07a66c06bb6.tar.gz
rails-e86d1cd621ca62af6f71b04032b1e07a66c06bb6.tar.bz2
rails-e86d1cd621ca62af6f71b04032b1e07a66c06bb6.zip
Added ActiveRecord::Base#to_json/from_json (currently does not support :include like to_xml) [DHH]. Added ActiveRecord::Base#from_xml [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7519 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/fixtures')
-rw-r--r--activerecord/test/fixtures/contact.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/activerecord/test/fixtures/contact.rb b/activerecord/test/fixtures/contact.rb
new file mode 100644
index 0000000000..c574196d94
--- /dev/null
+++ b/activerecord/test/fixtures/contact.rb
@@ -0,0 +1,16 @@
+class Contact < ActiveRecord::Base
+ # mock out self.columns so no pesky db is needed for these tests
+ def self.column(name, sql_type = nil, options = {})
+ @columns ||= []
+ @columns << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, options[:default], sql_type.to_s, options[:null])
+ end
+
+ column :name, :string
+ column :age, :integer
+ column :avatar, :binary
+ column :created_at, :datetime
+ column :awesome, :boolean
+ column :preferences, :string
+
+ serialize :preferences
+end \ No newline at end of file