我想我明白这个this线程的帮助require
和include
之间的差异。为什么在Rails类中同时使用require和include?
然后我无意中发现了为什么使用这两种方法,他们这段代码从github page of the bcrypt-ruby gem.?所以第一个单一的模型将被加载,但通过include
所有的功能呢?
require 'bcrypt'
class User < ActiveRecord::Base
# users.password_hash in the database is a :string
include BCrypt
.....