def method_missing(method_name, *args, &block)      
      # NOTE: As of Rails 4, respond_to? must be checked inside the case statement otherwise it breaks regular AR attribute accessors
      case method_name.to_s
      when /.+_permissions/
        return component_permissions_reader(method_name) if respond_to?(:joinable_type) && joinable_type.present?
      when /.+_permission/
        return single_permission_reader(method_name) if respond_to?(:joinable_type) && joinable_type.present?
      end

      super
    end
def method_missing(method_name, *args, &block)      
      # NOTE: As of Rails 4, respond_to? must be checked inside the case statement otherwise it breaks regular AR attribute accessors
      case method_name.to_s
      when /.+_permissions/
        return component_permissions_reader(method_name) if respond_to?(:joinable_type) && joinable_type.present?
      when /.+_permission/
        return single_permission_reader(method_name) if respond_to?(:joinable_type) && joinable_type.present?
      end

      super
    end
Adds readers for component permission groups and single permissions

 Used by advanced permission forms to determine how which options to select
 in the various fields. (eg. which option of f.select :labels_permissions to choose)