RailsCasts Pro episodes are now free!

Learn more or hide this

Igor Sidorov's Profile

GitHub User: binarycode

Comments by Igor Sidorov

Avatar

I have a feeling such operations should be refactored into a separate model (e.g. BulkProductsUpdater), this has several advantages:

  1. You won't need any non-REST actions for this new object
  2. You can utilize handy rails validations/callbacks
  3. All the business logic related to updating the Product fields will be contained in the model layer, as it should be
  4. Generally testing separate models is easier and less brittle than testing controller logic