Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused source_type_info in RuntimeReflection #30231

Merged
merged 1 commit into from
Aug 14, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 7 additions & 10 deletions activerecord/lib/active_record/reflection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1085,15 +1085,16 @@ def constraints
@reflection.constraints + [source_type_info]
end

def source_type_info
type = @previous_reflection.foreign_type
source_type = @previous_reflection.options[:source_type]
lambda { |object| where(type => source_type) }
end

def get_join_keys(association_klass)
@reflection.get_join_keys(association_klass)
end

private
def source_type_info
type = @previous_reflection.foreign_type
source_type = @previous_reflection.options[:source_type]
lambda { |object| where(type => source_type) }
end
end

class RuntimeReflection < PolymorphicReflection # :nodoc:
Expand All @@ -1112,10 +1113,6 @@ def constraints
@reflection.constraints
end

def source_type_info
@reflection.source_type_info
end

def alias_candidate(name)
"#{plural_name}_#{name}_join"
end
Expand Down