RBatis是iBatis的Ruby版,安装方法:
./script/plugin install https://svn.apache.org/repos/asf/ibatis/trunk/rb/rbatis
示例代码:
class Product < RBatis::Base statement :select_one, :find do |productid| ["SELECT * FROM product WHERE productid = ?", productid] end statement :select, :find_by_category do |category| ["SELECT * FROM product WHERE category = ?", category] end end