opener-scorer 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/config/database.rb +13 -12
- data/lib/opener/scorer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5847623ff1e420084cafc853ee471ba7ca3cdbba
|
|
4
|
+
data.tar.gz: 4f02f6dc97967c621f629f72d14aa6b85e05724e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 13be740678aaed976690a837223997b6db91fa38a48827c6c005f644ca93fa0970c7a199099db2fd0745ebcbcfdc8fa8a4c237b7e0abaae9623798e360098f0a
|
|
7
|
+
data.tar.gz: b926359ed64e45209ffd422fc4aeab4964d042b21c4744096bcba5a823a77f2c551887e120a15537665d4f2f37c3e7afbf5138a693d04a74ebf88d6400f182d3
|
data/config/database.rb
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
require 'active_record'
|
|
2
2
|
require 'activerecord-jdbcmysql-adapter'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
db_pass = ENV["DB_PASS"]
|
|
5
|
+
db_name = ENV["DB_NAME"]
|
|
6
|
+
db_user = ENV["DB_USER"]
|
|
7
|
+
db_host = ENV["DB_HOST"]
|
|
8
8
|
|
|
9
9
|
if ENV["RACK_ENV"] == 'production'
|
|
10
10
|
ActiveRecord::Base.establish_connection(
|
|
11
|
-
:
|
|
12
|
-
:
|
|
13
|
-
:
|
|
14
|
-
:
|
|
15
|
-
:
|
|
11
|
+
adapter: 'mysql2',
|
|
12
|
+
database: db_name,
|
|
13
|
+
host: db_host,
|
|
14
|
+
username: db_user,
|
|
15
|
+
password: db_pass
|
|
16
16
|
)
|
|
17
17
|
else
|
|
18
18
|
ActiveRecord::Base.establish_connection(
|
|
19
19
|
adapter: 'mysql2',
|
|
20
|
-
host: 'localhost',
|
|
20
|
+
host: db_host || 'localhost',
|
|
21
21
|
username: 'root',
|
|
22
|
-
password:
|
|
23
|
-
database:
|
|
22
|
+
password: db_pass || '',
|
|
23
|
+
database: db_name || 'opener_development'
|
|
24
24
|
)
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
if ActiveRecord::Base.connection.execute("SHOW INDEX FROM output_scores").nil?
|
|
28
28
|
ActiveRecord::Base.connection.execute("CREATE INDEX uuid_index ON output_scores(uuid);")
|
|
29
29
|
end
|
|
30
|
+
|
|
30
31
|
ActiveRecord::Base.connection.execute("CREATE TABLE IF NOT EXISTS output_scores (uuid varchar(40), raw_text longtext, bathroom double,breakfast double,cleanliness double,facilities double,internet double,location double,noise double,parking double,restaurant double,room double,sleeping_comfort double,staff double,swimming_pool double,value_for_money double, overall double);")
|