Skip to content

Commit

Permalink
Merge pull request #1439 from yuki24/rails-7-1
Browse files Browse the repository at this point in the history
Fix builds for Rails 7.1.0
  • Loading branch information
deivid-rodriguez authored Oct 20, 2023
2 parents e13cf7b + c47fa8c commit 301fe48
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
- v7.0.3
- v6.1.6
ruby:
Expand All @@ -38,6 +39,7 @@ jobs:
fail-fast: false
matrix:
rails:
- v7.1.0
- v7.0.3
- v6.1.6
ruby:
Expand Down Expand Up @@ -72,6 +74,7 @@ jobs:
fail-fast: false
matrix:
rails:
- v7.1.0
- 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 301fe48

Please sign in to comment.