Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove Chewy::Type, simplify DSL: (toptal#783)
- 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(...)})`
- Loading branch information