Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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



Does anyone know how best to deal with views with sqlalchemy in Python? Looks like a good approach!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: