我第一次在sinatra工作,面临使用activerecord或sinatra-activerecord gem的选择.找不到两者之间的正确差异.有人可以帮我吗. 最佳答案 如果您只是阅读说明,那么您应该使用哪一个非常清楚:
ActiveRecord的
Databases on Rails. Build a persistent domain model by mapping database tables to Ruby classes. Strong conventions for associations, validations, aggregations, migrations, and testing come baked-in.
https://rubygems.org/gems/activerecord/
西纳特拉-的ActiveRecord
Extends Sinatra with ActiveRecord helpers.
https://rubygems.org/gems/sinatra-activerecord
所以我想99.5%的情况下只需要使用sinatra-activerecord.