Notes posted by ndgiang84
RSS feed
1 thank
Space before the opening [
In this example
Post.find_by_sql ["SELECT title FROM posts WHERE author = ? AND created > ?", author_id, start_date]
The array is a parameter, so a space is required before the opening [, which is equivalent to write like this
Post.find_by_sql(["SELECT title FROM posts WHERE author = ? AND created > ?", author_id, start_date])