Skip to content
Browse files

Fix: Database to postgres

  • Loading branch information...
1 parent 22a58b4 commit c9a0003fefd5236a22998559fd9af0e365f20adb @jackquack committed
View
4 Gemfile
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
gem 'rails'
-gem 'mysql2'
+gem 'pg'
gem 'parallel'
gem 'json'
gem 'has_scope'
@@ -15,6 +15,8 @@ gem 'guid'
gem 'sentient_user'
gem 'devise'
gem 'omniauth-facebook'
+gem 'bitcoin-client'
+gem 'configatron'
group :assets do
gem 'sass-rails', '~> 3.2.3'
View
13 Gemfile.lock
@@ -45,6 +45,8 @@ GEM
bcrypt-ruby (3.0.1)
binding_of_caller (0.7.1)
debug_inspector (>= 0.0.1)
+ bitcoin-client (0.0.1)
+ rest-client (= 1.6.3)
builder (3.0.4)
coderay (1.0.9)
coffee-rails (3.2.2)
@@ -55,6 +57,8 @@ GEM
execjs
coffee-script-source (1.6.2)
columnize (0.3.6)
+ configatron (2.10.0)
+ yamler (>= 0.1.0)
debug_inspector (0.0.2)
debugger (1.5.0)
columnize (>= 0.3.1)
@@ -111,7 +115,6 @@ GEM
mime-types (1.21)
multi_json (1.7.2)
multipart-post (1.2.0)
- mysql2 (0.3.11)
oauth2 (0.8.1)
faraday (~> 0.8)
httpauth (~> 0.1)
@@ -128,6 +131,7 @@ GEM
omniauth (~> 1.0)
orm_adapter (0.4.0)
parallel (0.6.3)
+ pg (0.14.1)
polyamorous (0.5.0)
activerecord (~> 3.0)
polyglot (0.3.3)
@@ -175,6 +179,8 @@ GEM
json (~> 1.4)
responders (0.9.3)
railties (~> 3.1)
+ rest-client (1.6.3)
+ mime-types (>= 1.16)
ruby-growl (3.0)
sass (3.2.7)
sass-rails (3.2.6)
@@ -207,14 +213,17 @@ GEM
uniform_notifier (1.2.0)
warden (1.2.1)
rack (>= 1.0)
+ yamler (0.1.0)
yard (0.8.5.2)
PLATFORMS
ruby
DEPENDENCIES
+ bitcoin-client
bullet!
coffee-rails (~> 3.2.1)
+ configatron
devise
gon
guid
@@ -225,10 +234,10 @@ DEPENDENCIES
js-routes
json
kaminari
- mysql2
nested_form!
omniauth-facebook
parallel
+ pg
pry
pry-debugger
pry-doc
View
2 app/controllers/buys_controller.rb
@@ -5,7 +5,7 @@ def create
create!
end
def accept
- @prediction = Prediction.find(params[:sell][:prediction_id])
+ @prediction = Prediction.find(params[:buy][:prediction_id])
@buy = Buy.find(params[:id])
@sell = Sell.create(
price: @buy.price,
View
2 app/views/buys/new.html.haml
@@ -2,4 +2,4 @@
= render 'form'
-= link_to 'Back', buys_path
+= link_to 'Back', prediction_path(@prediction.id)
View
2 app/views/sells/new.html.haml
@@ -2,4 +2,4 @@
= render 'form'
-= link_to 'Back', sells_path
+= link_to 'Back', prediction_path(@prediction.id)
View
2 app/views/transactions/show.html.haml
@@ -18,4 +18,4 @@
= link_to 'Edit', edit_transaction_path(@transaction)
\|
-= link_to 'Back', transactions_path
+= link_to 'Back', prediction_path(@transaction.prediction_id)
View
21 config/database.yml
@@ -4,34 +4,33 @@
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
- adapter: mysql2
+ adapter: postgresql
encoding: utf8
reconnect: false
database: bitpredictor_development
pool: 5
- username: root
- password: root
- socket: /tmp/mysql.sock
+ username: postgres
+ password: asdcVFGH
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
- adapter: mysql2
+ adapter: postgresql
encoding: utf8
reconnect: false
database: bitpredictor_test
pool: 5
username: root
password: root
- socket: /tmp/mysql.sock
production:
- adapter: mysql2
+ adapter: postgresql
encoding: utf8
reconnect: false
- database: bitpredictor_production
+ host: ec2-54-243-190-226.compute-1.amazonaws.com
+ database: darpi6cdn0m7lo
pool: 5
- username: root
- password: root
- socket: /tmp/mysql.sock
+ port: 5432
+ username: diocunbvrejesy
+ password: SesGtV_VSw94OVQ5p9_F2sIJLz
View
12 db/schema.rb
@@ -14,11 +14,11 @@
ActiveRecord::Schema.define(:version => 20130323180246) do
create_table "buys", :force => true do |t|
- t.decimal "number_of_shares", :precision => 10, :scale => 0
+ t.decimal "number_of_shares"
t.integer "user_id"
t.integer "prediction_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.float "price"
t.integer "transaction_id"
end
@@ -35,10 +35,10 @@
end
create_table "sells", :force => true do |t|
- t.decimal "number_of_shares", :precision => 10, :scale => 0
+ t.decimal "number_of_shares"
t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.integer "prediction_id"
t.float "price"
t.integer "transaction_id"

0 comments on commit c9a0003

Please sign in to comment.
Something went wrong with that request. Please try again.