Merge branch 'develop' of bitbucket.org:jamkazam/jam-cloud into develop

This commit is contained in:
Seth Call 2014-03-07 20:53:29 -06:00
commit eea0001ab3
5 changed files with 35 additions and 4 deletions

View File

@ -127,4 +127,6 @@ scores_mod_users2.sql
user_bio.sql
track_changes_counter.sql
scores_better_test_data.sql
connection_client_type.sql
connection_client_type.sql
add_countries_regions_and_cities.sql

View File

@ -0,0 +1,8 @@
create table cities (city varchar(255) not null, region varchar(2) not null, regionname varchar(64), countrycode varchar(2) not null, countryname varchar(64));
insert into cities (city, region, countrycode) select distinct city, region, countrycode from geoiplocations where length(city) > 0 and length(countrycode) > 0;
create table regions (region varchar(2) not null, regionname varchar(64), countrycode varchar(2) not null);
insert into regions (region, countrycode) select distinct region, countrycode from cities;
create table countries (countrycode varchar(2) not null, countryname varchar(64));
insert into countries (countrycode) select distinct countrycode from regions;

View File

@ -1 +1,3 @@
ALTER TABLE connections ADD COLUMN client_type VARCHAR(256) NOT NULL;
ALTER TABLE connections ADD COLUMN client_type VARCHAR(256);
UPDATE connections SET client_type = 'old' WHERE client_type IS NULL;
ALTER TABLE connections ALTER COLUMN client_type SET NOT NULL;

View File

@ -143,7 +143,7 @@
var template = $('#template-notification-panel').html();
var notificationHtml = context.JK.fillTemplate(template, {
notificationId: val.notification_id,
sessionId: val.sessionId,
sessionId: val.session_id,
avatar_url: context.JK.resolveAvatarUrl(val.photo_url),
text: val.formatted_msg,
date: $.timeago(val.created_at)

View File

@ -4,4 +4,23 @@ attributes :description, :source_user_id, :target_user_id, :session_id, :recordi
node :notification_id do |n|
n.id
end
end
# this has to be flat like this so this payload is the same as the protocol buffer (see initializeActions in sidebar.js)
node :fan_access do |n|
unless n.session_id.blank?
n.session.fan_access
end
end
node :musician_access do |n|
unless n.session_id.blank?
n.session.musician_access
end
end
node :approval_required do |n|
unless n.session_id.blank?
n.session.approval_required
end
end