Sha256: b243ee0688f66f96df08b90c0e63983fa1dfeeb520fa1f907e40653a7c85cbf2

Contents?: true

Size: 549 Bytes

Versions: 6

Compression:

Stored size: 549 Bytes

Contents

require 'reform'
require 'active_support/concern'

#
module ActiveAdmin
  #
  module Reform
    #
    module ResourceController
      # Overrides ActiveAdmin' templates method to wrap model into Reform::Form
      module DataAccess
        extend ActiveSupport::Concern

        # @param _resource [ActiveRecord::Base]
        # @return [ActiveRecord::Base, Reform::Form]
        def apply_decorations(_resource)
          apply_form(super)
        end
      end

      ::ActiveAdmin::ResourceController.send(:include, DataAccess)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
activeadmin-reform-1.1.0 lib/active_admin/reform/resource_controller/data_access.rb
activeadmin-reform-1.0.0 lib/active_admin/reform/resource_controller/data_access.rb
activeadmin-reform-0.6.0 lib/active_admin/reform/resource_controller/data_access.rb
activeadmin-reform-0.5.0 lib/active_admin/reform/resource_controller/data_access.rb
activeadmin-reform-0.4.0 lib/active_admin/reform/resource_controller/data_access.rb
activeadmin-reform-0.3.0 lib/active_admin/reform/resource_controller/data_access.rb