File: rails_admin.rb

package info (click to toggle)
ruby-enumerize 2.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 432 kB
  • sloc: ruby: 3,712; makefile: 6
file content (18 lines) | stat: -rw-r--r-- 361 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

module Enumerize
  module Integrations
    module RailsAdmin

      def enumerize(name, options={})
        super

        _enumerize_module.module_eval <<-RUBY, __FILE__, __LINE__ + 1
          def #{name}_enum
            self.class.enumerized_attributes[:#{name}].options
          end
        RUBY
      end
    end
  end
end