class Knjappserver::Log_data

Public Class Methods

by_id_hash(d, id_hash) click to toggle source
# File lib/include/class_log_data.rb, line 18
    def self.by_id_hash(d, id_hash)
data = d.db.query("SELECT * FROM Log_data WHERE id_hash = '#{d.db.esc(id_hash)}' LIMIT 1").fetch
return data[:id].to_i if data
return false
    end
force(d, id_hash) click to toggle source
# File lib/include/class_log_data.rb, line 2
def self.force(d, id_hash)
        data_obj = d.ob.get_by(:Log_data, {"id_hash" => id_hash})
        
        if !data_obj
                data_obj = d.ob.add(:Log_data, {"id_hash" => id_hash})
        end
        
        return data_obj
end
force_id(d, id_hash) click to toggle source
# File lib/include/class_log_data.rb, line 12
    def self.force_id(d, id_hash)
data = d.db.query("SELECT * FROM Log_data WHERE id_hash = '#{d.db.esc(id_hash)}' LIMIT 1").fetch
return data[:id].to_i if data
return d.db.insert(:Log_data, {:id_hash => id_hash}, {:return_id => true}).to_i
    end

Public Instance Methods