News for hackers. Stuff that matters.
Re:How to write fast code in Ruby on Rails by caseyohara on Saturday October 12, 2019 @01:16AM (#21230838)
One way to mitigate spreading logic between SQL and Ruby is by using SQL views with something like Scenic [0] which can back an ActiveRecord model just like an ordinary table. This is especially nice for complex reporting because it centralizes your query logic in a single view as a sort of virtual table that can be queried from both ActiveRecord and normal Postgres queries.

[0] https://github.com/scenic-views/scenic

Re:How to write fast code in Ruby on Rails by ramraj07 on Saturday October 12, 2019 @03:12AM (#21231199)
Does anyone know how best to deal with views with sqlalchemy in Python? Looks like a good approach!