By doing so and including it in ActionDispatch::Routing::UrlFor, we make
it available in controllers, helpers and specs, and so we can remove the
duplication we had there with methods dealing with the same problem.
Even if monkey-patching is ugly, using a different module and executing
ActionDispatch::Routing::UrlFor.send(:include, MyModule) wouldn't make
the method available in the controller.
We can use the `config.authorize_with` option, so we don't need to copy
the controller in order to load and authorize resource.
Besides, only administrators can upload images, so we don't need to
track the image's user id.
Just so we can navigate throught git history faster:
* Introduced in 345e34d to avoid precompiling all CKEditor assets.
* Modified in 54c82a5 to avoid compiling assets during tests.
* Overwritten by `rails g ckeditor:install` in c0d6c0b.
Allowing every format is way more than what we initially intended.
I've only added h2 and h3 because h1 is set somewhere else in the page
(like the title), and h4, h5 and h6 are usually not necessary.
It fails because we try to follow a link without a Portuguese
translation. In Madrid they use Spanish as fallback, but in consul we
use English as fallback, and so the text in the link is different in
those repos.
A proper solution would be to update the Portuguese locales. However,
since this test is going to be removed in our next backport, I'm just
doing a quick patch.
This fallback was added with the following explanation:
The application default_locale is :es, while most seed data
is created in English. This means that translatable resources
might only have English translations. This change is so that,
when the locale is set to Spanish, the English translations
are shown instead of empty content.
Instead, we are going to make sure that all seed content for
translatable resources is available in both English and Spanish.
In the past there have been issues with the `pt-BR` locale because
it has a hyphen `-` and a uppercase letters.
I am adding the test only to spec/features/translations_spec.rb (which
tests Milestones) for now. We might want to also add it to the other
translatable resource specs in the future (banners, etc.).
The application default_locale is :es, while most seed data
is created in English. This means that translatable resources
might only have English translations. This change is so that,
when the locale is set to Spanish, the English translations
are shown instead of empty content.
It turns out it is not necessary to downcase and underscore
locale names to use the globalize-accessor gem. The gem
will automatically underscore the locale name when defining and
calling the accessor methods.