Module: ResourceAwareness::MapperExtensions

Defined in:
lib/resource_awareness/mapper_extensions.rb

Instance Method Summary collapse

Instance Method Details

#resource(*entities, &block) ⇒ Object



13
14
15
16
17
# File 'lib/resource_awareness/mapper_extensions.rb', line 13

def resource(*entities, &block)
  super
  options = entities.extract_options!
  Rails.application.resource_definitions << Rails::SingletonResource.new(entities.first, @scope, options) if leaf_call?(entities, options)
end

#resources(*entities, &block) ⇒ Object



7
8
9
10
11
# File 'lib/resource_awareness/mapper_extensions.rb', line 7

def resources(*entities, &block)
  super
  options = entities.extract_options!
  Rails.application.resource_definitions << Rails::Resource.new(entities.first, @scope, options) if leaf_call?(entities, options)
end