Take the 2-minute tour ×  I am using Ruby on Rails 3 and I am
trying to build an ActiveModel this way:  module Users # I use a
namespace   class Account     extend ActiveModel::Naming
extend ActiveModel::Translation     include
ActiveModel::Validations      attr_accessor :name
attr_reader :errors      def initialize       @errors =
ActiveModel::Errors.new(self)      def validate!
errors.add(:name, "can not be nil") if name == nil      # The
following methods are needed to be minimally implemented
def read_attribute_for_validation(attr)      def
Account.human_attribute_name(attr, options = {})      def
Account.lookup_ancestors      def persisted?  If in my
controller I make this  def create   @account =
Users::Account.new   @account.errors.add( :name, "can not be
blank" )  I get this error:  undefined method `add' for
nil:NilClass  If I make  @new_account = Users::Account.new  the
debug of @new_account is  --- !ruby/object:Users::Account
Where is the error and how can I solve that?  P.S.: