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?
Thanks.
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?
Thanks.
Put single quotes around the delimiter:
has_many :foos, :finder_sql = <<-'SQL'
select * from foos where bars = #{id}
SQL