Skip to content

Commit 00dfa10

Browse files
authored
Merge pull request rails#49680 from seanpdoyle/active-record-include-active-model-api
Include `ActiveModel::API` in `ActiveRecord::Base`
2 parents 6afe706 + 2c57ec6 commit 00dfa10

File tree

6 files changed

+6
-8
lines changed

6 files changed

+6
-8
lines changed

activerecord/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* Include `ActiveModel::API` in `ActiveRecord::Base`
2+
3+
*Sean Doyle*
4+
15
* Ensure `#signed_id` outputs `url_safe` strings.
26

37
*Jason Meller*

activerecord/lib/active_record/attribute_assignment.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
module ActiveRecord
44
module AttributeAssignment
5-
include ActiveModel::AttributeAssignment
6-
75
private
86
def _assign_attributes(attributes)
97
multi_parameter_attributes = nested_parameter_attributes = nil

activerecord/lib/active_record/base.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ module ActiveRecord # :nodoc:
280280
# So it's possible to assign a logger to the class through <tt>Base.logger=</tt> which will then be used by all
281281
# instances in the current object space.
282282
class Base
283-
extend ActiveModel::Naming
283+
include ActiveModel::API
284284

285285
extend ActiveSupport::Benchmarkable
286286
extend ActiveSupport::DescendantsTracker
@@ -304,7 +304,6 @@ class Base
304304
include Scoping
305305
include Sanitization
306306
include AttributeAssignment
307-
include ActiveModel::Conversion
308307
include Integration
309308
include Validations
310309
include CounterCache

activerecord/lib/active_record/core.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ def initialize(attributes = nil)
428428
init_internals
429429
initialize_internals_callback
430430

431-
assign_attributes(attributes) if attributes
431+
super
432432

433433
yield self if block_given?
434434
_run_initialize_callbacks

activerecord/lib/active_record/translation.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
module ActiveRecord
44
module Translation
5-
include ActiveModel::Translation
6-
75
# Set the lookup ancestors for ActiveModel.
86
def lookup_ancestors # :nodoc:
97
klass = self

activerecord/lib/active_record/validations.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def initialize(record = nil)
3939
# {new_record?}[rdoc-ref:Persistence#new_record?].
4040
module Validations
4141
extend ActiveSupport::Concern
42-
include ActiveModel::Validations
4342

4443
# The validation process on save can be skipped by passing <tt>validate: false</tt>.
4544
# The validation context can be changed by passing <tt>context: context</tt>.

0 commit comments

Comments
 (0)