Skip to content

Commit

Permalink
Use single-line string for query SQL
Browse files Browse the repository at this point in the history
Just a cosmetic thing, we don't need to send newlines and whitespace
along with our SQL queries. We can achieve a similar effect using one
string split over multiple lines, which doesn't need `squish`ing at the
other side.
  • Loading branch information
Nick Campbell committed Dec 13, 2019
1 parent 3c370ad commit 7c827f9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/statesman/adapters/active_record_queries.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ def states_where(states)
end

def most_recent_transition_join
"LEFT OUTER JOIN #{model_table} AS #{most_recent_transition_alias}
ON #{model.table_name}.id =
#{most_recent_transition_alias}.#{model_foreign_key}
AND #{most_recent_transition_alias}.most_recent = #{db_true}"
"LEFT OUTER JOIN #{model_table} AS #{most_recent_transition_alias} " \
"ON #{model.table_name}.id = " \
"#{most_recent_transition_alias}.#{model_foreign_key} " \
"AND #{most_recent_transition_alias}.most_recent = #{db_true}"
end

private
Expand Down

0 comments on commit 7c827f9

Please sign in to comment.