class AddTitleToPosts < ActiveRecord::Migration
def self.up
add_column :posts, :title, :string
Post.find(:all).each do |post|
post.update(:title => post.name.upcase)
end
end
def self.down
end
end
就像你不能做什么特别复杂的事情,只是试图通过改变数据库中已经存在的name列的大小写来添加新的列标题。但是我收到了调用私有方法错误的尝试。我猜这跟“自我”有关
我在报告定义中遇到异常,我的属性映射到外部mysql DB中,当我运行报告定义时,发生了此异常
错误:
**执行报表定义的查询时出错-获取列表时出现问题:代码:1064SQL: 42000消息:您的SQLState语法有错误;请查看与您的MySQL服务器版本对应的手册以获得正确的语法使用near‘。customerid AS "customerid“,"PC0".customername AS”customerid“,”PC0“.customernameAS "customername”FROM the’at line DatabaseException by