Skip to content

Commit c0d62d2

Browse files
authored
Merge pull request #1003 from kylekeesling/fix-arel-table-keyword-arg
Use model.arel_table in ActiveRecord get_all for Rails main compatibility
2 parents 2a96a35 + 2a048d2 commit c0d62d2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/flipper/adapters/active_record.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ def get_multi(features)
106106
def get_all(**kwargs)
107107
with_connection(@feature_class) do |connection|
108108
# query the gates from the db in a single query
109-
features = ::Arel::Table.new(@feature_class.table_name.to_sym)
110-
gates = ::Arel::Table.new(@gate_class.table_name.to_sym)
109+
features = @feature_class.arel_table
110+
gates = @gate_class.arel_table
111111
rows_query = features.join(gates, ::Arel::Nodes::OuterJoin)
112112
.on(features[:key].eq(gates[:feature_key]))
113113
.project(features[:key].as('feature_key'), gates[:key], gates[:value])

0 commit comments

Comments
 (0)