Sha256: c197f5bc5232304e9e6e75c2556db5377adee77df1909bb726ea9ccbe46db195

Contents?: true

Size: 349 Bytes

Versions: 7

Compression:

Stored size: 349 Bytes

Contents

module Para
  module Admin
    module ResourceControllerConcerns
      def resource_model
        @resource_model ||= @component.model
      end

      def resource
        @resource ||= instance_variable_get(:"@#{ resource_name }")
      end

      def resource_name
        resource_model.model_name.singular_route_key
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
para-0.6.3 app/controllers/concerns/para/admin/resource_controller_concerns.rb
para-0.6.2 app/controllers/concerns/para/admin/resource_controller_concerns.rb
para-0.5.4 app/controllers/concerns/para/admin/resource_controller_concerns.rb
para-0.5.3 app/controllers/concerns/para/admin/resource_controller_concerns.rb
para-0.5.1 app/controllers/concerns/para/admin/resource_controller_concerns.rb
para-0.5.0 app/controllers/concerns/para/admin/resource_controller_concerns.rb
para-0.4.0 app/controllers/concerns/para/admin/resource_controller_concerns.rb