activerecord none

The .none class method was introduced in Rails 4.0.2 and is helpful when returning a blank array will break.

Organization.none.paginate(page: '1')
 => #<ActiveRecord::Relation []>

[].paginate(page: '1')
 => NoMethodError: undefined method `paginate' for []:Array

none

comments powered by Disqus