Sha256: ca91b496029aff1bf2c825dd86ac82cbedfcca15a1f89ff8084aacbf26910fe1
Contents?: true
Size: 1.04 KB
Versions: 209
Compression:
Stored size: 1.04 KB
Contents
module KnowledgeBaseRESTHelpers def self.association_resources @association_resources ||= [] end def association_resources [Rbbt.share.views.find(:lib)] + KnowledgeBaseRESTHelpers.association_resources end def locate_association_template_from_resource(resource, database = nil) if database == "Default" path = resource.association["Default.haml"] if path.exists? return path else return nil end end path = resource.association[database + '.haml'] return path if path.exists? nil end def locate_association_template(database) association_resources.each do |resource| path = locate_association_template_from_resource(resource, database) return path if path and path.exists? end association_resources.each do |resource| path = locate_association_template_from_resource(resource, "Default") return path if path and path.exists? end raise "Template not found for association database: #{ Misc.fingerprint database }" end end
Version data entries
209 entries across 209 versions & 1 rubygems