######## ####### ######## ####### ######## ######## ## / / / / License \ \ \ \ ## Copyleft culture, Copyright (C) is prohibited here ## This work is licensed under a CC BY-SA 4.0 ## Creative Commons Attribution-ShareAlike 4.0 License ## Refer to the http://creativecommons.org/licenses/by-sa/4.0/ ######## ####### ######## ####### ######## ######## ## / / / / Code Climate \ \ \ \ ## Language = ruby ## Indent = space; 4 chars; ######## ####### ######## ####### ######## ######## module ArchestryLookup module Lookup class << self def dialog_folder_lookup(args, state) folderDialog = sqlQuery(state, "select id from folders where name in ('#{state[:myAppName]}') and id in ('#{conFolder[0]}')")[0] if folderDialog.is_a?(Array) sqlQuery(state, "select view_id as view_id2, view_version, model_version from views_in_model where parent_folder_id in ('#{folderDialog[0]}') and model_version = (select max(model_version) from views_in_model where view_id in (view_id2))") do |row| viewAtr = sqlQuery(state, "select name, version from views where id in ('#{row[0]}') and version = (select max(version) from views where id in ('#{row[0]}'))") if row[1] == viewAtr[0][1] id = row[0].tr("-", "_") args[:views][id] ||= {} args[:views][id][:version] = row[1] args[:views][id][:name] = state[:dialectFolder] ArchestryLookup.logger.info "ArchestryLookup functional view '#{viewAtr[0][0]}' (id #{id}, view ver.#{row[1]}, model ver.#{row[2]}) suits for me!" # of interface '#{Dialog.config.naming.interface}' for bot '#{Dialog.config.naming.instance}' end end end end end end end