Module: Core::Endpoint::BasicHandler::Associations::HasMany
- Included in:
- Core::Endpoint::BasicHandler
- Defined in:
- app/api/core/endpoint/basic_handler/associations/has_many.rb
Instance Method Summary collapse
-
#has_many(name, options) { ... } ⇒ Void
Defines a has_many relationship which will be exposed via the v1 api.
Instance Method Details
#has_many(name, options) { ... } ⇒ Void
Defines a has_many relationship which will be exposed via the v1 api
15 16 17 18 |
# File 'app/api/core/endpoint/basic_handler/associations/has_many.rb', line 15 def has_many(name, , &) class_handler = Class.new(Handler).tap { |handler| self.class.const_set(name.to_s.camelize, handler) } register_handler([:to], class_handler.new(name, , &)) end |