aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorClaudio B <claudiob@users.noreply.github.com>2015-12-02 18:09:38 -0800
committerClaudio B <claudiob@users.noreply.github.com>2015-12-02 18:09:38 -0800
commit215f86c3483cf300b2ccd6d5d8b97f9c9bf547f5 (patch)
tree6a5a71ca19517ad056a6ce130485c816430eac12 /activerecord
parent2b6557e70a62158c87f744082f2044524f4f6257 (diff)
parent728e28ffd67655471c75f6adb56a0831fdf837b6 (diff)
downloadrails-215f86c3483cf300b2ccd6d5d8b97f9c9bf547f5.tar.gz
rails-215f86c3483cf300b2ccd6d5d8b97f9c9bf547f5.tar.bz2
rails-215f86c3483cf300b2ccd6d5d8b97f9c9bf547f5.zip
Merge pull request #22476 from claudiob/comment-prem
Remove old comment about AC::Parameters>subclasses
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/CHANGELOG.md7
-rw-r--r--activerecord/lib/active_record/inheritance.rb2
2 files changed, 7 insertions, 2 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index 89ba579e80..fdc95f718a 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -432,6 +432,13 @@
*Wojciech Wnętrzak*
+* Instantiating an AR model with `ActionController::Parameters` now raises
+ an `ActiveModel::ForbiddenAttributesError` if the parameters include a
+ `type` field that has not been explicitly permitted. Previously, the
+ `type` field was simply ignored in the same situation.
+
+ *Prem Sichanugrist*
+
* PostgreSQL, `create_schema`, `drop_schema` and `rename_table` now quote
schema names.
diff --git a/activerecord/lib/active_record/inheritance.rb b/activerecord/lib/active_record/inheritance.rb
index e094735799..6259c4cd33 100644
--- a/activerecord/lib/active_record/inheritance.rb
+++ b/activerecord/lib/active_record/inheritance.rb
@@ -195,8 +195,6 @@ module ActiveRecord
# Detect the subclass from the inheritance column of attrs. If the inheritance column value
# is not self or a valid subclass, raises ActiveRecord::SubclassNotFound
- # If this is a StrongParameters hash, and access to inheritance_column is not permitted,
- # this will ignore the inheritance column and return nil
def subclass_from_attributes(attrs)
attrs = attrs.to_h if attrs.respond_to?(:permitted?)
if attrs.is_a?(Hash)