Skip to content
Snippets Groups Projects
Commit 183334bd authored by Mauricio Giacomini Girardello's avatar Mauricio Giacomini Girardello
Browse files

bugfix: fix OrientDb::Client.instance method, witch was returning TrueClass

parent a389ada2
No related branches found
No related tags found
No related merge requests found
......@@ -3,4 +3,4 @@ test:
- gem install bundler
- bundle install
- bundle exec rake db:migrate RAILS_ENV=test
- bundle exec rake test
- bundle exec rake test
\ No newline at end of file
require 'yaml'
orientdb_configs = YAML.load_file Rails.root.join('config').to_s.concat('/orientdb.yml')
env_config = orientdb_configs.fetch(Rails.env)
if Rails.env.production?
OrientDb::Config.host = ENV['PORTALMEC_ORIENTDB_HOST']
OrientDb::Config.database = ENV['PORTALMEC_ORIENTDB_DATABASE']
OrientDb::Config.user = ENV['PORTALMEC_ORIENTDB_USERNAME']
OrientDb::Config.password = ENV['PORTALMEC_ORIENTDB_PASSWD']
OrientDb::Config.port = ENV['PORTALMEC_ORIENTDB_PORT']
else
OrientDb::Config.host = env_config['host']
OrientDb::Config.database = env_config['database']
OrientDb::Config.user = env_config['username']
OrientDb::Config.password = env_config['password']
end
\ No newline at end of file
require 'yaml'
# connect to orientdb server
orientdb_configs = YAML.load_file Rails.root.join('config').to_s.concat('/orientdb.yml')
env_config = orientdb_configs.fetch(Rails.env)
OrientDb::Config.host = env_config['host']
OrientDb::Config.database = env_config['database']
OrientDb::Config.user = env_config['username']
OrientDb::Config.password = env_config['password']
Repository::Environments.create :development do |repository|
repository.register :learning_object, OrientDb::LearningObjectRepository.new(OrientDb::Client.instance)
repository.register :mainPage, OrientDb::MainPageRepository.new(OrientDb::Client.instance)
......
development: &development
host: mecdb2.c3sl.ufpr.br
database: PortalMEC
host: localhost
database: portalmec
username: admin
password: admin
port: 2480
......
......@@ -9,6 +9,7 @@ class OrientDb::Client
begin
@@client = Orientdb4r.client :host => OrientDb::Config::host, :port => OrientDb::Config::port, :ssl => OrientDb::Config::ssl
@@client.connect(database: OrientDb::Config::database, user: OrientDb::Config::user, password: OrientDb::Config::password)
@@client
rescue Orientdb4r::UnauthorizedError => e
raise 'Wrong orient db credentials'
end
......
......@@ -9,6 +9,7 @@ class OrientDb::Migrations
@migrations << CreateHighlight.new(client)
@migrations << CreateUniversity.new(client)
@migrations << CreateUser.new(client)
@migrations << CreateMainpage.new(client)
end
##
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment