Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new feature - merging articles #31

Open
wants to merge 32 commits into
base: master
Choose a base branch
from

Conversation

kdefliese
Copy link

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?

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