/usr/lib/ruby/vendor_ruby/enumerize/hooks/formtastic.rb is in ruby-enumerize 1.1.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | require 'active_support/concern'
module Enumerize
module Hooks
module FormtasticFormBuilderExtension
extend ActiveSupport::Concern
included do
alias_method_chain :input, :enumerize
end
def input_with_enumerize(method, options={})
klass = object.class
if klass.respond_to?(:enumerized_attributes) && (attr = klass.enumerized_attributes[method])
options[:collection] ||= attr.options
if attr.kind_of?(Enumerize::Multiple) && options[:as] != :check_boxes
options[:input_html] = options.fetch(:input_html, {}).merge(:multiple => true)
end
end
input_without_enumerize(method, options)
end
end
end
end
::Formtastic::FormBuilder.send :include, Enumerize::Hooks::FormtasticFormBuilderExtension
|