【问题标题】:Strange DataMapper (0.10.2) error. Please help!奇怪的 DataMapper (0.10.2) 错误。请帮忙!
【发布时间】:2010-04-11 00:59:51
【问题描述】:

在此处查看完整错误:http://notesapp.heroku.com/

我正在使用 DataMapper 和 dm-validations 0.10.2。无论我如何调整我的模型,我都会得到同样的错误,或者另一个错误。这是我的模型的样子:

class User
    include DataMapper::Resource

    attr_accessor :password, :password_confirmation

    property :id, Serial, :required => true
    property :email, String, :required => true, :format => :email_address, :unique => true
    property :hashed_password, String
    property :salt, String, :required => true
    property :created_at, DateTime, :default => Time.now
    property :permission_level, Integer, :default => 1

    validates_present :password_confirmation, :unless => Proc.new { |t| t.hashed_password }
    validates_present :password, :unless => Proc.new { |t| t.hashed_password }
    validates_is_confirmed :password

【问题讨论】:

    标签: ruby sinatra datamapper


    【解决方案1】:

    看起来您安装了旧版本的 DataObjects(可能是 0.10.0 之前的版本)。请更新到最新版本,我认为这个错误会消失。根据您使用的数据库,您很可能需要升级 do_postgres 或 do_mysql。

    【讨论】:

    • 并不能直接解决问题,而是引导我走上正确的道路。谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-08
    • 2011-05-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多