Sha256: e3954f2fd7d52f56779c4cd29fd264504824cc2ddd42a378a9e598fa473ebdfa

Contents?: true

Size: 261 Bytes

Versions: 2

Compression:

Stored size: 261 Bytes

Contents

class ScopedTestClass < ActiveRecord::Base
  include UniqueAttributes
  unique_attribute :autogenerated_username,
                   proc { generate_username },
                   scope: :other_field

  def self.generate_username
    SecureRandom.hex
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
unique_attributes-0.1.2 spec/support/scoped_test_class.rb
unique_attributes-0.1.0 spec/support/scoped_test_class.rb