Sha256: 66745be6e936fdc70f947e1892766160ba5348a39f87215297d262aeb55e2b02

Contents?: true

Size: 484 Bytes

Versions: 4

Compression:

Stored size: 484 Bytes

Contents

module SimpleResource
  module CustomHelper
    def resource_human_attributes
      human_attributes = resource_attributes - non_human_attributes
      
      if @exclude_fields
        human_attributes = human_attributes - @exclude_fields
      end

      if respond_to?("parent?")
        human_attributes = human_attributes - ["#{parent.class.name.underscore}_id"]
      end

      human_attributes
    end
  end
end

SimpleResource::BaseHelper.extend SimpleResource::CustomHelper

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
active_application-0.3.1 app/helpers/simple_resource/custom_helper.rb
active_application-0.3.0 app/helpers/simple_resource/custom_helper.rb
active_application-0.2.0 app/helpers/simple_resource/custom_helper.rb
active_application-0.1.0 app/helpers/simple_resource/custom_helper.rb