Skip to content

Commit

Permalink
added model for sections
Browse files Browse the repository at this point in the history
  • Loading branch information
rsposton committed Aug 2, 2011
1 parent c33b72a commit 05c92b3
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/page.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Page < ActiveRecord::Base
end
2 changes: 2 additions & 0 deletions app/models/section.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Section < ActiveRecord::Base
end
2 changes: 2 additions & 0 deletions app/models/subject.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Subject < ActiveRecord::Base
end
15 changes: 15 additions & 0 deletions db/migrate/20110802230421_create_subjects.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class CreateSubjects < ActiveRecord::Migration
def self.up
create_table :subjects do |t|
t.string "name"
t.integer "position"
t.boolean "visible", :default => false

t.timestamps
end
end

def self.down
drop_table :subjects
end
end
16 changes: 16 additions & 0 deletions db/migrate/20110802230432_create_pages.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
class CreatePages < ActiveRecord::Migration
def self.up
create_table :pages do |t|
t.string "name"
t.permalink "string"
t.integer "position"
t.boolean "visible", :default => false

t.timestamps
end
end

def self.down
drop_table :pages
end
end
17 changes: 17 additions & 0 deletions db/migrate/20110802231629_create_sections.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class CreateSections < ActiveRecord::Migration
def self.up
create_table :sections do |t|
t.string :name
t.integer :position
t.boolean :visible
t.string :content_type
t.text :content

t.timestamps
end
end

def self.down
drop_table :sections
end
end
5 changes: 5 additions & 0 deletions spec/models/page_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require 'spec_helper'

describe Page do
pending "add some examples to (or delete) #{__FILE__}"
end
5 changes: 5 additions & 0 deletions spec/models/section_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require 'spec_helper'

describe Section do
pending "add some examples to (or delete) #{__FILE__}"
end
5 changes: 5 additions & 0 deletions spec/models/subject_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require 'spec_helper'

describe Subject do
pending "add some examples to (or delete) #{__FILE__}"
end

0 comments on commit 05c92b3

Please sign in to comment.