4
我有一个模型。我想在这个模型中导入一个模块。 这个模块中,我想插入validates_presence_of为导入validates_presence_of在模块中
我想知道是否和如何可以做这样的事情的车型:
class Ele < ActiveRecord::Base
include Mod
end
module Mod
validates_presence_of :field
end
感谢