Skip to content

Commit

Permalink
use ruby 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
grosser committed May 11, 2017
1 parent 37a9c9e commit c448b54
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.3
2.4.1
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ DEPENDENCIES
webmock

RUBY VERSION
ruby 2.3.3p222
ruby 2.4.1p111

BUNDLED WITH
1.14.6
2 changes: 1 addition & 1 deletion app/models/concerns/attr_encrypted_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'attr_encrypted'

module AttrEncryptedSupport
ENCRYPTION_KEY = Rails.application.secrets.secret_key_base
ENCRYPTION_KEY = Rails.application.secrets.secret_key_base[0...32]
ENCRYPTION_KEY_SHA = Digest::SHA2.hexdigest(Rails.application.secrets.secret_key_base)

def self.included(base)
Expand Down
9 changes: 6 additions & 3 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@ def object_attrs_for_paper_trail
validates :external_id, presence: :true, unless: :integration?

scope :search, ->(query) {
return self if query.blank?
query = ActiveRecord::Base.send(:sanitize_sql_like, query)
where("name LIKE ? OR email LIKE ?", "%#{query}%", "%#{query}%")
if query.blank?
self
else
query = ActiveRecord::Base.send(:sanitize_sql_like, query)
where("name LIKE ? OR email LIKE ?", "%#{query}%", "%#{query}%")
end
}

def self.with_role(role_id, project_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@

it "shows nothing when flowdock fails to fetch users" do
stub_request(:get, "https://api.flowdock.com/v1/users").to_timeout
Rails.logger.expects(:error).with(
'Error fetching flowdock users (token invalid / flowdock down). Net::OpenTimeout: execution expired'
)
Rails.logger.expects(:error).with(includes('Error fetching flowdock users'))
service.users.must_equal([])

# is cached
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
it "returns empty users when there's an error" do
stub_request(:post, "https://slack.com/api/users.list").
to_return(body: {ok: false, error: "some error"}.to_json)
Rails.logger.expects(:error).with('Error fetching slack users: some error')
Rails.logger.expects(:error).with(includes('Error fetching slack users'))
service.users.must_equal([])

# is cached
Expand All @@ -35,9 +35,7 @@

it "shows nothing when slack fails to fetch users" do
stub_request(:post, "https://slack.com/api/users.list").to_timeout
Rails.logger.expects(:error).with(
'Error fetching slack users (token invalid / service down). Faraday::ConnectionFailed: execution expired'
)
Rails.logger.expects(:error).with(includes('Error fetching slack users'))
service.users.must_equal([])

# is cached
Expand Down

0 comments on commit c448b54

Please sign in to comment.