instance method
<=>
Ruby on Rails 8.0.4
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 50
Defined in activemodel/lib/active_model/naming.rb line 50
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Name