Skip to content

Added new feature - merging articles - #31

Open
kdefliese wants to merge 32 commits into
Ada-C4:masterfrom
kdefliese:master
Open

Added new feature - merging articles#31
kdefliese wants to merge 32 commits into
Ada-C4:masterfrom
kdefliese:master

Conversation

@kdefliese

Copy link
Copy Markdown

Feature is complete and deployed to heroku - https://git.heroku.com/shielded-hollows-15125.git
Cucumber tests are complete and green for everything except checking to see that comments are merged (haven't added a test for this yet)
Specs are incomplete

@article_1.merge_with(params[:merge_with])
flash[:notice] = _('Article was successfully merged')
redirect_to :action => 'index'
elsif Article.find_by_id(params[:merge_with]).nil?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you're doing two find_by_ids here, which is going to make the same database query twice. I'd recommend storing the result of this above the conditional so it will only do this database query once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants