我已经尝试了MongoMapper,它功能齐全(提供几乎所有AR功能),但我对使用大型数据集时的性能不是很满意.有没有人比较Mongoid?任何性能提升?
我想在rails 2.3.10之间切换为我的操作系统的"活动"gem,以便我可以在命令行调用它.
是否有可能做到这一点?我没有使用rvm.也许是时候开始了.
我试过gem install rails --version=2.3.10,但这只是确保安装了gem的版本,它没有把它放进去/usr/bin/rails.
(我已经为我的应用程序使用了bundler - 但直到现在才对操作系统级别的宝石进行任何精确控制)
我♥ git stash -p.但有时,一个令人满意的会议结束后y,n和s,我得到这个:
Saved working directory and index state WIP on foo: 9794c1a lorum ipsum
error: patch failed: spec/models/thing_spec.rb:65
error: spec/models/thing_spec.rb: patch does not apply
Cannot remove worktree changes
Run Code Online (Sandbox Code Playgroud)
为什么?
当我做一些类似的事情时,我感到很沮丧man bindkey:
BUILTIN(1) BSD General Commands Manual BUILTIN(1)
NAME
builtin, !, %, ., :, @, {, }, alias, alloc, bg, bind, bindkey, break, breaksw, builtins, case, cd, chdir, command,
complete, continue, default, dirs, do, done, echo, echotc, elif, else, end, endif, endsw, esac, eval, exec, exit,
export, false, fc, fg, filetest, fi, for, foreach, getopts, glob, goto, hash, hashstat, history, hup, if, jobid,
jobs, kill, limit, local, log, login, logout, ls-F, nice, nohup, notify, onintr, popd, printenv, pushd, … 目前在我的测试中,我做了类似的事情来测试电子邮件是否排队等待发送
assert_difference('ActionMailer::Base.deliveries.size', 1) do
get :create_from_spreedly, {:user_id => @logged_in_user.id}
end
Run Code Online (Sandbox Code Playgroud)
但如果ia控制器动作可以发送两个不同的电子邮件,即如果注册正常则向用户发送一封电子邮件,或者如果出现问题则向管理员发送通知 - 如何测试实际发送的邮件.上面的代码无论如何都会通过.
我需要调用REFRESH MATERIALIZED VIEW所涉及的表的每次更改,对吧?我很惊讶在网上找不到这方面的讨论.
我应该怎么做呢?
我认为答案的上半部分是我正在寻找的:https://stackoverflow.com/a/23963969/168143
这有什么危险吗?如果更新视图失败,是否会回滚调用更新,插入等事务?(这是我想要的......我想)
在我的Rails 3项目中,我想发送一些简单的通知电子邮件.我不需要为它们制作模板或做任何逻辑.我只是想从系统的各个地方解雇他们.
如果我在任意ruby脚本中这样做,我会使用小马.但是,我仍然希望使用rails邮件工具和配置,这样我就能获得与系统中其余邮件相同的可靠性和设置.
最简单的方法是什么?理想情况下会有一些方法
ActionMailer.send(:to => 'foo@example.com', :subject =>"the subject", :body =>"this is the body")
Run Code Online (Sandbox Code Playgroud) 我之前在轨道2的应用程序在做这个ActionController::IntegrationTest用
get '/', {}, {:user_agent => "Googlebot"}
Run Code Online (Sandbox Code Playgroud)
但这似乎在Rails 3中不再起作用了.
我该怎么办?
ruby ×4
actionmailer ×2
bash ×1
built-in ×1
capybara ×1
email ×1
git ×1
git-stash ×1
linux ×1
mongodb ×1
mongoid ×1
mongomapper ×1
odm ×1
phantomjs ×1
poltergeist ×1
postgresql ×1
rubygems ×1
rvm ×1
unit-testing ×1
zsh ×1