Sha256: c9b1557547360dbdfa03da9901d3003b6634e41e409535c3d789987cff7d4e15

Contents?: true

Size: 1.31 KB

Versions: 1

Compression:

Stored size: 1.31 KB

Contents

Usage:
  rails generate query NAME [--associated_relation=model]

Description:
    Generates a new ARQO query object at app/queries. Pass the generator name
    as an argument, either CamelCased or snake_cased, and an optional
    attribute 'associated_relation' as an argument.

    The 'associated_relation' attribute expects an ActiveRecord class as value. This
    is useful for cases where you want to override the associated relation in
    the query object.

    This generator invokes your configured ORM and test framework, which Active
    Record and Rspec are the only ones supported at the moment.

Example:
    `rails generate query Account`

    Creates a standard account query object and the spec file.

        Query Object:   app/queries/account_query.rb
        Rspec:          spec/queries/account_query.rb

    `rails generate query Admin::Account`

    Creates an account query object and the spec file following the namespace
    location.

        Query Object:   app/queries/admin/account_query.rb
        Rspec:          spec/queries/admin/account_query.rb

    `rails generate query Account associated_relation:User`

    Creates an account query object and the spec file including the
    specification of the `associated_relation` method.

        app/queries/account_query.rb
        spec/queries/account_query.rb

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
arqo-0.3.0 lib/generators/rails/USAGE