92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
# File 'lib/blazer/data_source.rb', line 92
def run_statement(statement, options = {})
async = options[:async]
result = nil
if cache_mode != "off"
if options[:refresh_cache]
clear_cache(statement) else
result = read_cache(statement_cache_key(statement))
end
end
unless result
= "blazer"
if options[:user].respond_to?(:id)
<< ",user_id:#{options[:user].id}"
end
if options[:user].respond_to?(Blazer.user_name)
<< ",user_name:#{options[:user].send(Blazer.user_name).to_s.gsub(/[^a-zA-Z0-9 ]/, "")}"
end
if options[:query].respond_to?(:id)
<< ",query_id:#{options[:query].id}"
end
if options[:check]
<< ",check_id:#{options[:check].id},check_emails:#{options[:check].emails}"
end
if options[:run_id]
<< ",run_id:#{options[:run_id]}"
end
result = run_statement_helper(statement, , async ? options[:run_id] : nil)
end
result
end
|