Skip to content

Instantly share code, notes, and snippets.

View c3mediagroup's full-sized avatar

Robert Pierce c3mediagroup

View GitHub Profile
def advisor
advisor = User.advisor.find(params[:id])
category = params[:category]
case category
when 'fixed'
chart_years = advisor.fixed_product_years.find_all_by_year(@year_num)
chart_yaml = "advisor_runrate"
when 'combined'
chart_years = advisor.combined_product_years.find_all_by_year(@year_num)
chart_yaml = "advisor_runrate_combined"
def apr_status_indicator(advisor)
# Version that matches feature. Expanding status possibilities to match clubsumm field
# qualified, on_target, not_on_target
status = advisor.apr_status.blank? ? "not_found" : advisor.apr_status
image_tag "icons/#{status}.png", :size => "16x16", :class => "tooltip", :title => status.humanize
end
def premiums
# Chart used for Agency, Unit and Producer Run Rate charts.
# Use this as a template for cleaning up/creating other chart methods.
require 'enumerator'
whom = current_account
whom = User.find(params[:advisor_id]) if params[:advisor_id]
whom = Team.find(params[:team_id]) if params[:team_id]
goal = whom.premiums_goal(@year_num)
~/www/railsmachine/statusroom(dev_robert) > git push origin dev_robert:stable_edge ; cap staging deploy
Total 0 (delta 0), reused 0 (delta 0)
To [email protected]:c3mediagroup/statusroom.git
382c243..15a8e7b dev_robert -> stable_edge
* executing `staging'
triggering start callbacks for `deploy'
* executing `multistage:ensure'
* executing `deploy'
* executing `deploy:update'
** transaction: start
~/www/railsmachine/statusroom(stable_edge) > git log
commit bee48814f4078969f2dfe56249cb3cc329410ec2
Merge: 85e18e7... 4c9a054...
Author: Robert Pierce <[email protected]>
Date: Mon Jun 8 15:41:10 2009 -0700
Merge branch 'stable_edge' of [email protected]:railsmachine/statusroom into stable_edge
commit 85e18e7b250adec9928ae9c667e543278f406ede
Merge: f89c508... ce6ed09...
----------------------------------------------------------------------------------------------------
* executing "sudo -p 'sudo password: ' RAILS_ROOT=/srv/statusroom/releases/20090608213304 RAILS_ENV=production shadow_puppet /srv/statusroom/releases/20090608213304/app/manifests/application_manifest.rb"
servers: ["staging.statusroom.c3media.managedmachine.com"]
[staging.statusroom.c3media.managedmachine.com] executing command
** [out :: staging.statusroom.c3media.managedmachine.com] /usr/lib/ruby/gems/1.8/gems/facter-1.5.4/lib/facter/util/loader.rb:72: command not found:
** [out :: staging.statusroom.c3media.managedmachine.com] Uncaught exception
** [out :: staging.statusroom.c3media.managedmachine.com]
** [out :: staging.statusroom.c3media.managedmachine.com] NameError
** [out :: staging.statusroom.c3media.managedmachine.com]
** [out :: staging.statusroom.c3media.managedmachine.com] uninitialized constant Configatron
Feature: Advisor Performance Feature
In order to show advisor performance
As an application user
I should be able to see accurate advisor performance data
Scenario: User views advisor's current premium status
Given I am an authorized user
When I view an advisor's Current Status Indicator mini-panel
Then I should see the amount of his current premium ytd
And the current premium ytd should match the table number
~/www/railsmachine/statusroom(11-update-premium-views) > ls -alh /usr/local/src/ruby-1.8.6-p287
total 18048
drwxr-xr-x 156 rpierce2 admin 5.2K Jun 7 09:12 .
drwxrwxr-x 38 root admin 1.3K Jun 1 07:05 ..
-rw-r--r-- 1 rpierce2 admin 438B Feb 12 2007 .cvsignore
-rw-r--r-- 1 rpierce2 admin 329B Feb 12 2007 .document
drwxr-xr-x 5 rpierce2 admin 170B Jun 7 09:03 .ext
-rw-r--r-- 1 root admin 44K Jun 7 09:13 .installed.list
-rw-r--r-- 1 rpierce2 admin 0B Jun 7 09:12 .rbconfig.time
-rw-r--r-- 1 rpierce2 admin 2.4K Feb 12 2007 COPYING
~ > ruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-darwin9.7.0]
~ > which ruby
/usr/local/bin/ruby
~ > gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.4
- RUBY VERSION: 1.8.6 (2008-08-11 patchlevel 287) [i686-darwin9.7.0]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/local/bin/ruby
~/www/railsmachine/statusroom(dev_robert) > PAGER=cat git blame public/javascripts/application.js|grep 2009-06
72b8dbc9 (Matt Petty 2009-06-02 12:13:00 -0500 3)
3e7659ee (Matt Petty 2009-06-05 07:28:31 -0500 26) _()
f35983a7 (Matt Petty 2009-06-05 00:37:11 -0500 29) _(this).parent().children('.filter-content').slideToggle();
3e7659ee (Matt Petty 2009-06-05 07:28:31 -0500 30) var drp = _('.date_range_picker:visible', _(this).parent());
f35983a7 (Matt Petty 2009-06-05 00:37:11 -0500 32) drp.daterangepicker({
f35983a7 (Matt Petty 2009-06-05 00:37:11 -0500 33) presetRanges: [
f35983a7 (Matt Petty 2009-06-05 00:37:11 -0500 34) {text: "2006", dateStart: "01/01/2006", dateEnd: "12/31/2006"},
f35983a7 (Matt Petty 2009-06-05 00:37:11 -0500 35) {text: "2007", dateStart: "01/01/2007", dateEnd: "12/31/2007"},
f35983a7 (Matt Petty 2009-06-05 00:37:11 -0500 36) {text: "2008", dateStart: "01/01/2008", dateEnd: "12/31/