Sha256: 91a5ad81cc0c089612514650a2b90cfb2a6d1d5e95b80c903201b2898f4d9533
Contents?: true
Size: 632 Bytes
Versions: 10
Compression:
Stored size: 632 Bytes
Contents
class Knjappserver::Log_data_value < Knj::Datarow def self.force(d, value) value_obj = d.ob.get_by(:Log_data_value, { "value" => value.to_s }) if !value_obj value_obj = d.ob.add(:Log_data_value, {"value" => value}) end return value_obj end def self.force_id(d, value) d.db.select(:Log_data_value, {"value" => value}) do |d_val| return d_val[:id].to_i if d_val[:value].to_s == value.to_s #MySQL doesnt take upper/lower-case into consideration because value is a text-column... lame! - knj end return d.db.insert(:Log_data_value, {:value => value}, {:return_id => true}).to_i end end
Version data entries
10 entries across 10 versions & 1 rubygems