aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/fixtures
diff options
context:
space:
mode:
authorNicholas Seckar <nseckar@gmail.com>2006-02-27 20:29:28 +0000
committerNicholas Seckar <nseckar@gmail.com>2006-02-27 20:29:28 +0000
commitada11d6313bd1f74c6a229caca36ca063b38da4e (patch)
tree27f5a7e4a3f913d7cbe4200594afe6421a2fa3d6 /activerecord/test/fixtures
parentd0bd952aff3f42ed95eed701916bbdf9e6f01cca (diff)
downloadrails-ada11d6313bd1f74c6a229caca36ca063b38da4e.tar.gz
rails-ada11d6313bd1f74c6a229caca36ca063b38da4e.tar.bz2
rails-ada11d6313bd1f74c6a229caca36ca063b38da4e.zip
Add set_fixture_class to allow the use of table name accessors with models which use set_default_name. Closes #3935
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3690 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/fixtures')
-rw-r--r--activerecord/test/fixtures/db_definitions/sqlite.sql5
-rw-r--r--activerecord/test/fixtures/funny_jokes.yml14
-rw-r--r--activerecord/test/fixtures/joke.rb6
3 files changed, 25 insertions, 0 deletions
diff --git a/activerecord/test/fixtures/db_definitions/sqlite.sql b/activerecord/test/fixtures/db_definitions/sqlite.sql
index 685c2abc8b..5a7fec3d7e 100644
--- a/activerecord/test/fixtures/db_definitions/sqlite.sql
+++ b/activerecord/test/fixtures/db_definitions/sqlite.sql
@@ -4,6 +4,11 @@ CREATE TABLE 'accounts' (
'credit_limit' INTEGER DEFAULT NULL
);
+CREATE TABLE 'funny_jokes' (
+ 'id' INTEGER PRIMARY KEY NOT NULL,
+ 'name' TEXT DEFAULT NULL
+);
+
CREATE TABLE 'companies' (
'id' INTEGER PRIMARY KEY NOT NULL,
'type' VARCHAR(255) DEFAULT NULL,
diff --git a/activerecord/test/fixtures/funny_jokes.yml b/activerecord/test/fixtures/funny_jokes.yml
new file mode 100644
index 0000000000..834481bc60
--- /dev/null
+++ b/activerecord/test/fixtures/funny_jokes.yml
@@ -0,0 +1,14 @@
+a_joke:
+ id: 1
+ name: Knock knock
+
+another_joke:
+ id: 2
+ name: The Aristocrats
+a_joke:
+ id: 1
+ name: Knock knock
+
+another_joke:
+ id: 2
+ name: The Aristocrats \ No newline at end of file
diff --git a/activerecord/test/fixtures/joke.rb b/activerecord/test/fixtures/joke.rb
new file mode 100644
index 0000000000..8006a43bd7
--- /dev/null
+++ b/activerecord/test/fixtures/joke.rb
@@ -0,0 +1,6 @@
+class Joke < ActiveRecord::Base
+ set_table_name 'funny_jokes'
+end
+class Joke < ActiveRecord::Base
+ set_table_name 'funny_jokes'
+end \ No newline at end of file