我正在学习git-flow,我刚刚做了git flow feature finish <feature-name>
,它合并了我的功能分支来开发和删除它.
而不是这个,我想将功能分支推送到github,所以我可以在同行评审后合并它.
所以问题是,如何"撤消"这个命令.或者换句话说,如何将我的最后两次提交从开发移动到我的功能分支?
我通常从开发创建新的分支
git checkout -b new-feature develop
Run Code Online (Sandbox Code Playgroud)
然后在最后一次提交之后我合并回来开发
git checkout develop
git merge new-feature
Run Code Online (Sandbox Code Playgroud)
但这一次我创建了new-feature2
brach new-feature
,现在我无法合并develop
.
有没有办法把new-feature2
父母换成develop
?
(我处理的文件与版本相同,develop
因此不需要合并.)
我一直在调试这个Rails的奇怪问题,给我"桌面的未知主键......",即使桌子的ID在那里.
我已经将数据库从一个heroku应用程序复制到另一个,在原始数据库上没有问题,新的一个给了我一个db错误.
这是错误:
ProductsController# (ActionView::Template::Error) "Unknown primary key for table collections in model Collection."
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/reflection.rb:366:in `primary_key'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/reflection.rb:480:in `association_primary_key'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/association_scope.rb:58:in `block in add_constraints'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/association_scope.rb:39:in `each'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/association_scope.rb:39:in `each_with_index'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/association_scope.rb:39:in `add_constraints'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/association_scope.rb:31:in `scope'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/association.rb:98:in `association_scope'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/association.rb:87:in `scoped'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/collection_association.rb:573:in `first_or_last'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/collection_association.rb:105:in `last'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/collection_proxy.rb:46:in `last'
/app/app/helpers/likes_helper.rb:62:in `significant_liker'
Run Code Online (Sandbox Code Playgroud)
引起它的那条线:
product.collections.last.try :user
Run Code Online (Sandbox Code Playgroud)
和表:
d8apjspa441pad=> \d collections
Table "public.collections"
Column | Type | Modifiers
----------------+------------------------+----------------------------------------------------------
id | integer | not null default nextval('collections_id_seq'::regclass)
name | character varying(255) |
user_id | integer |
permalink | character varying(255) |
category_id …
Run Code Online (Sandbox Code Playgroud) postgresql ruby-on-rails heroku rails-activerecord heroku-postgres
我有一系列的项目如下:
@items = [
{price: 12, quantity:1},
{price: 4, quantity:1},
{price: 8, quantity:1}
]
Run Code Online (Sandbox Code Playgroud)
我正在寻找这样的事情:
sumPrice: ->
@items.sum (item) -> item.price * item.quantity
Run Code Online (Sandbox Code Playgroud)
或者尽可能接近这一点,这使得阅读代码的每个人都能轻松理解发生的事情.
到目前为止,我提出了:
sumPrice: ->
(items.map (a) -> a.price * a.quantity).reduce (a, b) -> a + b
Run Code Online (Sandbox Code Playgroud)
和:
sumPrice: ->
sum = 0
for item in items
sum += item.price * item.quantity
sum
Run Code Online (Sandbox Code Playgroud)
我喜欢CoffeeScript,所以我希望有一个更好的解决方案,我想念的这个和类似的场景.
此检查过去通过:
expect(array).toContain(value)
Run Code Online (Sandbox Code Playgroud)
阵:
[
{"_t":"user","id":1073970419,"email":"email3@example.org","name":"Spectator"},
{"_t":"user","id":4464992042,"email":"email4@example.org","name":"Collaborator"},
{"_t":"user","id":1978569710,"email":"email5@example.org","name":"Manage"}
]
Run Code Online (Sandbox Code Playgroud)
值:
{"_t":"user","id":1978569710,"email":"email5@example.org","name":"Manage"}
Run Code Online (Sandbox Code Playgroud)
但不再过去了.什么是编写相同测试的新方法?
我一直在优化我的应用程序的加载时间,并在优化我的代码快速获胜后,我注意到似乎有一个500毫秒长的初始化阶段,其中所有需要的语句似乎都得到解决,或者其他什么.
这可以优化,如何?
我正在使用webpack,做出反应并结合几十个npm包.结果文件解压缩为2.8M,压缩约900k.应用程序本身没有大量的代码,主要是npm包.
我想知道我是否可以以不同方式编译,以避免所有需求和实时不实时.
更新:我目前正在使用带重复数据删除插件的生产版本.
我为ActiveAdmin rescource创建了一个集合操作,并希望从资源索引页面链接到它.
但是如何自定义资源索引页面?
手册提供了一些选项,但没有在页面上添加html /按钮(或者我看不到哪里).
我想为线图生成不同的颜色:
(这排除了RGB和HSL,YIQ接近但亮度不完全均匀)
您是否使用过任何库(Java)来处理统一的颜色方案生成?
我已经花了几天时间讨论这个问题,所以我希望你们中的一些人遇到同样的问题并解决它.
谢谢!
编辑:遗憾的是,我不能在AppEngine(或使用java.awt.Color的任何东西)上使用java.awt包.
处理付款/处理信用卡时要使用什么 HTTP 代码?
例如:
我正在发送 JSON 响应,所以我不太介意,但我想知道什么是正确的代码。
我正在进行多个项目,这些项目有时会互相交谈,但遇到了一个问题,即应用程序
request 1
,仍在运行)request 2
)request 2
的结果,B响应请求1这要求我在开发模式下运行多线程导轨。
我知道我可以使用puma或类似的方法来设置它,但是...不是真的更简单的方法吗?
我想避免更改项目中的任何内容(添加gem,配置文件..)。
这样的东西rails s --multi
会很好,不能webrick
只运行多个线程或产生更多进程吗?
也许我可以安装一个独立的gem来执行所需的操作并运行类似的东西thin run . -p 3
?
git ×2
git-branch ×2
activeadmin ×1
branch ×1
coffeescript ×1
color-scheme ×1
color-space ×1
colors ×1
ecmascript-6 ×1
git-flow ×1
heroku ×1
http ×1
jasmine ×1
java ×1
json ×1
postgresql ×1
reactjs ×1
webpack ×1