Commit 29b48bc274bd41785e8a5206cd9465f83de696ba

Authored by Andrew Kane
1 parent 8d9025ff

Updated examples [skip ci]

Showing 1 changed file with 6 additions and 6 deletions   Show diff stats
README.md
... ... @@ -1578,10 +1578,10 @@ class Product < ApplicationRecord
1578 1578 def search_data
1579 1579 {
1580 1580 name: name
1581   - }.merge(search_prices)
  1581 + }.merge(prices_data)
1582 1582 end
1583 1583  
1584   - def search_prices
  1584 + def prices_data
1585 1585 {
1586 1586 price: price,
1587 1587 sale_price: sale_price
... ... @@ -1593,7 +1593,7 @@ end
1593 1593 And use:
1594 1594  
1595 1595 ```ruby
1596   -Product.reindex(:search_prices)
  1596 +Product.reindex(:prices_data)
1597 1597 ```
1598 1598  
1599 1599 ### Performant Conversions
... ... @@ -1613,10 +1613,10 @@ class Product < ApplicationRecord
1613 1613 def search_data
1614 1614 {
1615 1615 name: name
1616   - }.merge(search_conversions_data)
  1616 + }.merge(conversions_data)
1617 1617 end
1618 1618  
1619   - def search_conversions_data
  1619 + def conversions_data
1620 1620 {
1621 1621 conversions: search_conversions || {}
1622 1622 }
... ... @@ -1656,7 +1656,7 @@ class ReindexConversionsJob < ApplicationJob
1656 1656 end
1657 1657  
1658 1658 # partial reindex
1659   - model.where(id: ids).reindex(:search_conversions_data)
  1659 + model.where(id: ids).reindex(:conversions_data)
1660 1660 end
1661 1661 end
1662 1662 end
... ...