Added Developer#salary for the type tests

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@216 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson
2004-12-19 11:41:34 +00:00
parent 7b5ed66122
commit 87b0d72fe6
5 changed files with 5 additions and 2 deletions

View File

@@ -36,6 +36,7 @@ CREATE TABLE `topics` (
CREATE TABLE `developers` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(100) default NULL,
`salary` int(11) NULL,
PRIMARY KEY (`id`)
);

View File

@@ -29,6 +29,7 @@ CREATE TABLE developers_projects (
CREATE TABLE developers (
id serial,
name character varying(100),
salary integer,
PRIMARY KEY (id)
);
SELECT setval('developers_id_seq', 100);

View File

@@ -32,7 +32,8 @@ CREATE TABLE 'topics' (
CREATE TABLE 'developers' (
'id' INTEGER PRIMARY KEY NOT NULL,
'name' TEXT DEFAULT NULL
'name' TEXT DEFAULT NULL,
'salary' INTEGER NULL
);
CREATE TABLE 'projects' (

View File

@@ -41,6 +41,7 @@ CREATE TABLE developers (
CREATE TABLE projects (
id int NOT NULL IDENTITY(1, 1),
name varchar(100) default NULL,
salary int default NULL,
PRIMARY KEY (id)
);

View File

@@ -348,7 +348,6 @@ class ValidationsTest < Test::Unit::TestCase
assert_equal "hoo 5", t.errors["title"]
end
def test_throw_away_typing
d = Developer.create "name" => "David", "salary" => "100,000"
assert !d.valid?