aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2013-08-14 11:27:40 -0700
committerYves Senn <yves.senn@gmail.com>2013-08-14 11:27:40 -0700
commita4d4af4083d4b41c348f7e707874aedfa1d8a3cd (patch)
treea995d1c82062e245e4dae5ff62a71681e2329318 /activerecord/CHANGELOG.md
parentf04b75f5b7b07d4ad4ad58dba01a5493f3198ab6 (diff)
parent0aa95a71b04f2893921c58a7c1d9fca60dbdcbc2 (diff)
downloadrails-a4d4af4083d4b41c348f7e707874aedfa1d8a3cd.tar.gz
rails-a4d4af4083d4b41c348f7e707874aedfa1d8a3cd.tar.bz2
rails-a4d4af4083d4b41c348f7e707874aedfa1d8a3cd.zip
Merge pull request #11574 from jetthoughts/11552_rescue_on_invalid_inet_assign
Fix assign ip address with invalid values raise exception
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r--activerecord/CHANGELOG.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index e8ec99511e..904ed0e362 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,3 +1,21 @@
+* Assign inet/cidr attribute with `nil` value for invalid address.
+
+ Example:
+
+ record = User.new
+
+ record.logged_in_from_ip # is type of an inet or a cidr
+
+ # Before:
+ record.logged_in_from_ip = 'bad ip address' # raise exception
+
+ # After:
+ record.logged_in_from_ip = 'bad ip address' # do not raise exception
+ record.logged_in_from_ip # => nil
+ record.logged_in_from_ip_before_type_cast # => 'bad ip address'
+
+ *Paul Nikitochkin*
+
* `add_to_target` now accepts a second optional `skip_callbacks` argument
If truthy, it will skip the :before_add and :after_add callbacks.