Skip to content

Instantly share code, notes, and snippets.

class Survey < ActiveRecord::Base
include Surveyor::Models::SurveyMethods
include SurveyorExtension
end
module SurveyorExtension
extend ActiveSupport::Concern
# add your instance methods here
def foo
"foo"
end
# add your static(class) methods here
class Survey < ActiveRecord::Base
include Surveyor::Models::SurveyMethods
def interactions
return Interaction.where(:survey_id => self.id)
end
def title
"Custom #{super}"
end
Warning: PATH set to RVM ruby but GEM_HOME and/or GEM_PATH not set, see:
https://github.com/wayneeseguin/rvm/issues/3212
Warning! PATH is not properly set up, $GEM_HOME is not set,
usually this is caused by shell initialization files - check them for 'PATH=...' entries,
it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
to fix temporarily in this shell session run: 'rvm use ruby-1.9.3-p392'.
RVM is not a function, selecting rubies with 'rvm use ...' will not work.
{% extends "base.html" %}
{% block content %}
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>CMPGN.IO WebPhone</title>
<meta name="description" content="">
<meta name="author" content="">
import balanced
balanced.configure('ak-test-2eKlj1ZDfAcZSARMf3NMhBHywDej0avSY')
card = balanced.Card(
cvv='123',
expiration_month='12',
number='4444444444444448',
expiration_year='2020'
).save()
data = {'merchant_uri': '/v1/marketplaces/1',
'api_key': 'ak-test',
'owner_email': 'richie@balancedpayments.com',
'business_type': 'Ecommerce',
'full_name': 'Fat Amy',
'owner_phone_number': '12334567',
'marketplace_name': 'Test Marketplace',
'domain_url': 'aviato.com',
'support_email': '12334567@support.com',
'support_phone_number': '12334567',
If you want to wrap a WSGI app to record uncaught exceptions, Raven provides a middleware for that:
from raven.middleware import Sentry
application = Sentry(application, client=client)
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'corsheaders',
'gandalf',
'raven.contrib.django.raven_compat',
// Import the official balanced nodejs package
var balanced = require('balanced-official');
// Create a new API Key and configure the client with it
// The client automatically creates a new test marketplace for us
// if a marketplace does not exist for the api key
balanced.configure('ak-test-1xGEmbY58peQpnsgKEpgjuXgR1TjYdGpj');
// Create a customer with some dummmy data
balanced.get('/debits/WDwXsVosniVmJBcxO7IfTFj').then(function(customer) {