Skip to content

Commit

Permalink
Added resources model which will be used to store our lighthouse conf…
Browse files Browse the repository at this point in the history
…iguration information.
  • Loading branch information
baphled committed May 14, 2010
1 parent 509f99e commit dac05e2
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/models/resource.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Resource < ActiveRecord::Base
end
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
map.resources :parking,
:collection => {:tickets => :get}

map.resources :resources

map.resources :features,
:collection => {:tags => :get,
:sort => :post,
Expand Down
13 changes: 13 additions & 0 deletions db/migrate/20100514111326_add_resource_table.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class AddResourceTable < ActiveRecord::Migration
def self.up
create_table :resources, :force => true do |t|
t.column :name, :string, :limit => 100, :null => false
t.column :project_id, :string, :limit => 100, :null => false
t.timestamps
end
end

def self.down
drop_table :resources
end
end
9 changes: 8 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20100311211233) do
ActiveRecord::Schema.define(:version => 20100514111326) do

create_table "action_examples", :id => false, :force => true do |t|
t.integer "action_id", :null => false
Expand Down Expand Up @@ -69,6 +69,13 @@
t.string "location"
end

create_table "resources", :force => true do |t|
t.string "name", :limit => 100, :null => false
t.string "project_id", :limit => 100, :null => false
t.datetime "created_at"
t.datetime "updated_at"
end

create_table "step_stories", :id => false, :force => true do |t|
t.integer "story_id", :null => false
t.integer "step_id", :null => false
Expand Down
9 changes: 9 additions & 0 deletions spec/models/resource_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe Resource do
it "should have a resource name" do
Resource.stub!(:name).and_return 'baphled'
Resource.name.should eql 'baphled'
end
it "should have a project name or id"
end

0 comments on commit dac05e2

Please sign in to comment.