lib/include/class_log.rb in knjappserver-0.0.16 vs lib/include/class_log.rb in knjappserver-0.0.17
- old
+ new
@@ -4,33 +4,33 @@
if d.args["object_lookup"]
data_val = d.ob.get_by(:Log_data_value, {"value" => d.args["object_lookup"].class.name})
return [] if !data_val #if this data-value cannot be found, nothing has been logged for the object. So just return empty array here and skip the rest.
- sql += "
+ sql << "
LEFT JOIN Log_link ON
Log_link.log_id = #{table}.id AND
Log_link.object_class_value_id = '#{d.db.esc(data_val.id)}' AND
Log_link.object_id = '#{d.db.esc(d.args["object_lookup"].id)}'
"
end
- sql += " WHERE 1=1"
+ sql << " WHERE 1=1"
ret = list_helper(d)
d.args.each do |key, val|
case key
when "object_lookup"
- sql += " AND Log_link.id IS NOT NULL"
+ sql << " AND Log_link.id IS NOT NULL"
else
raise "Invalid key: #{key}."
end
end
- sql += ret[:sql_where]
- sql += ret[:sql_order]
- sql += ret[:sql_limit]
+ sql << ret[:sql_where]
+ sql << ret[:sql_order]
+ sql << ret[:sql_limit]
return d.ob.list_bysql(:Log, sql)
end
def self.add(d)
@@ -92,16 +92,16 @@
first = true
self.links.each do |link|
obj = link.object(ob_use)
- html += ", " if !first
+ html << ", " if !first
first = false if first
if obj.respond_to?(:html)
- html += obj.html
+ html << obj.html
else
- html += "#{obj.class.name}{#{obj.id}}"
+ html << "#{obj.class.name}{#{obj.id}}"
end
end
return html
end
\ No newline at end of file