random other warnings fixed
This commit is contained in:
parent
f01aed9d37
commit
f2eab9ee2d
3 changed files with 7 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
|||
class Api::TokensController < API::RestfulController
|
||||
def my_tokens
|
||||
raise Pundit::NotAuthorizedError.new unless current_user
|
||||
raise Pundit::NotAuthorizedError unless current_user
|
||||
instantiate_collection page_collection: false, timeframe_collection: false
|
||||
respond_with_collection
|
||||
end
|
||||
|
|
|
@ -9,10 +9,10 @@ class TopicsController < ApplicationController
|
|||
# GET /topics/autocomplete_topic
|
||||
def autocomplete_topic
|
||||
term = params[:term]
|
||||
if term && !term.empty?
|
||||
@topics = policy_scope(Topic.where('LOWER("name") like ?', term.downcase + '%')).order('"name"')
|
||||
@topics = if term && !term.empty?
|
||||
policy_scope(Topic.where('LOWER("name") like ?', term.downcase + '%')).order('"name"')
|
||||
else
|
||||
@topics = []
|
||||
[]
|
||||
end
|
||||
render json: autocomplete_array_json(@topics)
|
||||
end
|
||||
|
|
|
@ -40,7 +40,7 @@ class User < ActiveRecord::Base
|
|||
default_url: 'https://s3.amazonaws.com/metamaps-assets/site/user.png'
|
||||
|
||||
# Validate the attached image is image/jpg, image/png, etc
|
||||
validates_attachment_content_type :image, content_type: /\Aimage\/.*\Z/
|
||||
validates_attachment_content_type :image, content_type: %r(\Aimage/.*\Z)
|
||||
|
||||
# override default as_json
|
||||
def as_json(_options = {})
|
||||
|
|
Loading…
Add table
Reference in a new issue