Event entity created
This commit is contained in:
parent
34e1580184
commit
a847501fd2
9 changed files with 75 additions and 3 deletions
17
app/models/event.rb
Normal file
17
app/models/event.rb
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
class Event < ActiveRecord::Base
|
||||||
|
belongs_to :project
|
||||||
|
serialize :data
|
||||||
|
end
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: events
|
||||||
|
#
|
||||||
|
# id :integer not null, primary key
|
||||||
|
# data_type :string(255)
|
||||||
|
# data_id :string(255)
|
||||||
|
# title :string(255)
|
||||||
|
# data :text
|
||||||
|
# project_id :integer
|
||||||
|
# created_at :datetime not null
|
||||||
|
# updated_at :datetime not null
|
||||||
|
#
|
|
@ -364,5 +364,6 @@ end
|
||||||
# issues_enabled :boolean default(TRUE), not null
|
# issues_enabled :boolean default(TRUE), not null
|
||||||
# wall_enabled :boolean default(TRUE), not null
|
# wall_enabled :boolean default(TRUE), not null
|
||||||
# merge_requests_enabled :boolean default(TRUE), not null
|
# merge_requests_enabled :boolean default(TRUE), not null
|
||||||
|
# wiki_enabled :boolean default(TRUE), not null
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,6 @@ end
|
||||||
# project_id :integer not null
|
# project_id :integer not null
|
||||||
# created_at :datetime
|
# created_at :datetime
|
||||||
# updated_at :datetime
|
# updated_at :datetime
|
||||||
# repo_access :integer default(0), not null
|
|
||||||
# project_access :integer default(0), not null
|
# project_access :integer default(0), not null
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -31,3 +31,16 @@ class Wiki < ActiveRecord::Base
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: wikis
|
||||||
|
#
|
||||||
|
# id :integer not null, primary key
|
||||||
|
# title :string(255)
|
||||||
|
# content :text
|
||||||
|
# project_id :integer
|
||||||
|
# created_at :datetime not null
|
||||||
|
# updated_at :datetime not null
|
||||||
|
# slug :string(255)
|
||||||
|
# user_id :integer
|
||||||
|
#
|
||||||
|
|
13
db/migrate/20120228130210_create_events.rb
Normal file
13
db/migrate/20120228130210_create_events.rb
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
class CreateEvents < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :events do |t|
|
||||||
|
t.string :data_type, :null => true
|
||||||
|
t.string :data_id, :null => true
|
||||||
|
t.string :title, :null => true
|
||||||
|
t.text :data, :null => true
|
||||||
|
t.integer :project_id, :null => true
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
12
db/schema.rb
12
db/schema.rb
|
@ -11,7 +11,17 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20120219193300) do
|
ActiveRecord::Schema.define(:version => 20120228130210) do
|
||||||
|
|
||||||
|
create_table "events", :force => true do |t|
|
||||||
|
t.string "data_type"
|
||||||
|
t.string "data_id"
|
||||||
|
t.string "title"
|
||||||
|
t.text "data"
|
||||||
|
t.integer "project_id"
|
||||||
|
t.datetime "created_at", :null => false
|
||||||
|
t.datetime "updated_at", :null => false
|
||||||
|
end
|
||||||
|
|
||||||
create_table "issues", :force => true do |t|
|
create_table "issues", :force => true do |t|
|
||||||
t.string "title"
|
t.string "title"
|
||||||
|
|
19
spec/models/event_spec.rb
Normal file
19
spec/models/event_spec.rb
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: events
|
||||||
|
#
|
||||||
|
# id :integer not null, primary key
|
||||||
|
# data_type :string(255)
|
||||||
|
# data_id :string(255)
|
||||||
|
# title :string(255)
|
||||||
|
# data :text
|
||||||
|
# project_id :integer
|
||||||
|
# created_at :datetime not null
|
||||||
|
# updated_at :datetime not null
|
||||||
|
#
|
||||||
|
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe Event do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
|
@ -303,5 +303,6 @@ end
|
||||||
# issues_enabled :boolean default(TRUE), not null
|
# issues_enabled :boolean default(TRUE), not null
|
||||||
# wall_enabled :boolean default(TRUE), not null
|
# wall_enabled :boolean default(TRUE), not null
|
||||||
# merge_requests_enabled :boolean default(TRUE), not null
|
# merge_requests_enabled :boolean default(TRUE), not null
|
||||||
|
# wiki_enabled :boolean default(TRUE), not null
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,6 @@ end
|
||||||
# project_id :integer not null
|
# project_id :integer not null
|
||||||
# created_at :datetime
|
# created_at :datetime
|
||||||
# updated_at :datetime
|
# updated_at :datetime
|
||||||
# repo_access :integer default(0), not null
|
|
||||||
# project_access :integer default(0), not null
|
# project_access :integer default(0), not null
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue