This file contains hidden or 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 Message < ApplicationRecord | |
include Trackable | |
# ... | |
end |
This file contains hidden or 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
# == Schema Information | |
# | |
# Table name: activities | |
# | |
# id :uuid not null, primary key | |
# user_id :uuid | |
# tenant_id :uuid | |
# contact_id :uuid | |
# trackable_type :string | |
# trackable_id :uuid |
This file contains hidden or 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
module Trackable | |
extend ActiveSupport::Concern | |
included do | |
has_many :activities, -> {order("created_at DESC")}, as: :trackable, dependent: :nullify | |
after_commit :track_activity | |
before_destroy :track_destroy | |
end | |
def track_destroy |
This file contains hidden or 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 ActivityCreator | |
def initialize(action, trackable, contact, comment=nil) | |
@trackable = trackable # the affected object (could be the same as contact) | |
@action = action # what was done | |
@comment = comment | |
@changes = collect_changes | |
end | |
def call |
This file contains hidden or 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
# amount_cents :integer default("0") | |
def amount=(amount) | |
amount = amount.gsub(/[^\d\.]/, '').to_f if amount.is_a?(String) | |
self.amount_cents = amount * 100 | |
end | |
def amount | |
amount_cents / 100.0 | |
end |
This file contains hidden or 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
Verifying that "crispinheneise.id" is my Blockstack ID. https://onename.com/crispinheneise |
This file contains hidden or 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 ApplicationController < ActionController::Base | |
# Prevent CSRF attacks by raising an exception. | |
# For APIs, you may want to use :null_session instead. | |
protect_from_forgery with: :exception | |
rescue_from ActiveRecord::RecordNotFound, :with => :render_404 | |
def render_404 | |
raise "A Page was not found!" | |
end | |
end |
This file contains hidden or 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
//<![CDATA[ | |
//-----Classes----- | |
function SermonProperty(data) | |
{ | |
this.data = data; | |
this.html = data; | |
this.compareTo = function(obj) | |
{ |
This file contains hidden or 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
marble_jar = 0 | |
count = 0 | |
catch :jar_is_full do | |
1000000000000.times do |marble| | |
count += 1 | |
# grab a random-sized marble | |
marble = rand(9) | |
This file contains hidden or 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
<?php | |
class Push_Highrise{ | |
var $highrise_url = ''; // your highrise url, e.g. http://yourcompany.highrisehq.com | |
var $api_token = ''; // your highrise api token; can be found under My Info | |
var $task_assignee_user_id = ''; // user id of the highrise user who gets the task assigned | |
var $category = ''; // the category where deals will be assigned to | |
var $errorMsg = ""; |