Skip to content

Commit

Permalink
Fix builds for Rails 7.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yuki24 committed Oct 2, 2023
1 parent e13cf7b commit eac3c37
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
fail-fast: false
matrix:
rails:
- v7.1.0.rc2
- v7.0.3
- v6.1.6
ruby:
Expand All @@ -38,6 +39,7 @@ jobs:
fail-fast: false
matrix:
rails:
- v7.1.0.rc2
- v7.0.3
- v6.1.6
ruby:
Expand Down Expand Up @@ -72,6 +74,7 @@ jobs:
fail-fast: false
matrix:
rails:
- v7.1.0.rc2
- v7.0.3
- v6.1.6
ruby:
Expand Down
3 changes: 2 additions & 1 deletion lib/ransack/adapters/active_record/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ def relation_for(object)

def type_for(attr)
return nil unless attr && attr.valid?
relation = attr.arel_attribute.relation
name = attr.arel_attribute.name.to_s
table = attr.arel_attribute.relation.table_name
table = relation.respond_to?(:table_name) ? relation.table_name : relation.name
schema_cache = self.klass.connection.schema_cache
unless schema_cache.send(:data_source_exists?, table)
raise "No table named #{table} exists."
Expand Down

0 comments on commit eac3c37

Please sign in to comment.