From e86d1cd621ca62af6f71b04032b1e07a66c06bb6 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 20 Sep 2007 23:22:30 +0000 Subject: 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 --- activerecord/test/fixtures/contact.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 activerecord/test/fixtures/contact.rb (limited to 'activerecord/test/fixtures') 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 -- cgit v1.2.3