Sha256: 312107daa63ca66e9bba4746382df4bf3624a2fda376b17d113cf1a37b759baa

Contents?: true

Size: 204 Bytes

Versions: 15

Compression:

Stored size: 204 Bytes

Contents

module Marty::PgEnum
  def [](index)
    index = index.to_s

    raise "no such #{self.name}: '#{index}'" unless
      self::VALUES.include?(index)

    index
  end

  alias_method :find_by_name, :[]
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
marty-1.0.25 app/models/marty/pg_enum.rb
marty-1.0.24 app/models/marty/pg_enum.rb
marty-1.0.23 app/models/marty/pg_enum.rb
marty-1.0.22 app/models/marty/pg_enum.rb
marty-1.0.20 app/models/marty/pg_enum.rb
marty-1.0.19 app/models/marty/pg_enum.rb
marty-1.0.18 app/models/marty/pg_enum.rb
marty-1.0.17 app/models/marty/pg_enum.rb
marty-1.0.15 app/models/marty/pg_enum.rb
marty-1.0.14 app/models/marty/pg_enum.rb
marty-1.0.13 app/models/marty/pg_enum.rb
marty-1.0.12 app/models/marty/pg_enum.rb
marty-1.0.11 app/models/marty/pg_enum.rb
marty-1.0.10 app/models/marty/pg_enum.rb
marty-1.0.9 app/models/marty/pg_enum.rb