and fixed wiki versioning test
Rails 5.1 last steps
crabgrass_media from rubygems
remove controller test for task sorting - not possible to test xhr request without route in new parameter syntax
remove new framework defaults initializer file
Final step of upgrade to rails 5.1
we only test on stretch, because we need ruby >= 2.2.2
update dependencies by running bundle update
and fix gallery_image_controller_test
Also write db/schema.rb with rails 5
update some gems, replace before_filter / after_filter by before_action / after_action
and some more config changes (mostly commented out) and scripts generated by rails app:update task
first make everything work locally with rails 5.0
test do not pass on CI yet because the test task has to be rewritten
- update dependecies
- run rails app:update task: update config, generate intitializers etc.
- the method hide_action is not available in rails anymore
- ActionController::Parameters have to be converted to a hash
- protect_from_forgery now defaults to prepend:false
remove tables hourlies, dalies, trackings
remove column views_count from pages and page_terms
remove views_count from fixtures and a test
remove views_count from sphinx index
remove tracking
remove aggregation of tracking data as hourlies and dailies
remove search filters for most_views
remove all tests dealing with tracking for views, stars and edits
remove commented out code
We used to have two different ways of adding confirm
dialogs to links. Either by including it in the url_option
or the html_options.
There is no point to this. Simplified by removing
the former option which also introduced a different
link_to signature.
One function for handling plain html content,
one for ajax modal boxes.
They hopefully can be converted into sth. more
ujs like.
This will probably be easier if we tackle them one
by one instead of trying to come up with a grand unified
solution.
@azuls fix for data-with.js which makes the sharing popup work
sharing pages at creation is not working yet because path contains no valid Id
Some refactoring of helper classes
We did all kinds of funny things with with_access in order to work
around the lack of a .distinct in AR. Now it's there. So let's remove
the workarounds.
Also adopted the test for group members with a given access accordingly.
There we go. Finally the upgrade of thinking sphinx.
In order to deploy this we will need a fairly recent version of Sphinx.
I suggest we jump right to the latest of the 2.2 series.
Thinking Sphinx now uses app/indices for its index definitions.
It also requires some options to search to be hashes.
There's a nice upgrade documentation that i followed:
http://freelancing-gods.com/thinking-sphinx/upgrading.html
Most of it does not affect us though.
The main change was to use with_all instead of with in sphinx queries.
This way we can still have multiple constraints on the same field:
So for example to search '(1 OR 2 OR 3) AND (4 OR 5 OR 6)'
[Here](http://freelancing-gods.com/thinking-sphinx/searching.html#filters)'s
the new way of doing this:
> You can also perform combination AND and OR matches with
> :with_all using nested arrays:
>
> ```ruby
> # All pancackes belonging to tag 3 and belonging to one of tag 1 or tag 2
> Article.search 'pancakes',
> :with_all => {:tag_ids => [[1,2], 3]}
> ```
So now we build @with in the sphinx query to be an array of arrays that
can be feed into with_all.
Before we used to send an array to thinking sphinx instead of a hash.
```ruby
Page.search 'text', :with =>
[[:access_ids, '1 2 3'], [:access_ids, '4 5 6']]
```
Moving from ruby 1.8 to 1.9 \w does not include non ascii chars anymore.
Now we need to use [[:word:]] to account for utf-8 chars in the String#nameize.
This came up in wiki section anchors but also affected page titles.
I added an integration test for the page title.
The test failed due to invalid url errors when capybara handed the url to
URI.parse. So now we URI.encode the page_path. While this does change the
string in the test iceweasel still displays the umlaut characters nicely.
crabgrass_media depends on a number of packages to be installed.
We don't install them on travis right now because that makes test
runs much faster.
But we still need to test crabgrass_media with these packages properly.
So this will now live in a different repo and be tested on its own.