instance method
<=>
Ruby on Rails 5.2.8.1
Since v4.0.13Signature
<=>(other)
Equivalent to String#<=>.
class BlogPost extend ActiveModel::Naming end BlogPost.model_name <=> 'BlogPost' # => 0 BlogPost.model_name <=> 'Blog' # => 1 BlogPost.model_name <=> 'BlogPosts' # => -1
Source
# File activemodel/lib/active_model/naming.rb, line 49
Defined in activemodel/lib/active_model/naming.rb line 49
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Name