Skip to content

Commit

Permalink
Add fix for AR adapter when table doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunemaker committed Dec 11, 2023
1 parent 149346e commit b91346b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/flipper/adapters/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@ def result_for_gates(feature, gates)
# See https://github.com/flippercloud/flipper/pull/692
def value_not_text?
@gate_class.column_for_attribute(:value).type != :text
rescue ::ActiveRecord::StatementInvalid => error
# If the table doesn't exist, the column doesn't exist either
warn "#{error.message}. You likely need to run `rails g flipper:active_record` and/or `rails db:migrate`."
end

def with_connection(model = @feature_class, &block)
Expand Down

0 comments on commit b91346b

Please sign in to comment.