diff options
author | Godfrey Chan <godfreykfc@gmail.com> | 2014-08-24 05:01:59 -0700 |
---|---|---|
committer | Godfrey Chan <godfreykfc@gmail.com> | 2014-08-25 17:48:34 -0700 |
commit | 37939e28c953ab526c3fc9637f0239b095db1f70 (patch) | |
tree | 51fd57af3d01214480e0c0fabe05b67c5097e2f1 /activerecord/lib/active_record | |
parent | 58c5261efa6ca0134ebfac8a701915d5e36d2c25 (diff) | |
download | rails-37939e28c953ab526c3fc9637f0239b095db1f70.tar.gz rails-37939e28c953ab526c3fc9637f0239b095db1f70.tar.bz2 rails-37939e28c953ab526c3fc9637f0239b095db1f70.zip |
Override #find_by! in core to enable AST caching
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/core.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index 2cbb8442a1..82b9c79533 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -177,6 +177,10 @@ module ActiveRecord end end + def find_by!(*args) + find_by(*args) or raise RecordNotFound + end + def initialize_generated_modules super |