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

Remove Chewy::Type, simplify DSL #783

Merged
merged 1 commit into from
Apr 19, 2021
Merged

Remove Chewy::Type, simplify DSL #783

merged 1 commit into from
Apr 19, 2021

Commits on Apr 19, 2021

  1. Remove Chewy::Type, simplify DSL:

      - Remove the `Chewy::Type` class
        - e.g. remove `CitiesIndex::City` / `CitiesIndex.city`
          - `CitiesIndex::City.import! ...` becomes `CitiesIndex.import! ...`
      - Simplify index DSL:
        - `define_type` block -> `index_scope` clause
          - it can be omitted completely, if you don't need to specify the scope or options, e.g. `name`
      - Remove type names from string representations:
        - in `update_index` ActiveRecord helper and RSpec matcher, e.g.
          - `update_index('cities#city')` -> `update_index('cities')`
          - `update_index(UsersIndex::User)` -> `update_index(UsersIndex)`
        - in rake tasks (e.g. `rake chewy:update[cities#city]` -> `rake chewy:update[cities]`)
        - in rake tasks output (e.g. `Imported CitiesIndex::City in 1s, stats: index 3` -> `Imported CitiesIndex in 1s, stats: index 3`)
      - Use index name instead of type name in loader additional scope
        - e.g. `CitiesIndex.filter(...).load(city: {scope: City.where(...)})` -> `CitiesIndex.filter(...).load(cities: {scope: City.where(...)})`
    Ivan Rabotyaga committed Apr 19, 2021
    Configuration menu
    Copy the full SHA
    14f0f8e View commit details
    Browse the repository at this point in the history