mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
remove the check for needs_type_condition? because ensure_proper_type will pick up the type column
This commit is contained in:
@@ -1916,8 +1916,9 @@ MSG
|
||||
# do Reply.new without having to set <tt>Reply[Reply.inheritance_column] = "Reply"</tt> yourself.
|
||||
# No such attribute would be set for objects of the Message class in that example.
|
||||
def ensure_proper_type
|
||||
unless self.class.descends_from_active_record?
|
||||
write_attribute(self.class.inheritance_column, self.class.sti_name)
|
||||
klass = self.class
|
||||
if klass.finder_needs_type_condition?
|
||||
write_attribute(klass.inheritance_column, klass.sti_name)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ module ActiveRecord
|
||||
current_scope.scope_for_create
|
||||
else
|
||||
# Return an empty hash in the simple case
|
||||
return {} unless finder_needs_type_condition? || default_scopes.any?
|
||||
return {} unless default_scopes.any?
|
||||
|
||||
scope = relation.clone
|
||||
scope.default_scoped = true
|
||||
|
||||
Reference in New Issue
Block a user