ActiveRecord models has a weird behavior.

class Post < ActiveRecord::Base
end

% Post.default_scopes? # => true

This happens because Post.default_scopes returns an empty array and 
.default_scopes? calls !![] which is true. But this can be confusing, don't 
you think?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/wlt_OKxI1FsJ.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to