Skip to content

Commit

Permalink
Merge pull request #800 from leonidkroka/fix-ar-4-2-after-aliases-sup…
Browse files Browse the repository at this point in the history
…port-introduction

Fix ActiveRecord 4.2 support after aliases support introduction
  • Loading branch information
jkowens committed May 11, 2023
2 parents 367a177 + 53939c6 commit d728536
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/activerecord-import/import.rb
Original file line number Diff line number Diff line change
Expand Up @@ -965,8 +965,11 @@ def import_associations(models, options)
end

def schema_columns_hash
load_schema unless schema_loaded?
@schema_columns_hash ||= connection.schema_cache.columns_hash(table_name)
@schema_columns_hash ||= if respond_to?(:ignored_columns) && ignored_columns.any?
connection.schema_cache.columns_hash(table_name)
else
columns_hash
end
end

# We are eventually going to call Class.import <objects> so we build up a hash
Expand Down

0 comments on commit d728536

Please sign in to comment.