Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' into rails4
Browse files Browse the repository at this point in the history
Conflicts:
	Gemfile
	Gemfile.lock
  • Loading branch information
nning committed Apr 1, 2014
2 parents 60bd7f1 + 07b023f commit a8377db
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ end
group :development, :test do
platforms :ruby do
gem 'sqlite3'
gem 'mysql'
gem 'mysql2'
end

platforms :jruby do
Expand All @@ -72,6 +72,8 @@ group :test do
gem 'coveralls', require: false # Test coverage statistics as a service
gem 'factory_girl_rails' # Instead of fixtures
gem 'faker' # For test data
gem 'minitest' # Required explicitly in "ruby 2.2.0dev (2014-03-04 trunk 45265)"
gem 'rake' # Travis seems to like this added explicitly
gem 'shoulda' # More beautiful assertions
gem 'shoulda-matchers', '~> 2.4.0'
end
Expand Down
6 changes: 4 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ GEM
mime-types (1.25.1)
minitest (4.7.5)
multi_json (1.8.4)
mysql (2.9.1)
mysql2 (0.3.15)
net-scp (1.1.2)
net-ssh (>= 2.6.5)
net-ssh (2.8.0)
Expand Down Expand Up @@ -315,12 +315,14 @@ DEPENDENCIES
inherited_resources
jquery-rails
kaminari
mysql
minitest
mysql2
paper_trail (= 3.0.0.beta1)
pg
rails (~> 4.0.2)
rails-erd
rails_config
rake
sass-rails!
sdoc
searchkick
Expand Down
3 changes: 2 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
* ManageSieve support?
* Fancy search.
* If a mailbox "foo" is renamed to "bar" and then to "foo" again, an exception
is thrown (see test/unit/mailbox_test.rb:57):
SQLite3::ConstraintException: UNIQUE constraint failed: relocations.mailbox_id: INSERT INTO "relocations" ("created_at", "mailbox_id", "old_domain", "old_username", "updated_at") VALUES (?, ?, ?, ?, ?)
* Relocation daemon.
* Make auto-refresh in changes index configurable.
9 changes: 9 additions & 0 deletions app/controllers/admin/searches_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,14 @@ class Admin::SearchesController < AdminController
# Search models for query.
def search
@results = Search.for(current_mailbox, params[:q])
rescue Elasticsearch::Transport::Transport::BadRequest
if @already_retried
raise
else
logger.warn 'Reindexing models, because we cought an bad request exception in elasticsearch transport.'
[Alias, Domain, Mailbox].map(&:reindex)
@already_retried = true
retry
end
end
end
4 changes: 3 additions & 1 deletion app/views/shared/_footer.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
%footer.container
- if current_mailbox.try :admin?
%p.text-right
%code= RUBY_DESCRIPTION
%code= About.ruby
%p.text-right
%code= "Last deployment: #{About.last_deploy}"
%p.text-right
= link_to 'Released', 'https://github.com/nning/moeil.git'
under the terms of the
Expand Down
11 changes: 11 additions & 0 deletions lib/about.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module About
# Ruby platform.
def self.ruby
RUBY_DESCRIPTION
end

# Change time of Rails root.
def self.last_deploy
File.ctime Rails.root
end
end

0 comments on commit a8377db

Please sign in to comment.