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
<!DOCTYPE html><html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/> | |
<title>Contractors | Sems UI</title> | |
<link href="/assets/active_admin.css?body=1" media="screen" rel="stylesheet" type="text/css" /><link href="/assets/active_admin/print.css?body=1" media="print" rel="stylesheet" type="text/css" /><link href="/assets/active_admin.css?body=1" media="screen" rel="stylesheet" type="text/css" /><link href="/assets/active_admin/print.css?body=1" media="print" rel="stylesheet" type="text/css" /><link href="/assets/active_admin.css?body=1" media="screen" rel="stylesheet" type="text/css" /><link href="/assets/active_admin/print.css?body=1" media="print" rel="stylesheet" type="text/css" /> <script src="/assets/active_admin.js" type="text/javascript"></script> | |
<script src="/assets/active_admin.js" type="text/javascript"></script> | |
<script src="/assets/active_admin.js" type="text/javascript"></script> | |
<meta content="authenticity_token" name="csrf-param" /> | |
<meta content |
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
# It extends activeadmin to show pretty boolean values | |
# | |
# config/initializers/active_admin.rb | |
module ActiveAdmin | |
module Views | |
class TableFor | |
def bool_column(attribute) | |
column(attribute){ |model| model[attribute] ? '✔'.html_safe : '✗'.html_safe } | |
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
module ActiveAdmin | |
module Inputs | |
class FilterNumericRangeInput < ::Formtastic::Inputs::StringInput | |
include FilterBase | |
def to_html | |
input_wrapping do | |
[ label_html, |
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 ActiveAdmin | |
module Views | |
class TableFor < Arbre::HTML::Table | |
def build_table_cell(col, item) | |
td(:class => ( col.options[:class] || (col.data.to_s.downcase if col.data.is_a?(Symbol)))) do | |
rvalue = call_method_or_proc_on(item, col.data, :exec => false) |
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
require 'java' | |
require 'jruby/core_ext' | |
module WS | |
class WebService | |
def test() | |
puts "Call received at #{Time.new}" | |
# x = Result.new | |
# x.name = "asdf" | |
# return x |
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
# config/initializers/active_admin.rb | |
require 'active_admin_custom_filter' | |
ActiveAdmin.setup do |config| | |
# ... | |
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
set :application, "myapplication" | |
set :repository, "[email protected]:git/#{application}.git" | |
set :server_name, "www.example.com" | |
set :scm, "git" | |
set :checkout, "export" | |
set :deploy_via, :remote_cache | |
set :branch, "master" | |
set :base_path, "/path/to/www" | |
set :deploy_to, "/path/to/www/#{application}" | |
set :apache_site_folder, "/etc/apache2/sites-enabled" |
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 ZendeskTicketsJob | |
extend Resque::Plugins::ExponentialBackoff | |
@queue = :low | |
FIELDS = ['zendesk_id', 'requester_id', 'assignee_id', 'group', 'subject', 'tags', 'status', 'priority', 'via', 'ticket_type', 'created_at', 'assigned_at', 'solved_at', 'resolution_time', 'satisfaction', 'group_stations', 'assignee_stations', 'reopens', 'replies', 'first_reply_time_in_minutes', 'first_reply_time_in_minutes_within_business_hours', 'first_resolution_time_in_minutes', 'first_resolution_time_in_minutes_within_business_hours', 'full_resolution_time_in_minutes', 'full_resolution_time_in_minutes_within_business_hours', 'agent_wait_time_in_minutes', 'agent_wait_time_in_minutes_within_business_hours', 'requester_wait_time_in_minutes', 'requester_wait_time_in_minutes_within_business_hours', 'reservation_code', 'requires_manual_closing'] | |
def self.perform(url) | |
`rm /tmp/zendesk_tickets*` | |
`wget #{url} -O /tmp/zendesk_tickets.csv.zip` | |
`unzip -p /tmp/zendesk_tickets.csv.zip > /tmp/zendesk_tickets.csv` | |
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
# db/migrate/20111218135715_globalize_models.rb | |
class GlobalizeModels < ActiveRecord::Migration | |
def up | |
NewsItem.create_translation_table!( | |
{:title => :string, :body => :text}, | |
{:migrate_data => true} | |
) | |
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
# db/migrate/20111218135715_globalize_models.rb | |
class GlobalizeModels < ActiveRecord::Migration | |
def up | |
NewsItem.create_translation_table!( | |
{:title => :string, :body => :text}, | |
{:migrate_data => true} | |
) | |
end |