Commit a847501fd2ffc1c4becc7d0d352d80168d9b3568
1 parent
34e15801
Exists in
master
and in
4 other branches
Event entity created
Showing
9 changed files
with
75 additions
and
3 deletions
Show diff stats
... | ... | @@ -0,0 +1,17 @@ |
1 | +class Event < ActiveRecord::Base | |
2 | + belongs_to :project | |
3 | + serialize :data | |
4 | +end | |
5 | +# == Schema Information | |
6 | +# | |
7 | +# Table name: events | |
8 | +# | |
9 | +# id :integer not null, primary key | |
10 | +# data_type :string(255) | |
11 | +# data_id :string(255) | |
12 | +# title :string(255) | |
13 | +# data :text | |
14 | +# project_id :integer | |
15 | +# created_at :datetime not null | |
16 | +# updated_at :datetime not null | |
17 | +# | ... | ... |
app/models/project.rb
app/models/users_project.rb
app/models/wiki.rb
... | ... | @@ -31,3 +31,16 @@ class Wiki < ActiveRecord::Base |
31 | 31 | |
32 | 32 | end |
33 | 33 | end |
34 | +# == Schema Information | |
35 | +# | |
36 | +# Table name: wikis | |
37 | +# | |
38 | +# id :integer not null, primary key | |
39 | +# title :string(255) | |
40 | +# content :text | |
41 | +# project_id :integer | |
42 | +# created_at :datetime not null | |
43 | +# updated_at :datetime not null | |
44 | +# slug :string(255) | |
45 | +# user_id :integer | |
46 | +# | ... | ... |
... | ... | @@ -0,0 +1,13 @@ |
1 | +class CreateEvents < ActiveRecord::Migration | |
2 | + def change | |
3 | + create_table :events do |t| | |
4 | + t.string :data_type, :null => true | |
5 | + t.string :data_id, :null => true | |
6 | + t.string :title, :null => true | |
7 | + t.text :data, :null => true | |
8 | + t.integer :project_id, :null => true | |
9 | + | |
10 | + t.timestamps | |
11 | + end | |
12 | + end | |
13 | +end | ... | ... |
db/schema.rb
... | ... | @@ -11,7 +11,17 @@ |
11 | 11 | # |
12 | 12 | # It's strongly recommended to check this file into your version control system. |
13 | 13 | |
14 | -ActiveRecord::Schema.define(:version => 20120219193300) do | |
14 | +ActiveRecord::Schema.define(:version => 20120228130210) do | |
15 | + | |
16 | + create_table "events", :force => true do |t| | |
17 | + t.string "data_type" | |
18 | + t.string "data_id" | |
19 | + t.string "title" | |
20 | + t.text "data" | |
21 | + t.integer "project_id" | |
22 | + t.datetime "created_at", :null => false | |
23 | + t.datetime "updated_at", :null => false | |
24 | + end | |
15 | 25 | |
16 | 26 | create_table "issues", :force => true do |t| |
17 | 27 | t.string "title" | ... | ... |
... | ... | @@ -0,0 +1,19 @@ |
1 | +# == Schema Information | |
2 | +# | |
3 | +# Table name: events | |
4 | +# | |
5 | +# id :integer not null, primary key | |
6 | +# data_type :string(255) | |
7 | +# data_id :string(255) | |
8 | +# title :string(255) | |
9 | +# data :text | |
10 | +# project_id :integer | |
11 | +# created_at :datetime not null | |
12 | +# updated_at :datetime not null | |
13 | +# | |
14 | + | |
15 | +require 'spec_helper' | |
16 | + | |
17 | +describe Event do | |
18 | + pending "add some examples to (or delete) #{__FILE__}" | |
19 | +end | ... | ... |
spec/models/project_spec.rb
spec/models/users_project_spec.rb