Skip to content
This repository has been archived by the owner on Jun 7, 2019. It is now read-only.

Upgrading to Rails 5 post #31

Merged
merged 2 commits into from Jan 26, 2016
Merged

Upgrading to Rails 5 post #31

merged 2 commits into from Jan 26, 2016

Conversation

spastorino
Copy link
Member

No description provided.

Therefore:

- We substitute the minitest-capybara for the minitest-rails-capybara entry
- We call a require of `capybara/rails` in place of `minitest/rails/capybara` in the `test_helper.rb`.
Copy link
Member

Choose a reason for hiding this comment

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

I don't think We call a require is a valid expression in this context.

What about the following?
"We require capybara/rails in place of minitest/rails/capybara in the test_helper.rb"


Within the new initializers, `config/initializers/active_record_belongs_to_required_by_default.rb` is added, which makes it so that the belongs_to cannot be nil. In our case, we need some to be nil, so we have to add the option `optional: true` to the relations. For example, `belongs_to :category, optional: true`.

Also, config/initializers/callback_terminator.rb is added, which makes it so that the callbacks do not halt more when a false is returned. The way to halt now is with `throw(:abort)`. In our application, this was irrelevant.
Copy link
Member Author

Choose a reason for hiding this comment

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

this was irrelevant => this was irrelevant and had no effect or just had no effect

spastorino added a commit that referenced this pull request Jan 26, 2016
@spastorino spastorino merged commit 21e5021 into master Jan 26, 2016
@spastorino spastorino deleted the upgrading_to_rails_5 branch January 26, 2016 16:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants