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

Version Path
knjappserver-0.0.30 lib/include/class_log_data_value.rb
knjappserver-0.0.29 lib/include/class_log_data_value.rb
knjappserver-0.0.28 lib/include/class_log_data_value.rb
knjappserver-0.0.26 lib/include/class_log_data_value.rb
knjappserver-0.0.25 lib/include/class_log_data_value.rb
knjappserver-0.0.24 lib/include/class_log_data_value.rb
knjappserver-0.0.23 lib/include/class_log_data_value.rb
knjappserver-0.0.22 lib/include/class_log_data_value.rb
knjappserver-0.0.21 lib/include/class_log_data_value.rb
knjappserver-0.0.20 lib/include/class_log_data_value.rb