Class: JsonapiCompliable::Scope::ExtraFields

Inherits:
Base
  • Object
show all
Defined in:
lib/jsonapi_compliable/scope/extra_fields.rb

Instance Attribute Summary

Attributes inherited from Base

#controller, #dsl, #params, #scope

Instance Method Summary collapse

Methods inherited from Base

#apply_custom_scope, #apply_standard_or_override, #apply_standard_scope, #apply_standard_scope?, #initialize

Constructor Details

This class inherits a constructor from JsonapiCompliable::Scope::Base

Instance Method Details

#apply ⇒ Object



3
4
5
6
7
8
9
# File 'lib/jsonapi_compliable/scope/extra_fields.rb', line 3

def apply
  each_extra_field do |extra_field|
    @scope = extra_field[:proc].call(@scope)
  end

  @scope
end