Skip to content

Allow a custom URL for associations #37

@swilliams

Description

@swilliams

(Inspired by #34)

Right now:

class Hat
  include Arkenstone::Document
  url 'http://example.com/hats'

  has_many :feathers
end

class Feather
end

Will fetch a hat's feathers by calling http://example.com/hats/:id/feathers. Add an option to the association declarations (has_many, belongs_to, etc) to override the associated model name:

class Hat
  include Arkenstone::Document
  url 'http://example.com/hats'

  has_many :feathers, entity_name: 'turtles'
end

Which'll use build this url instead: http://example.com/hats/:id/turtles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions