We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7abd9b5 commit 8c580d7Copy full SHA for 8c580d7
activerecord/lib/active_record/inheritance.rb
@@ -215,6 +215,19 @@ def inherited(subclass)
215
super
216
end
217
218
+ def dup # :nodoc:
219
+ # `initialize_dup` / `initialize_copy` don't work when defined
220
+ # in the `singleton_class`.
221
+ other = super
222
+ other.set_base_class
223
+ other
224
+ end
225
+
226
+ def initialize_clone(other) # :nodoc:
227
+ super
228
+ set_base_class
229
230
231
protected
232
# Returns the class type of the record using the current module as a prefix. So descendants of
233
# MyApp::Business::Account would appear as MyApp::Business::AccountSubclass.
0 commit comments