PostgreSQL
 sql >> Datenbank >  >> RDS >> PostgreSQL

Gibt es eine Möglichkeit, Parameter an die Postgres-Rohabfrage in Rails zu übergeben?

Probieren Sie find_by_sql aus :

Post.find_by_sql(["SELECT title FROM posts WHERE author = ? AND created > ?", author_id, start_date])

[#<Post:0x36bff9c @attributes={"title"=>"The Cheap Man Buys Twice"}>, ...]