Fixes the no method error for ensure_initialized

`ensure_initialized` method exists up to 4.2.0.beta4, but removed in 4.2.0.rc1, see: https://www.omniref.com/ruby/gems/activerecord/4.2.0.rc1/files/lib/active_record/attribute_set.rb#tab=Q---A

Fixed code in the same format as previous versions not using `ensure_initialized`