Merge branch 'master' of github.com:magnolia-fan/BeatHaven
Conflicts: config/routes.rb
This commit is contained in:
@@ -10,10 +10,10 @@ class Artist < ActiveRecord::Base
|
||||
return nil if query.nil? or query.strip.empty?
|
||||
|
||||
json = ActiveSupport::JSON.decode(open(
|
||||
'http://www.last.fm/search/autocomplete' <<
|
||||
'?q=' << URI.escape(query)
|
||||
).read)
|
||||
return nil if json.empty? else return json
|
||||
'http://www.last.fm/search/autocomplete' <<
|
||||
'?q=' << URI.escape(query)
|
||||
).read)
|
||||
return json.empty? ? nil : json
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -9,4 +9,16 @@ class User
|
||||
key :invites, Integer
|
||||
key :referer, Integer
|
||||
key :active, Integer
|
||||
|
||||
def logged_in
|
||||
unless request.session['session_id'].nil? or MainController.logged_in session['session_id']
|
||||
redirect_to '/login'
|
||||
return
|
||||
else
|
||||
if request.session['session_id'].nil?
|
||||
redirect_to '/login'
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user