GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: Gitorious aims to provide a great way of doing distributed opensource code collaboration.
Homepage: http://gitorious.org/projects/gitorious
Clone URL: git://github.com/dysinger/gitorious.git
- renamed Project#name to Project#title
- Added some view specs
js (author)
Sun Aug 19 15:21:14 -0700 2007
commit  ef4e0b241cdc6963be372fa6f3923e5254400ae5
tree    9aabf3b74accc335b6f9f86af96d3a638f91a60f
parent  0512492644a253fcc9b32d57ea46363b4d835943
...
1
2
3
4
 
5
...
1
2
3
 
4
5
0
@@ -1,5 +1,5 @@
0
 class Project < ActiveRecord::Base
0
   belongs_to :user
0
   
0
- validates_presence_of :name
0
+ validates_presence_of :title
0
 end
...
4
5
6
7
 
8
9
10
...
4
5
6
 
7
8
9
10
0
@@ -4,6 +4,6 @@
0
 
0
 <ul>
0
 <% @projects.each do |project| -%>
0
- <li><%= link_to project.name, project_path(project) -%></li>
0
+ <li><%= link_to project.title, project_path(project) -%></li>
0
 <% end -%>
0
 </ul>
0
\ No newline at end of file
...
3
4
5
6
 
7
8
9
...
3
4
5
 
6
7
8
9
0
@@ -3,7 +3,7 @@
0
 <%= error_messages_for :project -%>
0
 
0
 <% form_for :project, :url => projects_path do |f| -%>
0
- <label>Title: <%= f.text_field :name -%></label>
0
+ <label>Title: <%= f.text_field :title -%></label>
0
   <label>Description: <%= f.text_area :description -%></label>
0
   
0
   <%= submit_tag -%>
...
1
2
 
 
3
...
 
1
2
3
4
0
@@ -1 +1,2 @@
0
-<h1><%= @project.name -%></h1>
0
\ No newline at end of file
0
+<h1><%= @project.title -%></h1>
0
+<p><%= @project.description -%></p>
0
\ No newline at end of file
...
2
3
4
5
 
6
7
8
 
9
10
11
12
13
14
15
 
16
17
18
...
2
3
4
 
5
6
7
 
8
9
10
11
12
13
14
 
15
16
17
18
0
@@ -2,17 +2,17 @@
0
 # migrations feature of ActiveRecord to incrementally modify your database, and
0
 # then regenerate this schema definition.
0
 
0
-ActiveRecord::Schema.define(:version => 2) do
0
+ActiveRecord::Schema.define(:version => 3) do
0
 
0
   create_table "projects", :force => true do |t|
0
- t.column "name", :string
0
+ t.column "title", :string
0
     t.column "description", :text
0
     t.column "user_id", :integer
0
     t.column "created_at", :datetime
0
     t.column "updated_at", :datetime
0
   end
0
 
0
- add_index "projects", ["name"], :name => "index_projects_on_name"
0
+ add_index "projects", ["title"], :name => "index_projects_on_name"
0
   add_index "projects", ["user_id"], :name => "index_projects_on_user_id"
0
 
0
   create_table "users", :force => true do |t|
...
32
33
34
35
 
36
37
38
39
 
40
41
42
...
52
53
54
55
 
56
57
58
59
 
60
61
62
...
32
33
34
 
35
36
37
38
 
39
40
41
42
...
52
53
54
 
55
56
57
58
 
59
60
61
62
0
@@ -32,11 +32,11 @@ describe ProjectsController do
0
   
0
   it "POST projects/create with valid data should create project" do
0
     login_as :johan
0
- post :create, :project => {:name => "project x"}
0
+ post :create, :project => {:title => "project x"}
0
     response.should be_redirect
0
     response.should redirect_to(url_path(projects_path))
0
     
0
- Project.find_by_name("project x").user.should == users(:johan)
0
+ Project.find_by_title("project x").user.should == users(:johan)
0
   end
0
   
0
   it "projects/create should require login" do
0
@@ -52,11 +52,11 @@ describe ProjectsController do
0
   it "PUT projects/update with valid data should update record" do
0
     login_as :johan
0
     project = projects(:johans_project)
0
- put :update, :id => project.id, :project => {:name => "new name"}
0
+ put :update, :id => project.id, :project => {:title => "new name"}
0
     assigns(:project).should == project
0
     response.should be_redirect
0
     response.should redirect_to(project_path(project))
0
- project.reload.name.should == "new name"
0
+ project.reload.title.should == "new name"
0
   end
0
   
0
   it "projects/destroy should require login" do
...
1
2
3
4
 
5
6
7
...
1
2
3
 
4
5
6
7
0
@@ -1,7 +1,7 @@
0
 # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
0
 johans_project:
0
   id: 1
0
- name: johans project
0
+ title: johans project
0
   updated_at: <%= 2.days.ago.to_s(:db) %>
0
   description: this is johans project yo
0
   user_id: 1
...
2
3
4
5
 
6
7
8
9
10
11
12
 
13
14
15
 
16
17
18
...
2
3
4
 
5
6
7
8
9
10
11
 
12
13
14
 
15
16
17
18
0
@@ -2,17 +2,17 @@ require File.dirname(__FILE__) + '/../spec_helper'
0
 
0
 describe Project do
0
   before(:each) do
0
- @project = Project.new(:name => "foo project")
0
+ @project = Project.new(:title => "foo project")
0
   end
0
 
0
   it "should have valid associations" do
0
     @project.should have_valid_associations
0
   end
0
   
0
- it "should have a name to be valid" do
0
+ it "should have a title to be valid" do
0
     project = Project.new
0
     project.should_not be_valid
0
- project.name = "foo"
0
+ project.title = "foo"
0
     project.should be_valid
0
   end
0
 end

Comments

    No one has commented yet.