diff --git a/Gemfile.lock b/Gemfile.lock
index eb35cf2eaf33d6314cfb82db5890013a2f7b593d..3694a680c7a9e05a99b7f8f252899cc108db6728 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,18 +1,18 @@
 GIT
   remote: git://github.com/activeadmin/activeadmin.git
-  revision: 8ddc07eefb9c4c39f96e1ad990fe7789555fd4ff
+  revision: 5e2d9c2f8620476b2045b1f05fc129fe9900846b
   specs:
-    activeadmin (1.0.0.pre4)
-      arbre (~> 1.0, >= 1.0.2)
+    activeadmin (1.0.0.pre5)
+      arbre (>= 1.1.1)
       bourbon
       coffee-rails
       formtastic (~> 3.1)
       formtastic_i18n
-      inherited_resources (~> 1.6)
+      inherited_resources (~> 1.7)
       jquery-rails
       jquery-ui-rails
       kaminari (>= 0.15, < 2.0)
-      railties (>= 3.2, < 5.1)
+      railties (>= 4.2, < 5.2)
       ransack (~> 1.3)
       sass-rails
       sprockets (< 4.1)
@@ -27,65 +27,64 @@ GIT
 
 GIT
   remote: git://github.com/svenfuchs/i18n-active_record.git
-  revision: 35abff38bae09c65ab9404a8292bcda9f0f49d34
+  revision: a61b6840b746d303de17f12d35522388c16ad003
   specs:
-    i18n-active_record (0.1.2)
+    i18n-active_record (0.2.0)
       i18n (>= 0.5.0)
 
 GEM
   remote: https://rubygems.org/
   remote: https://rails-assets.org/
   specs:
-    actionmailer (4.2.7.1)
-      actionpack (= 4.2.7.1)
-      actionview (= 4.2.7.1)
-      activejob (= 4.2.7.1)
+    actionmailer (4.2.8)
+      actionpack (= 4.2.8)
+      actionview (= 4.2.8)
+      activejob (= 4.2.8)
       mail (~> 2.5, >= 2.5.4)
       rails-dom-testing (~> 1.0, >= 1.0.5)
-    actionpack (4.2.7.1)
-      actionview (= 4.2.7.1)
-      activesupport (= 4.2.7.1)
+    actionpack (4.2.8)
+      actionview (= 4.2.8)
+      activesupport (= 4.2.8)
       rack (~> 1.6)
       rack-test (~> 0.6.2)
       rails-dom-testing (~> 1.0, >= 1.0.5)
       rails-html-sanitizer (~> 1.0, >= 1.0.2)
-    actionview (4.2.7.1)
-      activesupport (= 4.2.7.1)
+    actionview (4.2.8)
+      activesupport (= 4.2.8)
       builder (~> 3.1)
       erubis (~> 2.7.0)
       rails-dom-testing (~> 1.0, >= 1.0.5)
-      rails-html-sanitizer (~> 1.0, >= 1.0.2)
+      rails-html-sanitizer (~> 1.0, >= 1.0.3)
     actionview-encoded_mail_to (1.0.9)
       rails
-    activejob (4.2.7.1)
-      activesupport (= 4.2.7.1)
+    activejob (4.2.8)
+      activesupport (= 4.2.8)
       globalid (>= 0.3.0)
-    activemodel (4.2.7.1)
-      activesupport (= 4.2.7.1)
+    activemodel (4.2.8)
+      activesupport (= 4.2.8)
       builder (~> 3.1)
-    activerecord (4.2.7.1)
-      activemodel (= 4.2.7.1)
-      activesupport (= 4.2.7.1)
+    activerecord (4.2.8)
+      activemodel (= 4.2.8)
+      activesupport (= 4.2.8)
       arel (~> 6.0)
-    activesupport (4.2.7.1)
+    activesupport (4.2.8)
       i18n (~> 0.7)
-      json (~> 1.7, >= 1.7.7)
       minitest (~> 5.1)
       thread_safe (~> 0.3, >= 0.3.4)
       tzinfo (~> 1.1)
     acts-as-taggable-on (4.0.0)
       activerecord (>= 4.0)
-    addressable (2.5.0)
+    addressable (2.5.1)
       public_suffix (~> 2.0, >= 2.0.2)
     arbre (1.1.1)
       activesupport (>= 3.0.0)
     arel (6.0.4)
     ast (2.3.0)
     bcrypt (3.1.11)
-    bourbon (4.3.2)
+    bourbon (4.3.4)
       sass (~> 3.4)
       thor (~> 0.19)
-    brakeman (3.5.0)
+    brakeman (3.6.1)
     buftok (0.2.0)
     builder (3.2.3)
     bundler-audit (0.5.0)
@@ -100,18 +99,18 @@ GEM
       coffee-script-source
       execjs
     coffee-script-source (1.12.2)
-    concurrent-ruby (1.0.4)
+    concurrent-ruby (1.0.5)
     debug_inspector (0.0.2)
-    devise (4.2.0)
+    devise (4.2.1)
       bcrypt (~> 3.0)
       orm_adapter (~> 0.1)
       railties (>= 4.1.0, < 5.1)
       responders
       warden (~> 1.2.3)
-    devise-i18n (1.1.1)
+    devise-i18n (1.1.2)
     differ (0.1.2)
     docile (1.1.5)
-    domain_name (0.5.20161129)
+    domain_name (0.5.20170404)
       unf (>= 0.0.5, < 1.0.0)
     em-websocket (0.5.1)
       eventmachine (>= 0.12.9)
@@ -120,20 +119,20 @@ GEM
       activemodel
     equalizer (0.0.11)
     erubis (2.7.0)
-    eventmachine (1.2.2)
+    eventmachine (1.2.3)
     execjs (2.7.0)
     faraday (0.11.0)
       multipart-post (>= 1.2, < 3)
-    ffi (1.9.17)
+    ffi (1.9.18)
     font-awesome-sass (4.7.0)
       sass (>= 3.2)
     formatador (0.2.5)
-    formtastic (3.1.4)
+    formtastic (3.1.5)
       actionpack (>= 3.2.13)
     formtastic_i18n (0.6.0)
     geocoder (1.4.3)
-    globalid (0.3.7)
-      activesupport (>= 4.1.0)
+    globalid (0.4.0)
+      activesupport (>= 4.2.0)
     guard (2.14.1)
       formatador (>= 0.2.4)
       listen (>= 2.7, < 4.0)
@@ -156,7 +155,7 @@ GEM
       guard (~> 2.8)
       guard-compat (~> 1.0)
       multi_json (~> 1.8)
-    guard-migrate (1.2.1)
+    guard-migrate (2.0.0)
       activerecord (>= 4.1.0)
       guard (~> 2.3)
       guard-compat (~> 1.1)
@@ -177,8 +176,9 @@ GEM
       haml (>= 4.0.6, < 5.0)
       html2haml (>= 1.0.1)
       railties (>= 4.0.1)
-    haml_lint (0.21.0)
-      haml (~> 4.0)
+    haml_lint (0.24.0)
+      haml (>= 4.0, < 5.1)
+      rainbow
       rake (>= 10, < 13)
       rubocop (>= 0.47.0)
       sysexits (~> 1.1)
@@ -201,17 +201,17 @@ GEM
     http-form_data (1.0.1)
     http_accept_language (2.1.0)
     http_parser.rb (0.6.0)
-    i18n (0.8.0)
-    ice_cube (0.15.0)
-    inherited_resources (1.7.0)
+    i18n (0.8.1)
+    ice_cube (0.16.0)
+    inherited_resources (1.7.1)
       actionpack (>= 3.2, < 5.1)
       has_scope (~> 0.6)
       railties (>= 3.2, < 5.1)
       responders
-    jbuilder (2.6.1)
-      activesupport (>= 3.0.0, < 5.1)
+    jbuilder (2.6.3)
+      activesupport (>= 3.0.0, < 5.2)
       multi_json (~> 1.2)
-    jquery-rails (4.2.2)
+    jquery-rails (4.3.1)
       rails-dom-testing (>= 1, < 3)
       railties (>= 4.2.0)
       thor (>= 0.14, < 2.0)
@@ -230,8 +230,9 @@ GEM
       activerecord
       kaminari-core (= 1.0.1)
     kaminari-core (1.0.1)
-    leaflet-rails (1.0.2)
-    libv8 (3.16.14.17)
+    leaflet-rails (1.0.3)
+      rails (>= 4.2.0)
+    libv8 (3.16.14.19)
     listen (3.1.5)
       rb-fsevent (~> 0.9, >= 0.9.4)
       rb-inotify (~> 0.9, >= 0.9.7)
@@ -257,13 +258,13 @@ GEM
     mysql2 (0.4.5)
     naught (1.1.0)
     nenv (0.3.0)
-    nokogiri (1.7.0.1)
+    nokogiri (1.7.1)
       mini_portile2 (~> 2.1.0)
     notiffany (0.1.1)
       nenv (~> 0.1)
       shellany (~> 0.0)
     orm_adapter (0.5.0)
-    paper_trail (6.0.2)
+    paper_trail (7.0.1)
       activerecord (>= 4.0, < 5.2)
       request_store (~> 1.1)
     parser (2.4.0.0)
@@ -287,19 +288,19 @@ GEM
       rack
     rack-test (0.6.3)
       rack (>= 1.0)
-    rails (4.2.7.1)
-      actionmailer (= 4.2.7.1)
-      actionpack (= 4.2.7.1)
-      actionview (= 4.2.7.1)
-      activejob (= 4.2.7.1)
-      activemodel (= 4.2.7.1)
-      activerecord (= 4.2.7.1)
-      activesupport (= 4.2.7.1)
+    rails (4.2.8)
+      actionmailer (= 4.2.8)
+      actionpack (= 4.2.8)
+      actionview (= 4.2.8)
+      activejob (= 4.2.8)
+      activemodel (= 4.2.8)
+      activerecord (= 4.2.8)
+      activesupport (= 4.2.8)
       bundler (>= 1.3.0, < 2.0)
-      railties (= 4.2.7.1)
+      railties (= 4.2.8)
       sprockets-rails
     rails-assets-leaflet (1.0.3)
-    rails-assets-leaflet.markercluster (1.0.3)
+    rails-assets-leaflet.markercluster (1.0.4)
       rails-assets-leaflet (>= 1.0.3)
     rails-deprecated_sanitizer (1.0.3)
       activesupport (>= 4.2.0.alpha)
@@ -312,12 +313,13 @@ GEM
     rails-i18n (4.0.9)
       i18n (~> 0.7)
       railties (~> 4.0)
-    railties (4.2.7.1)
-      actionpack (= 4.2.7.1)
-      activesupport (= 4.2.7.1)
+    railties (4.2.8)
+      actionpack (= 4.2.8)
+      activesupport (= 4.2.8)
       rake (>= 0.8.7)
       thor (>= 0.18.1, < 2.0)
-    rainbow (2.2.1)
+    rainbow (2.2.2)
+      rake
     rake (12.0.0)
     ransack (1.8.2)
       actionpack (>= 3.0)
@@ -334,7 +336,7 @@ GEM
     request_store (1.3.2)
     responders (2.3.0)
       railties (>= 4.2.0, < 5.1)
-    rubocop (0.47.1)
+    rubocop (0.48.1)
       parser (>= 2.3.3.1, < 3.0)
       powerpack (~> 0.1)
       rainbow (>= 1.99.1, < 3.0)
@@ -342,7 +344,7 @@ GEM
       unicode-display_width (~> 1.0, >= 1.0.1)
     ruby-progressbar (1.8.1)
     ruby_dep (1.5.0)
-    ruby_parser (3.8.4)
+    ruby_parser (3.9.0)
       sexp_processor (~> 4.1)
     sass (3.4.23)
     sass-rails (5.0.6)
@@ -354,12 +356,12 @@ GEM
     sdoc (0.4.2)
       json (~> 1.7, >= 1.7.7)
       rdoc (~> 4.0)
-    sexp_processor (4.8.0)
+    sexp_processor (4.9.0)
     shellany (0.0.1)
-    simple_calendar (2.2.3)
+    simple_calendar (2.2.5)
       rails (>= 3.0)
     simple_oauth (0.3.1)
-    simplecov (0.13.0)
+    simplecov (0.14.1)
       docile (~> 1.1.0)
       json (>= 1.8, < 3)
       simplecov-html (~> 0.10.0)
@@ -382,9 +384,9 @@ GEM
       libv8 (~> 3.16.14.15)
       ref
     thor (0.19.4)
-    thread_safe (0.3.5)
-    tilt (2.0.6)
-    tinymce-rails (4.5.3)
+    thread_safe (0.3.6)
+    tilt (2.0.7)
+    tinymce-rails (4.5.6)
       railties (>= 3.1.1)
     tinymce-rails-langs (4.20160310)
       tinymce-rails (~> 4.1, >= 4.1.10)
@@ -401,14 +403,14 @@ GEM
       memoizable (~> 0.4.2)
       naught (~> 1.1)
       simple_oauth (~> 0.3.1)
-    tzinfo (1.2.2)
+    tzinfo (1.2.3)
       thread_safe (~> 0.1)
-    uglifier (3.0.4)
+    uglifier (3.2.0)
       execjs (>= 0.3.0, < 3)
     unf (0.1.4)
       unf_ext
-    unf_ext (0.0.7.2)
-    unicode-display_width (1.1.3)
+    unf_ext (0.0.7.4)
+    unicode-display_width (1.2.1)
     warden (1.2.7)
       rack (>= 1.0)
     web-console (3.3.0)
diff --git a/app/admin/admin_user.rb b/app/admin/admin_user.rb
index 6f603bd2a366bb96664b0b789a8708dd469fb19e..588fc356954b8abedb1e7cd27f17cc29d8093a69 100644
--- a/app/admin/admin_user.rb
+++ b/app/admin/admin_user.rb
@@ -20,7 +20,7 @@ ActiveAdmin.register AdminUser do
   end
   controller do
     def permitted_params
-      params.permit admin_user: [:email, :password, :password_confirmation]
+      params.permit admin_user: %i[email password password_confirmation]
     end
   end
 end
diff --git a/app/controllers/digests_controller.rb b/app/controllers/digests_controller.rb
index 4a9641f4a421636eddeb0801a74131bb6fd8af06..e3a1d44db2d7c4f9bd687e1c168a368ee5fa53f6 100644
--- a/app/controllers/digests_controller.rb
+++ b/app/controllers/digests_controller.rb
@@ -2,7 +2,7 @@
 class DigestsController < ApplicationController
   has_scope :moderated, default: nil, allow_blank: true
   has_scope :region, :locality, :tag
-  has_scope :period, allow_blank: true, type: :hash, using: [:year, :week],
+  has_scope :period, allow_blank: true, type: :hash, using: %i[year week],
                      default: (
                        lambda do
                          { year: (Time.zone.today + 7.days).year,
diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb
index c878e7628af5ca69b1df04da6591ec7131199325..bf3edb2d3a70561dea5aba7e31ca042896f1a12b 100644
--- a/app/controllers/events_controller.rb
+++ b/app/controllers/events_controller.rb
@@ -2,12 +2,12 @@
 # This is a central part to this project
 class EventsController < ApplicationController
   has_scope :region, :locality, :tag, :daylimit, :year
-  has_scope :near, type: :hash, using: [:location, :distance]
+  has_scope :near, type: :hash, using: %i[location distance]
 
   before_action :set_events, only: [:index]
-  before_action :set_event, except: [:index, :new, :preview_create, :create]
-  before_action :set_create_event, only: [:preview_create, :create]
-  before_action :check_secret, only: [:edit, :preview, :update, :destroy]
+  before_action :set_event, except: %i[index new preview_create create]
+  before_action :set_create_event, only: %i[preview_create create]
+  before_action :check_secret, only: %i[edit preview update destroy]
   before_action :set_mailer_host
   rescue_from ActiveRecord::StaleObjectError, with: :locked
 
@@ -123,7 +123,7 @@ class EventsController < ApplicationController
 
   # Check that you can only edit an existing event if you know its secret
   def check_secret
-    redirect_to :root, alert: t(:forbidden, scope: [:events, :edit]) \
+    redirect_to :root, alert: t(:forbidden, scope: %i[events edit]) \
       unless params[:secret] == @event.secret
   end
 end
diff --git a/app/controllers/maps_controller.rb b/app/controllers/maps_controller.rb
index eea2cdd94e1f8dcd0ce9df7545ec8a32fb2e9fd7..dff32b4d4b6630f54bed72923b17cd658c1a8cd7 100644
--- a/app/controllers/maps_controller.rb
+++ b/app/controllers/maps_controller.rb
@@ -4,8 +4,8 @@
 class MapsController < ApplicationController
   has_scope :region, :locality, :tag, :daylimit
   has_scope :future, type: :boolean, default: true
-  has_scope :period, type: :hash, using: [:year, :week]
-  has_scope :near, type: :hash, using: [:location, :distance]
+  has_scope :period, type: :hash, using: %i[year week]
+  has_scope :near, type: :hash, using: %i[location distance]
 
   def index
     respond_to do |format|
diff --git a/app/controllers/moderations_controller.rb b/app/controllers/moderations_controller.rb
index 4fa841ba79b50e69148549fd19108967969224fa..f25c89465b203cddf380f4163f261a13e81ba69a 100644
--- a/app/controllers/moderations_controller.rb
+++ b/app/controllers/moderations_controller.rb
@@ -2,7 +2,7 @@
 class ModerationsController < ApplicationController
   before_action :authenticate_user!
   before_action :set_moderation, :set_mailer_host, only:
-    [:show, :edit, :preview, :update, :validate, :accept, :refuse, :destroy]
+    %i[show edit preview update validate accept refuse destroy]
   before_action :generate_destroy_reason, only: :destroy
   rescue_from ActiveRecord::StaleObjectError, with: :locked
 
diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb
index 1695a9ce1902c382196048d2f174a1c536db1d03..89771480e66ffaa841ebd28c9176f1b39e20cf76 100644
--- a/app/controllers/notes_controller.rb
+++ b/app/controllers/notes_controller.rb
@@ -1,7 +1,7 @@
 # Events, particulary during moderation, can have notes associated to them
 class NotesController < ApplicationController
-  before_action :set_event, only: [:new, :create]
-  before_action :create_note, :set_mailer_host, only: [:create]
+  before_action :set_event, only: %i[new create]
+  before_action :create_note, :set_mailer_host, only: %i[create]
 
   # GET /moderations/id/new
   def new
diff --git a/app/controllers/orgas_controller.rb b/app/controllers/orgas_controller.rb
index 4812e1cbe7213ef6e7484e12952cbd1ab6b5f284..6a68f66ef10973becfdc227c48fe2f350f479ed7 100644
--- a/app/controllers/orgas_controller.rb
+++ b/app/controllers/orgas_controller.rb
@@ -1,11 +1,11 @@
 # Groups life cycle
 class OrgasController < ApplicationController
   has_scope :region
-  has_scope :near, type: :hash, using: [:location, :distance]
+  has_scope :near, type: :hash, using: %i[location distance]
 
-  before_action :set_orga, except: [:index, :new, :create]
+  before_action :set_orga, except: %i[index new create]
   before_action :set_mailer_host
-  before_action :authenticate_user!, except: [:index, :new, :create, :show],
+  before_action :authenticate_user!, except: %i[index new create show],
                                      unless: :check_secret
 
   def index
@@ -97,7 +97,7 @@ class OrgasController < ApplicationController
 
   # Check that you can only edit an existing event if you know its secret
   def check_secret
-    !%w(validate refuse).include?(action_name) &&
+    !%w[validate refuse].include?(action_name) &&
       (!@orga.secret || @orga.secret == params[:secret])
   end
 end
diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb
index 5c0da9e7541a3e44b011a62e6b71a64972d06b8e..e3b2d20adda8a665686b29efcc011ce202bb1daa 100644
--- a/app/controllers/stats_controller.rb
+++ b/app/controllers/stats_controller.rb
@@ -16,7 +16,7 @@ class StatsController < ApplicationController
   end
 
   def year_grouping
-    if %w(Mysql2 MySQL PostgreSQL).include? Event.connection.adapter_name
+    if %w[Mysql2 MySQL PostgreSQL].include? Event.connection.adapter_name
       'extract(year from start_time)'
     elsif Event.connection.adapter_name == 'SQLite'
       'strftime("%Y", start_time)'
@@ -24,7 +24,7 @@ class StatsController < ApplicationController
   end
 
   def month_grouping
-    if %w(Mysql2 MySQL PostgreSQL).include? Event.connection.adapter_name
+    if %w[Mysql2 MySQL PostgreSQL].include? Event.connection.adapter_name
       'extract(month from start_time)'
     elsif Event.connection.adapter_name == 'SQLite'
       'strftime("%m", start_time)'
diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb
index b4ab569377df52077cf2e78cab1c79f1e4f4fa33..de835530834e096ebc6cb39df0710b1410a69e2d 100644
--- a/app/controllers/tags_controller.rb
+++ b/app/controllers/tags_controller.rb
@@ -1,7 +1,7 @@
 # Manage event and organisation tags
 class TagsController < InheritedResources::Base
   has_scope :region, :locality, :daylimit
-  has_scope :period, type: :hash, using: [:year, :week]
+  has_scope :period, type: :hash, using: %i[year week]
   has_scope :tag, as: :id
 
   def index
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 59719747f657208cdd8c8bdf2d81239f1c3f99cd..9f51e6d168ff679f1c8e8a953c5d222d0db89196 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1,7 +1,7 @@
 # Moderators life cycle
 class UsersController < ApplicationController
   before_action :authenticate_user!
-  before_action :set_user, only: [:show, :edit, :update, :destroy]
+  before_action :set_user, only: %i[show edit update destroy]
 
   # GET /users
   # GET /users.json
diff --git a/app/models/event.rb b/app/models/event.rb
index 8654557427bfbef85f2fc0a3f02b003f84f88cc0..11d93bbe95e41e6f8d5631d02e2126aa8390e17a 100644
--- a/app/models/event.rb
+++ b/app/models/event.rb
@@ -6,8 +6,8 @@ class Event < ActiveRecord::Base
   include Schedule
   acts_as_taggable
   strip_attributes
-  has_paper_trail ignore: [:last_updated, :lock_version, :secret, :submitter,
-                           :decision_time, :latitude, :longitude]
+  has_paper_trail ignore: %i[last_updated lock_version secret submitter
+                             decision_time latitude longitude]
 
   belongs_to :region
   # This is the scheduled first event
@@ -17,7 +17,7 @@ class Event < ActiveRecord::Base
 
   validates :title, presence: true
   validate :end_after_start
-  RULES = %w(daily weekly monthly monthly_day).freeze
+  RULES = %w[daily weekly monthly monthly_day].freeze
   validates :rule, allow_nil: true, inclusion: RULES
   validates :description, presence: true
   validates :city, presence: true
@@ -120,6 +120,6 @@ class Event < ActiveRecord::Base
 
   def end_after_start
     errors.add :end_time, :before_start if
-      !end_time.blank? && !start_time.blank? && end_time <= start_time
+      end_time.present? && start_time.present? && end_time <= start_time
   end
 end
diff --git a/app/models/orga.rb b/app/models/orga.rb
index dc15b500ec0d6312f9431c3cf8c0944d6ea21d7d..d4893a05855383620ba3915dd30da146bac0dd1d 100644
--- a/app/models/orga.rb
+++ b/app/models/orga.rb
@@ -2,8 +2,8 @@
 class Orga < ActiveRecord::Base
   acts_as_taggable
   strip_attributes
-  has_paper_trail ignore: [:last_updated, :secret, :submitter, :decision_time,
-                           :lock_version, :latitude, :longitude]
+  has_paper_trail ignore: %i[last_updated secret submitter decision_time
+                             lock_version latitude longitude]
 
   belongs_to :region
   belongs_to :kind
@@ -63,9 +63,9 @@ class Orga < ActiveRecord::Base
   end
 
   before_destroy do
-    OrgaMailer.destroy(self).deliver_now! unless submitter.blank?
+    OrgaMailer.destroy(self).deliver_now! if submitter.present?
     # Send email to moderators when an orga is deleted
-    ModerationorgaMailer.destroy(self).deliver_now! unless submitter.blank?
+    ModerationorgaMailer.destroy(self).deliver_now! if submitter.present?
   end
 
   def send_secret
diff --git a/app/views/events/index.rss.builder b/app/views/events/index.rss.builder
index 7638ae317a80748d4b221055567497b508c5f92b..ae252f0da685756fb55ac2f1dabbe5913f532740 100644
--- a/app/views/events/index.rss.builder
+++ b/app/views/events/index.rss.builder
@@ -1,12 +1,27 @@
+def meta(xml, event)
+  domain = root_url.gsub(/www/, '').gsub(/http.?:../, '').gsub(/:.*/, '')
+  xml.dc :identifier, "#{event.id}@#{domain}"
+  xml.dc :date, event.start_time.iso8601
+
+  return unless event.latitude || event.longitude
+  xml.georss :point, event.latitude, ' ', event.longitude
+end
+
+def event_to_rss(xml, event)
+  meta xml, event
+
+  xml.title "#{event.city}: #{event.title}, #{display_date event}"
+  xml.link event_url event
+  xml.description strip_tags event.description
+  xml.content(:encoded) { xml.cdata! event.description }
+end
+
 xml.instruct!
 
 xml.rdf :RDF,
-        'xmlns:rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
         'xmlns' => 'http://purl.org/rss/1.0/',
+        'xmlns:rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
         'xmlns:dc' => 'http://purl.org/dc/elements/1.1/',
-        'xmlns:sy' => 'http://purl.org/rss/1.0/modules/syndication/',
-        'xmlns:admin' => 'http://webns.net/mvcb/',
-        'xmlns:cc' => 'http://web.resource.org/cc/',
         'xmlns:content' => 'http://purl.org/rss/1.0/modules/content/',
         'xmlns:georss' => 'http://www.georss.org/georss' do
   xml.channel 'rdf:about' => root_url do
@@ -32,17 +47,7 @@ xml.rdf :RDF,
 
   @events.each do |event|
     xml.item 'rdf:about' => event_url(event) do
-      xml.title "#{event.city}: #{event.title}, #{display_date event}"
-      xml.link event_url event
-      domain = root_url.gsub(/www/, '').gsub(/http.?:../, '').gsub(/:.*/, '')
-      xml.dc :identifier, "#{event.id}@#{domain}"
-      xml.dc :date, event.start_time.iso8601
-      if event.latitude && event.longitude
-        xml.georss :point, event.latitude, ' ', event.longitude
-      end
-
-      xml.description strip_tags event.description
-      xml.content(:encoded) { xml.cdata! event.description }
+      event_to_rss xml, event
     end
   end
 end
diff --git a/app/views/versions/index.rss.builder b/app/views/versions/index.rss.builder
index 967d5acf8f2d444ec59e3c14b42130ed73d29360..cf7e42ede870dfd10514e3bbd19f2fc4896a7c4c 100644
--- a/app/views/versions/index.rss.builder
+++ b/app/views/versions/index.rss.builder
@@ -1,45 +1,65 @@
 require 'differ/format/patch'
 Differ.format = Differ::Format::Patch
 
+def gen_title
+  t 'layouts.application.title' +
+    if params[:region].present? && params[:region] != 'all'
+      region = Region.find(params[:region]).name
+      " [#{region}]"
+    else
+      ''
+    end
+end
+
+def meta(xml)
+  xml.items do
+    xml.rdf :Seq do
+      @versions.each do |version|
+        xml.rdf :li, 'rdf:resource' =>
+        polymorphic_url(version.item_type.tableize.singularize,
+                        id: version.item_id)
+      end
+    end
+  end
+end
+
+def about(xml)
+  xml.title gen_title
+  xml.description t 'layouts.application.subtitle'
+  xml.link root_url
+  xml.dc :language, 'fr'
+  xml.dc :creator, root_url
+
+  meta xml
+end
+
+def version_changes(version)
+  version.changeset.collect do |key, val|
+    version.item_type.constantize.human_attribute_name(key) +
+      ': ' +
+      if key == 'description'
+        Differ.diff(val[1], val[0]).to_s
+      else
+        "#{val[0]} → #{val[1]}"
+      end
+  end
+end
+
 xml.instruct!
 
 xml.rdf :RDF,
         'xmlns:rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
         'xmlns' => 'http://purl.org/rss/1.0/',
         'xmlns:dc' => 'http://purl.org/dc/elements/1.1/',
-        'xmlns:sy' => 'http://purl.org/rss/1.0/modules/syndication/',
-        'xmlns:admin' => 'http://webns.net/mvcb/',
-        'xmlns:cc' => 'http://web.resource.org/cc/',
-        'xmlns:content' => 'http://purl.org/rss/1.0/modules/content/',
-        'xmlns:georss' => 'http://www.georss.org/georss' do
+        'xmlns:content' => 'http://purl.org/rss/1.0/modules/content/' do
   xml.channel 'rdf:about' => root_url do
-    title = t 'layouts.application.title'
-    if params[:region].present? && params[:region] != 'all'
-      region = Region.find(params[:region]).name
-      title += " [#{region}]"
-    end
-    xml.title title
-    xml.description t 'layouts.application.subtitle'
-    xml.link root_url
-    xml.dc :language, 'fr'
-    xml.dc :creator, root_url
-
-    xml.items do
-      xml.rdf :Seq do
-        @versions.each do |version|
-          xml.rdf :li, 'rdf:resource' =>
-            polymorphic_url(version.item_type.tableize.singularize,
-                            id: version.item_id)
-        end
-      end
-    end
+    about xml
   end
 
-  @versions.each do |version|
-    if version.event == 'create'
-      object = version.item_type.constantize.find_by_id version.item_id
-      next unless object.try(:moderated?)
-    end
+  @versions.reject { |version| version.event == 'create' }.each do |version|
+    object = version.item_type.constantize.find_by id: version.item_id
+    next unless object.try(:moderated?)
+
     object = version.reify if object.nil?
     url = polymorphic_url(version.item_type.tableize.singularize,
                           id: version.item_id)
@@ -52,25 +72,9 @@ xml.rdf :RDF,
       xml.dc :date, version.created_at.iso8601
 
       if object.try(:description)
-        if version.event == 'create'
-          xml.description strip_tags object.description
-          xml.content(:encoded) { xml.cdata! object.description }
-        elsif version.event == 'update'
-          changes = ''
-          version.changeset.each do |key, val|
-            changes += version.item_type.constantize.human_attribute_name(key)
-            changes += ': '
-            if key == 'description' && val[0].present? && val[1].present?
-              changes += Differ.diff(val[1], val[0]).to_s
-            else
-              changes += "#{val[0]} → #{val[1]}"
-            end
-            changes += '
-            '
-          end
-          xml.description changes
-          xml.content(:encoded) { xml.cdata! changes }
-        end
+        changes = version_changes(version).join "\n"
+        xml.description changes
+        xml.content(:encoded) { xml.cdata! changes }
       end
     end
   end
diff --git a/config/application.rb b/config/application.rb
index 9ffce2245f765953dbadc895140e61a189c1d8e7..dd041c7407c54a2ad249a1ff70ca22c582340b9d 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -29,7 +29,7 @@ module AgendaDuLibreRails
       Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]
     # config.i18n.default_locale = :de
     config.i18n.default_locale = :fr
-    config.i18n.available_locales = [:fr, :en, :'pt-BR']
+    config.i18n.available_locales = %i[fr en 'pt-BR']
 
     config.action_mailer.default_options = {
       from: 'moderateurs@agendadulibre.org',
@@ -44,6 +44,6 @@ module AgendaDuLibreRails
     config.active_record.raise_in_transactional_callbacks = true
 
     # In rails 4, plugin and vendor images need to be precompiled
-    config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif)
+    config.assets.precompile += %w[*.png *.jpg *.jpeg *.gif]
   end
 end
diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb
index cc13b1fd54513c36b49be59aea74abcee7347338..0b9940c4cfd256792a7171abfe2e4cdb221e86c0 100644
--- a/config/initializers/mime_types.rb
+++ b/config/initializers/mime_types.rb
@@ -4,4 +4,4 @@
 # Mime::Type.register 'text/richtext', :rtf
 
 # Necessary for the /ical.php redirect to /events.ics
-Mime::Type.register 'text/calendar', :ics, [], %w(ical)
+Mime::Type.register 'text/calendar', :ics, [], %w[ical]
diff --git a/config/routes.rb b/config/routes.rb
index 6ef0d697ff3f4df2b5d9f2680a94c2ce18ff95b8..f163d5a9dde29d52330bf9ad427924a136356699 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -9,16 +9,16 @@ Rails.application.routes.draw do
     patch :preview, on: :member
   end
   resources :moderations do
-    resources :notes, only: [:new, :create]
+    resources :notes, only: %i[new create]
     patch :preview, on: :member
     get :validate, :refuse, on: :member
     put :accept, on: :member
   end
-  resources :digests, only: [:index, :show]
-  resources :regions, only: [:index]
+  resources :digests, only: %i[index show]
+  resources :regions, only: %i[index]
   get 'tags/orgas', to: 'tags#orgas'
-  resources :tags, only: [:index, :show]
-  resources :maps, only: [:index, :show]
+  resources :tags, only: %i[index show]
+  resources :maps, only: %i[index show]
   resources :orgas do
     get :cancel, :validate, :refuse, on: :member
     put :accept, on: :member
diff --git a/db/migrate/20131114103121_create_active_admin_comments.rb b/db/migrate/20131114103121_create_active_admin_comments.rb
index 092168966797fc7e305df0522fac45db6c70a24b..e040f8bc6c857dc9409725d1ddacb84be75d10ae 100644
--- a/db/migrate/20131114103121_create_active_admin_comments.rb
+++ b/db/migrate/20131114103121_create_active_admin_comments.rb
@@ -10,9 +10,9 @@ class CreateActiveAdminComments < ActiveRecord::Migration
       t.references :author, polymorphic: true
       t.timestamps
     end
-    add_index :active_admin_comments, [:namespace]
-    add_index :active_admin_comments, [:author_type, :author_id]
-    add_index :active_admin_comments, [:resource_type, :resource_id]
+    add_index :active_admin_comments, %i[namespace]
+    add_index :active_admin_comments, %i[author_type author_id]
+    add_index :active_admin_comments, %i[resource_type resource_id]
   end
 
   def self.down
diff --git a/db/migrate/20150711164423_create_versions.rb b/db/migrate/20150711164423_create_versions.rb
index ea506fb2c5528af65fc8962d87474342858ec609..81fc462fb09b6ee95aef55dcd6f86a678486fa1e 100644
--- a/db/migrate/20150711164423_create_versions.rb
+++ b/db/migrate/20150711164423_create_versions.rb
@@ -9,6 +9,6 @@ class CreateVersions < ActiveRecord::Migration
       t.text :object
       t.datetime :created_at
     end
-    add_index :versions, [:item_type, :item_id]
+    add_index :versions, %i[item_type item_id]
   end
 end
diff --git a/db/migrate/20161210105328_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb b/db/migrate/20161210105328_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb
index 72b88fe0948b318778ec262a4f8b37828bf41771..069b01caa7fba4c72eb990cd382ccb809bddb71f 100644
--- a/db/migrate/20161210105328_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb
+++ b/db/migrate/20161210105328_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb
@@ -17,7 +17,7 @@ class ActsAsTaggableOnMigration < ActiveRecord::Migration
     end
 
     add_index :taggings, :tag_id
-    add_index :taggings, [:taggable_id, :taggable_type, :context]
+    add_index :taggings, %i[taggable_id taggable_type context]
   end
 
   def self.up
diff --git a/db/migrate/20161210105329_add_missing_unique_indices.acts_as_taggable_on_engine.rb b/db/migrate/20161210105329_add_missing_unique_indices.acts_as_taggable_on_engine.rb
index 1f3aaea476e7f44b062222e4ead29e54bd84ddc9..45bc2dd2e1e974fcc80e529db380c5b988a5c293 100644
--- a/db/migrate/20161210105329_add_missing_unique_indices.acts_as_taggable_on_engine.rb
+++ b/db/migrate/20161210105329_add_missing_unique_indices.acts_as_taggable_on_engine.rb
@@ -4,10 +4,10 @@ class AddMissingUniqueIndices < ActiveRecord::Migration
     add_index :tags, :name, unique: true
 
     remove_index :taggings, :tag_id if index_exists?(:taggings, :tag_id)
-    remove_index :taggings, [:taggable_id, :taggable_type, :context]
+    remove_index :taggings, %i[taggable_id taggable_type context]
     add_index :taggings,
-              [:tag_id, :taggable_id, :taggable_type, :context, :tagger_id,
-               :tagger_type],
+              %i[tag_id taggable_id taggable_type context tagger_id
+                 tagger_type],
               unique: true, name: 'taggings_idx'
   end
 
@@ -17,6 +17,6 @@ class AddMissingUniqueIndices < ActiveRecord::Migration
     remove_index :taggings, name: 'taggings_idx'
 
     add_index :taggings, :tag_id unless index_exists?(:taggings, :tag_id)
-    add_index :taggings, [:taggable_id, :taggable_type, :context]
+    add_index :taggings, %i[taggable_id taggable_type context]
   end
 end
diff --git a/db/migrate/20161210105331_add_missing_taggable_index.acts_as_taggable_on_engine.rb b/db/migrate/20161210105331_add_missing_taggable_index.acts_as_taggable_on_engine.rb
index 71f2d7f43309d0628ec0120e211c945559c46846..d841559c07ff7072da9759c14c5101c824fbe070 100644
--- a/db/migrate/20161210105331_add_missing_taggable_index.acts_as_taggable_on_engine.rb
+++ b/db/migrate/20161210105331_add_missing_taggable_index.acts_as_taggable_on_engine.rb
@@ -1,10 +1,10 @@
 # This migration comes from acts_as_taggable_on_engine (originally 4)
 class AddMissingTaggableIndex < ActiveRecord::Migration
   def self.up
-    add_index :taggings, [:taggable_id, :taggable_type, :context]
+    add_index :taggings, %i[taggable_id taggable_type context]
   end
 
   def self.down
-    remove_index :taggings, [:taggable_id, :taggable_type, :context]
+    remove_index :taggings, %i[taggable_id taggable_type context]
   end
 end
diff --git a/db/migrate/20161210105333_add_missing_indexes.acts_as_taggable_on_engine.rb b/db/migrate/20161210105333_add_missing_indexes.acts_as_taggable_on_engine.rb
index 1be2d31504a048ace944fcd20b90b12f13f4b131..9a5fcfae87b3e94430b5aa18c22f63b954fac0bc 100644
--- a/db/migrate/20161210105333_add_missing_indexes.acts_as_taggable_on_engine.rb
+++ b/db/migrate/20161210105333_add_missing_indexes.acts_as_taggable_on_engine.rb
@@ -7,8 +7,8 @@ class AddMissingIndexes < ActiveRecord::Migration
     add_index :taggings, :tagger_id
     add_index :taggings, :context
 
-    add_index :taggings, [:tagger_id, :tagger_type]
-    add_index :taggings, [:taggable_id, :taggable_type, :tagger_id, :context],
+    add_index :taggings, %i[tagger_id tagger_type]
+    add_index :taggings, %i[taggable_id taggable_type tagger_id context],
               name: 'taggings_idy'
   end
 end
diff --git a/db/schema.rb b/db/schema.rb
index fac548fe1d204cba9e4f266c7503d4b30d575e99..c1d85b78b75cd57883ec025df8d04508c28219f8 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -14,12 +14,12 @@
 ActiveRecord::Schema.define(version: 20170422083422) do
 
   create_table "active_admin_comments", force: :cascade do |t|
-    t.string   "namespace",     limit: 255
-    t.text     "body",          limit: 65535
-    t.string   "resource_id",   limit: 255,   null: false
-    t.string   "resource_type", limit: 255,   null: false
-    t.integer  "author_id",     limit: 4
-    t.string   "author_type",   limit: 255
+    t.string   "namespace"
+    t.text     "body"
+    t.string   "resource_id",   null: false
+    t.string   "resource_type", null: false
+    t.integer  "author_id"
+    t.string   "author_type"
     t.datetime "created_at"
     t.datetime "updated_at"
   end