Given this code:
has_many :foos, :finder_sql = <<-SQL
select * from foos where bars = #{id}
SQL
The #{id}
part is being prematurely interpolated.
How do I escape it?
Put single quotes around the delimiter:
has_many :foos, :finder_sql = <<-'SQL'
select * from foos where bars = #{id}
SQL
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With