提交 de12b5e6 编写于 作者: R Rizwan Reza

Revised naming.rb and lint.rb

上级 c5db6450
# == 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
......
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 @@ def human(options={})
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:
#
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册