Skip to content

Commit

Permalink
Merge pull request #381 from gocardless/queries
Browse files Browse the repository at this point in the history
Use single-line string for query SQL
  • Loading branch information
Nick Campbell authored Dec 18, 2019
2 parents 3c370ad + a6b2c49 commit 375a96e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v5.2.0, 17th December 2019

- Issue `most_recent_transition_join` query as a single-line string [#381](https://github.com/gocardless/statesman/pull/381)

## v5.1.0, 22th November 2019

- Correct `Statesman::Adapters::ActiveRecordQueries` error text [@Bramjetten](https://github.com/gocardless/statesman/pull/376)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protection.
To get started, just add Statesman to your `Gemfile`, and then run `bundle`:

```ruby
gem 'statesman', '~> 5.1.0'
gem 'statesman', '~> 5.2.0'
```

## Usage
Expand Down
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
2 changes: 1 addition & 1 deletion lib/statesman/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Statesman
VERSION = "5.1.0".freeze
VERSION = "5.2.0".freeze
end

0 comments on commit 375a96e

Please sign in to comment.