Sha256: 68aee1e80d0474b22e58fc6edc0b0c42df358db5705192b452125a19551fb925

Contents?: true

Size: 519 Bytes

Versions: 14

Compression:

Stored size: 519 Bytes

Contents

module Configuration
  Enumerations.configure do |config|
    config.primary_key        = :id
    config.foreign_key_suffix = :id
  end

  ::CustomEnum = Class.new(Enumerations::Base)

  CustomEnum.values draft:      { id: 1, name: 'Draft' },
                    review:     { id: 2, name: 'Review' },
                    published:  { id: 3, name: 'Published', published: true }

  ::CustomModel = Class.new(ActiveRecord::Base)

  CustomModel.enumeration :custom_enum

  Enumerations.restore_default_configuration
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
enumerations-2.6.0 test/configuration/configuration.rb
enumerations-2.5.4 test/configuration/configuration.rb
enumerations-2.5.3 test/configuration/configuration.rb
enumerations-2.5.2 test/configuration/configuration.rb
enumerations-2.5.1 test/configuration/configuration.rb
enumerations-2.5.0 test/configuration/configuration.rb
enumerations-2.4.0 test/configuration/configuration.rb
enumerations-2.3.3 test/configuration/configuration.rb
enumerations-2.3.2 test/configuration/configuration.rb
enumerations-2.3.1 test/configuration/configuration.rb
enumerations-2.2.3 test/configuration/configuration.rb
enumerations-2.2.2 test/configuration/configuration.rb
enumerations-2.2.1 test/configuration/configuration.rb
enumerations-2.2.0 test/configuration/configuration.rb