Sha256: 6dcd768459366dc991d5fc5ce0e472c4677cb7cc0af36d9a7958d579c5d2f028

Contents?: true

Size: 350 Bytes

Versions: 12

Compression:

Stored size: 350 Bytes

Contents

require 'uuidtools'

class RFlow
  class Configuration
    module UUIDKeyed
      def self.included(base)
        base.class_eval do
          self.primary_key = 'uuid'
          before_create :generate_uuid

          def generate_uuid
            self.uuid = UUIDTools::UUID.random_create.to_s
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rflow-1.3.0 lib/rflow/configuration/uuid_keyed.rb
rflow-1.3.0a1 lib/rflow/configuration/uuid_keyed.rb
rflow-1.2.0 lib/rflow/configuration/uuid_keyed.rb
rflow-1.1.0 lib/rflow/configuration/uuid_keyed.rb
rflow-1.0.1 lib/rflow/configuration/uuid_keyed.rb
rflow-1.0.0 lib/rflow/configuration/uuid_keyed.rb
rflow-1.0.0a6 lib/rflow/configuration/uuid_keyed.rb
rflow-1.0.0a5 lib/rflow/configuration/uuid_keyed.rb
rflow-1.0.0a4 lib/rflow/configuration/uuid_keyed.rb
rflow-1.0.0a3 lib/rflow/configuration/uuid_keyed.rb
rflow-1.0.0a2 lib/rflow/configuration/uuid_keyed.rb
rflow-1.0.0a1 lib/rflow/configuration/uuid_keyed.rb