Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add resource_class to Her::Model::ORM #279

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Aug 12, 2014

  1. Add resource_class to Her::Model::ORM

    Different APIs may have different conventions for searching for relations.  For
    example, an API may not use query params for `#where` like searches. In these
    cases, it might be useful to have a model use a specialized `Relation` class
    that contains these rules.  This commit adds two methods to `Her::Model::ORM`:
    
    - `.use_relation(klass)` specifies the relation class to be used
    - `.relation_class` gets the used relation class
    
    Internally, the ORM module uses the defined relation (defaulting to
    `Her::Model::Relation`) for setting up queries.
    kindrowboat committed Aug 12, 2014
    Copy the full SHA
    6e6a0e1 View commit details
    Browse the repository at this point in the history