diff --git a/.gitignore b/.gitignore index 7af8eed..a061579 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ # Ignore the default SQLite database. /db/*.sqlite3 -/db/db_development +/db/*development* # Ignore all logfiles and tempfiles. /log/*.log diff --git a/Gemfile b/Gemfile index af85153..d4df81c 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ gem 'rails', '3.2.8' # gem 'rails', :git => 'git://github.com/rails/rails.git' gem 'pg' -gem 'sqlite3' +#gem 'sqlite3' gem 'sorcery' # Gems used only for assets and not required diff --git a/Gemfile.lock b/Gemfile.lock index 8c83151..f78bb84 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -96,7 +96,6 @@ GEM hike (~> 1.2) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - sqlite3 (1.3.6) thor (0.15.4) tilt (1.3.3) treetop (1.4.10) @@ -116,5 +115,4 @@ DEPENDENCIES rails (= 3.2.8) sass-rails (~> 3.2.3) sorcery - sqlite3 uglifier (>= 1.0.3) diff --git a/app/controllers/user_sessions_controller.rb b/app/controllers/user_sessions_controller.rb index 7186e79..c89eb44 100644 --- a/app/controllers/user_sessions_controller.rb +++ b/app/controllers/user_sessions_controller.rb @@ -14,6 +14,6 @@ def create def destroy logout - redirect_to(:authors, :message => 'Logged out!') + redirect_to(:root, :message => 'Logged out!') end end diff --git a/config/database.yml b/config/database.yml index 12b2cf4..a93d1ee 100644 --- a/config/database.yml +++ b/config/database.yml @@ -3,10 +3,17 @@ # # Ensure the SQLite 3 gem is defined in your Gemfile # gem 'sqlite3' +#development: +# adapter: sqlite3 +# database: db/db_development +# timeout: 5000 development: - adapter: sqlite3 - database: db/db_development - timeout: 5000 + adapter: postgresql + encoding: utf8 + database: fight_bets_development + pool: 5 + username: fight_bets + password: maça # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". diff --git a/db/schema.rb b/db/schema.rb index ced3644..ca2b0a3 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -15,10 +15,10 @@ create_table "bets", :force => true do |t| t.integer "user_id" + t.integer "fight_id" t.string "winner" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.integer "fight_id" end create_table "events", :force => true do |t|