Material Views are highly underrated in Rails community. They can save you a lot of time when you deal with a database of complex structure.
Demonstrated solution is cheap, contains no plain SQL, helps to keep business logic within main app. and requires no migrations/versioning
Recently I was in an unpleasant situation – I had to tidy up and speed up a hundred of reports written in a procedural style in one legacy system.
In this talk I want to tell you how I did it and what I learned:
- How to introduce a new type of classes into app (with M.V. as an example)
- How not to fall down to SQL and keep all the logic inside application
- How to work with M.V. without migrations and versioning and be happy with it :)
- How to turn loads of procedural legacy code into a set of declarative instructions using scopes
- This talk is about usefulness and applicability of M.V. in Rails apps with examples and technical details.