Sha256: c313c1fbf6a2f110ab5608dede7840a4695db480653d53ec783d670ea6608977

Contents?: true

Size: 383 Bytes

Versions: 2

Compression:

Stored size: 383 Bytes

Contents

module HasEnum

  autoload :ClassMethods,            'has_enum/class_methods'

  def self.included(base)
    base.class_attribute :enums
    base.enums ||= HashWithIndifferentAccess.new

    base.extend ClassMethods
  end

end

require 'active_record'

class ActiveRecord::Base
  include HasEnum
end

begin
  require 'formtastic'
  require 'has_enum/formtastic'
rescue LoadError
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
has_enum-0.10.1 lib/has_enum.rb
has_enum-0.10.0 lib/has_enum.rb