Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Commit

Permalink
Remove code that would allow double creation of orgs, add some constr…
Browse files Browse the repository at this point in the history
…aints
  • Loading branch information
afischer committed Jul 23, 2017
1 parent 6c3e61b commit a655391
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
9 changes: 9 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,12 @@
require_relative 'config/application'

Rails.application.load_tasks

namespace :db do
desc 'Drops, creates, and migrates the database'
task :clobber do
Rake::Task['db:drop'].invoke
Rake::Task['db:create'].invoke
Rake::Task['db:migrate'].invoke
end
end
2 changes: 0 additions & 2 deletions app/views/orgs/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

<div class="col-sm-6">
<h2>From Scratch</h2>
<% @org = Org.create %>
<% @org.name = 'foo' %>
<%= render 'form', org: @org %>
</div>

Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20170527214138_create_orgs.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CreateOrgs < ActiveRecord::Migration[5.1]
def change
create_table :orgs do |t|
t.string :name
t.string :name, null: false
t.string :tagline
t.string :bio
t.string :fbID
Expand Down
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
end

create_table "orgs", force: :cascade do |t|
t.string "name"
t.string "name", null: false
t.string "tagline"
t.string "bio"
t.string "fbID"
Expand Down

0 comments on commit a655391

Please sign in to comment.