Repository navigation
Conversation
|
Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @eileencodes (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
|
Hi @brauliobo sorry for not getting around to this sooner. Can you explain more indepth why you need this? Was this broken in a certain version of Rails or is this a new bug in ActiveRecord that has existed in all versions? |
There was a problem hiding this comment.
Can you remove the extra spacing in this file so it looks like this?
require "cases/helper"
require 'models/company'
class Company
has_many :latest_contracts, -> { order('created_at DESC') }, foreign_key: :contract_id
end
class AlwaysReflectAssociationsOnSTIBaseClassDescendants < ActiveRecord::TestCase
def test_should_generate_valid_sql
assert Firm.reflections.keys.include? 'latest_contracts'
end
end2857243 to
879bba3
Compare
|
Hi @eileencodes! in some rails apps, you can have a model defined in some place and then extended with freedom patches elsewhere. this is the case of engines with dependencies, which is the case of my app (we call it plugins and they extend the core models). this patch fixes this. |
|
closing in favor of #24719 |
currently, associations added later with freedom patching are not propagated into descendants.