mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Revised naming.rb and lint.rb
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# == Active Model Lint Methods
|
||||
# == Active Model Lint Tests
|
||||
#
|
||||
# You can test whether an object is compliant with the ActiveModel API by
|
||||
# including <tt>ActiveModel::Lint::Tests</tt> in your TestCase. It will include
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
require 'active_support/inflector'
|
||||
|
||||
module ActiveModel
|
||||
|
||||
class Name < String
|
||||
attr_reader :singular, :plural, :element, :collection, :partial_path
|
||||
alias_method :cache_key, :collection
|
||||
@@ -35,9 +34,10 @@ module ActiveModel
|
||||
I18n.translate(defaults.shift, options)
|
||||
end
|
||||
end
|
||||
|
||||
# ActiveModel::Naming is a module that creates a +model_name+ method on your
|
||||
# object.
|
||||
|
||||
# == Active Model Naming
|
||||
#
|
||||
# Creates a +model_name+ method on your object.
|
||||
#
|
||||
# To implement, just extend ActiveModel::Naming in your object:
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user