Skip to content

Commit

Permalink
Temporary fix for broken has_many :through relation (railsadminteam#2446
Browse files Browse the repository at this point in the history
)
  • Loading branch information
arnvald committed Nov 13, 2015
1 parent 1cc01e7 commit 21e2eaf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/rails_admin/adapters/active_record/association.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ def foreign_key

def foreign_key_nullable?
return if foreign_key.nil? || type != :has_many
klass.columns_hash[foreign_key.to_s].null
if klass.columns_hash[association.foreign_key.to_s]
klass.columns_hash[association.foreign_key.to_s].null
else
true
end
end

def foreign_type
Expand Down

0 comments on commit 21e2eaf

Please sign in to comment.