{
"id" : (integer, read only),
"lid" : (string, read only),
"custom_id" : (string, optional),
"state" : (string, optional),
"trusted_platforms" : (array of integers, optional),
"restricted_encrypted" : (boolean, optional),
"trusted_only" : (boolean, optional),
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Response | |
attr_accessor :data | |
delegate :[], :map, :select, :each, :first, :inject, to: :data | |
def initialize(data = nil) | |
self.data = data | |
end | |
def value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- for id, app in @email[:app_reviews] | |
- reviews_link = "#{root_url}apps/#{id}/reviews?start_date=#{app[:start_date].to_s}&end_date=#{@email[:end_date].to_s}&#{ga_suffix}" | |
- store_name = app[:store].downcase == 'itunes' ? 'App Store' : 'Google Play' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rails.logger.debug "[reviews report] building review data for app (#{app.id})" | |
token = make_jwt_token(user, app) | |
start_date = if user.last_review_email.present? && !env["force_emails"] | |
(user.last_review_email - 1.day).to_date | |
else | |
30.days.ago.to_date | |
end | |
start_date = [start_date, app.organization.active_entitlement.days_of_reviews_history.days.ago.to_date].max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MOPED: 127.0.0.1:27017 COMMAND database=admin command={:ismaster=>1} (0.3254ms) | |
MOPED: Could not connect to any node in replica set <Moped::Cluster nodes=[<Moped::Node resolved_address="127.0.0.1:27017">]>, refreshing list. | |
MOPED: 127.0.0.1:27017 COMMAND database=admin command={:ismaster=>1} (0.9255ms) | |
MOPED: 127.0.0.1:27017 COMMAND database=apptentive_production command={:count=>"survey_responses", :query=>{"deleted_at"=>nil, "survey_id"=>"572bdf52fd7381d6ee000004", "summary.572bdf52fd7381d6ee000008"=>{:$exists=>true}}} (555.3071ms) | |
=> 4838 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mongoid.default_session["survey_responses"].find.each_with_index do |response, index| | |
summary = {} | |
other_text_summary = {} | |
(response["answers"] || []).each do |answer| | |
if answer["_type"] == "Survey::Answers::Multiselect" | |
choices = (answer["selections"] || []).map { |s| s && s["answer_choice_id"] && s["answer_choice_id"].to_s } | |
summary[answer["question_id"].to_s] = choices if choices.present? | |
other = (answer["selections"] || []).detect { |s| s && s["text"].present? } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def from_rack(env_hash) | |
req = ::Rack::Request.new(env_hash) | |
self.url = req.scheme && req.url.split('?').first | |
self.method = req.request_method | |
self.query_string = req.query_string | |
self.data = read_data_from(req) | |
self.headers = format_headers_for_sentry(env_hash) | |
self.env = format_env_for_sentry(env_hash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def artist_stats ids | |
Artist.find(ids).each do |artist| | |
puts artist.name | |
tracks = artist.tracks.active | |
puts "tracks : #{tracks.count}" | |
puts "streams : #{tracks.map {|t| Track.hits[t.id]}.sum}" | |
downloads = Filing.joins(:folder).where("filings.track_id in (?) and folders.name = 'Downloads'", tracks.map(&:id)).count | |
puts "downloads : #{downloads}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%button { | |
color: red; | |
font-size: 14px; | |
} | |
%button-big { | |
font-size: 18px; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
identify: (options = {}) => | |
callback = options.callback | |
delete options.callback | |
attrs = _.extend options, "Account": App.name | |
if App.params.utm_campaign | |
attrs["Campaign Type"] = App.params.utm_medium | |
attrs["Campaign"] = App.params.utm_campaign |