Module: NeoGruby::Sequel::Plugins::UuidPk::InstanceMethods
- Defined in:
- lib/neo_gruby/sequel/plugins/uuid_pk.rb
Instance Method Summary collapse
Instance Method Details
#before_validation ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/neo_gruby/sequel/plugins/uuid_pk.rb', line 43 def before_validation field = :id meth = :"#{field}=" if respond_to?(field) && respond_to?(meth) && get_column_value(field).nil? set_column_value(meth, UUIDTools::UUID..raw) end end |