我正在Sinatra图像应用程序上工作。我为我的用户定义了Datamapper模型,上传的图像和“Favs”。每个用户可以给每个图像最多一个“Fav”。 class User
include DataMapper::Resource
property :id, Serial
property :privilege_lvl, Integer, :default => 0
我是Datamapper的新手。有没有办法在datamapper中编写不区分大小写的查询,因为我正在使用datamapper在表中搜索名称的存在。通常我们写查询中的DataMapper这样说, Student.all(:name => "XYZ") where name can be of the form xyz, Xyz and XYZ.
所以在上面的查询我有什么额外的运营商加入,使上面的
鉴于电影和演员在m:n关系。我想要做的就是找回角色名单,由他们扮演的电影数量排序 class Movie
include DataMapper::Resource
property :id, Serial
property :title, String
has n, :actors, through: Resource
end
class Actor
上传图像Cloudinary。我 得到它通过使用CarrierWave本地保存的图像,我知道Cloudinary和 CarrierWave互相发挥很好,但我已经竭尽所能,并没有骰子。 我跟着文档,但他们都非常的Rails为中心。该死的你Rails! # Model - User.rb
class ImageUploader < CarrierWave::Uploader::Base
i