Module: Buhos
- Defined in:
- lib/error_codes.rb,
lib/buhos/stages.rb,
lib/buhos/helpers.rb,
lib/buhos/dbadapter.rb,
lib/buhos/reflection.rb,
lib/buhos/analysis_tags.rb,
lib/buhos/create_schema.rb,
lib/buhos/excel_builder.rb,
lib/buhos/search_parser.rb,
lib/buhos/graphml_builder.rb,
lib/buhos/analysis_searches.rb,
lib/buhos/controller_review.rb,
lib/buhos/criteria_processor.rb,
lib/buhos/duplicate_analysis.rb,
lib/buhos/similarity_analysis.rb,
lib/buhos/analysis_cd_decisions.rb,
lib/buhos/textual_analysis_mixin.rb,
lib/buhos/inconsistencies_analysis.rb,
lib/buhos/analysis_inc_exc_criteria.rb,
lib/buhos/analysis_quality_criteria.rb,
lib/buhos/quality_criteria_processor.rb,
model/init.rb
Defined Under Namespace
Modules: ControllerReview, Helpers, Reflection, SchemaCreation, Stages, StagesMixin, TextualAnalysisMixin Classes: AnalysisCdDecisions, AnalysisIncExcCriteria, AnalysisQualityCriteria, AnalysisSearches, AnalysisTags, Configuration, CriteriaProcessor, DBAdapter, DuplicateAnalysis, ExcelBuilder, GraphML_Builder, InconsistenciesAnalysis, NoAuthorizationId, NoCdIdError, NoCriterionIdError, NoCrossrefConnection, NoFileIdError, NoGroupIdError, NoPmcMethodError, NoPubmedConnection, NoQualityCriterionIdError, NoRecordIdError, NoRecordSearchIdError, NoReferenceIdError, NoReviewIdError, NoRoleIdError, NoScaleIdError, NoScopusConnection, NoScopusMethodError, NoSearchIdError, NoSemanticScholarMethod, NoTagClassIdError, NoTagIdError, NoUserIdError, QualityCriteriaProcessor, SearchParser, SemanticScholarError, SimilarAnalysisSr
Class Method Summary collapse
Class Method Details
.connect_to_db(db, keep_reference = true) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'model/init.rb', line 43 def self.connect_to_db(db,keep_reference=true) $db.disconnect if !$db.nil? and $db.is_a? Sequel::Database if db.is_a? Sequel::Database or db.is_a? Buhos::DBAdapter $db=db else $db=Sequel.connect(db, :encoding => 'utf8',:reconnect=>true, :keep_reference=>keep_reference) end begin $db.run("SET NAMES UTF8") rescue Sequel::DatabaseError # Not available end begin $db.run("PRAGMA encoding='UTF-8'") rescue Sequel::DatabaseError # Not available end $log_sql = Logger.new(File.dirname(__FILE__)+'/../log/app_sql.log') $db.loggers << $log_sql $db end |