Skip to content

Instantly share code, notes, and snippets.

View dchapman1988's full-sized avatar

David Chapman dchapman1988

View GitHub Profile
Installing rmagick (2.13.1) with native extensions /home/david/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:533:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/home/david/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
checking for stdint.h... yes
checking for sys/types.h... yes
Started GET "/admin/users/3" for 127.0.0.1 at 2011-08-22 14:54:34 +0000
Processing by Admin::UsersController#show as HTML
Parameters: {"id"=>"3"}
SQL (1.0ms) SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"users"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
Started POST "/admin/users/3" for 127.0.0.1 at 2011-08-22 15:04:48 +0000
Processing by Admin::UsersController#update as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"bFMTUKHquemi+2fio4wyaofqg9mQn1f8MPw7kbhjJZo=", "user"=>{"email"=>"david@isotope11.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "roles"=>"1"}, "commit"=>"Update User", "id"=>"3"}
SQL (1.0ms) SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"users"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
- if @prospect["questions"] && @prospect["responses"]
- questions, responses = @prospect["questions"].to_a, @prospect["responses"].to_a
#analysis_info
%ul
- for i in (0..questions.count-1)
%li
%span
= questions[i]["body"]
.statistic_bar_wrap
.statistic_bar{style: "width: #{(responses[i]["body"].to_i * 20)}%;"}
def leader_board_rank
if members = Member.all
ranks = members.sort! { |a,b| a.inkling_status[:worth] <=> b.inkling_status[:worth] }
rank = ranks.index{ |x| x == self } + 1
end
rank
end
def update
@member = Member.find params[:id]
begin
if params[:member][:current_balance]
@member.update_balance(params[:member][:current_balance].to_i)
end
rescue Faraday::Error::ParsingError #FIXME: Cough... Inkling Markets... And their white spaces...
if @member.update_attributes params[:member]
redirect_to '/refinery/members', :notice => "Member updated."
else
class Api::V1::CollegesController < Api::V1::BaseController
respond_to :json, :xml
def index
@colleges = College.all
respond_with @colleges
end
def show
@college = College.find(params[:id])
collection @college
attributes :name, :primary_position_id, :height, :high_school :weight, :location, :rating, :interests, :rated, :guid
code :primary_position do |p|
p.primary_position.try(:name)
end
code :high_school_location do |p|
p.high_school.try(:city)
collection @college => :prospect
attributes :height, :weight, :scout_evaluation, :id
code :name do |p|
p.name
end
code :high_school do |p|
p.high_school.try(:name)
object @prospect
attributes :height, :primary_position_id, :alternate_position_id, :weight, :class_year, :bench_press, :vertical_jump, :forty_time, :hundred_time, :jersey_number, :high_school_id, :rated, :scout_evaluation, :guid, :rating
code :image do |p|
{:large => root_url.chop + p.image.url(:large), :thumb => root_url.chop + p.image.url(:thumb)}
end
code :primary_position do |p|
p.primary_position.try(:name)
end