Sha256: 5288d1c1ff26316e30a65dcffd54c2841de36d90c0867e399fc79694092c20a3
Contents?: true
Size: 368 Bytes
Versions: 10
Compression:
Stored size: 368 Bytes
Contents
module Qcourses class Location < Sequel::Model plugin :validation_helpers one_to_many :events def validate validates_presence :name end def self.find_or_create_bij_insensitive_name(new_location) return nil if new_location.empty? filter(:name.ilike("#{new_location}%") ).first || create(name: new_location) end end end
Version data entries
10 entries across 10 versions & 1 rubygems