My Recent Pastes (47 and counting)
Pastes by protocool (47 and counting)
Below are the 15 most recent pasties by protocool.
February 05, 2008
4:18PM EDT
by protocool
View all 23 lines
diff --git a/vendor/rails/actionpack/lib/action_controller/resources.rb b/vendor/rails/actionpack/lib/action_controller/resources.rb index 8ec6b84..c7bc0c4 100644 --- a/vendor/rails/actionpack/lib/action_controller/resources.rb +++ b/vendor/rails/actionpack/lib/action_controller/resources.rb @@ -458,6 +458,10 @@ module ActionController
October 22, 2007
12:01PM EDT
by protocool
View all 16 lines
require File.dirname(__FILE__) + '/../../spec_helper' describe Admin::InvoicesController, "when kicking a non-settled invoice" do before(:each) do login_as(mock_model(Person, :is_administrator? => true))
September 26, 2007
12:51AM EDT
by protocool
View all 10 lines
class ConcernBehaviour < Spec::DSL::Behaviour def before_eval # :nodoc: inherit Spec::Rails::DSL::EvalContext prepend_before {setup} append_after {teardown}
March 22, 2007
12:34PM EDT
by protocool
View all 23 lines
class ActiveRecord::Associations::HasManyAssociation def sum(*args, &block) return calculate(:sum, *args) if block.nil? load_target @target.sum(*args, &block)
March 21, 2007
7:09PM EDT
by protocool
View all 15 lines
## _songs.rhtml <div id='album_songs'> <ul id='songs' class='sortable'> <%= render :partial => 'songs/song', :collection => @album.songs, :locals => {:show_sort_handle => (@album.songs.size > 1)} %> </ul>
March 08, 2007
6:46PM EDT
by protocool
View all 11 lines
ImageScience.with_image(staging_filename) do |image| # sorry about the lambda - IS uses blocks to guarantee that images are # freed - and we don't want to resize an image if it's already 600x600 saver = lambda {|to_save| to_save.save(idea_filename)} if image.width == 600 && image.height == 600
March 07, 2007
3:46PM EDT
by protocool
View all 8 lines
ImageScience.with_image('source.jpg') {|image| image.resize(600,600) {|resized| resized.save('resized.jpg')}} ImageScience.with_image('resized.jpg') {|image| image.resize(600,600) {|resized| resized.save('resized_again.jpg')}} ## and we get back:
February 20, 2007
3:30PM EDT
by protocool
View all 8 lines
diego:~/Workspace/rubybuild/ruby-1.8.5-p12 trevor$ make test-all ./miniruby ./runruby.rb --extout=.ext -- -C "./test" runner.rb --runner=console dyld: NSLinkModule() error dyld: Symbol not found: _rl_filename_completion_function Referenced from: /Users/trevor/Workspace/rubybuild/ruby-1.8.5-p12/.ext/i686-darwin8.8.1/readline.bundle
February 15, 2007
2:06PM EDT
by protocool
View all 9 lines
diego:~/Workspace/ncaa/nod trevor$ ./script/console Loading development environment. >> $:.grep /active/ => ["./script/../config/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/vendor", "./script/../config/../config/../vendor/rails/activerecord/lib/../../activesupport/lib", "./script/../config/../config/../vendor/rails/activerecord/lib", "script/../config/../config/../vendor/rails/activesupport/lib", "script/../config/../config/../vendor/rails/activerecord/lib"] >> require 'feed_tools'
January 17, 2007
2:00PM EDT
by protocool
SELECT assets.`id` AS t0_r0, assets.`sti_type` AS t0_r1, assets.`label` AS t0_r2, assets.`updated_at` AS t0_r3, assets.`created_at` AS t0_r4, assets.`content_type` AS t0_r5, assets.`filename` AS t0_r6, assets.`size` AS t0_r7, assets.`width` AS t0_r8, assets.`height` AS t0_r9, assets.`parent_id` AS t0_r10, assets.`thumbnail` AS t0_r11, users.`id` AS t1_r0, users.`login` AS t1_r1, users.`crypted_password` AS t1_r2, users.`salt` AS t1_r3, users.`created_at` AS t1_r4, users.`updated_at` AS t1_r5, users.`remember_token` AS t1_r6, users.`remember_token_expires_at` AS t1_r7, users.`activation_code` AS t1_r8, users.`activated_at` AS t1_r9, users.`full_name` AS t1_r10, users.`phone` AS t1_r11, users.`fax` AS t1_r12, users.`company_name` AS t1_r13, users.`address1` AS t1_r14, users.`address2` AS t1_r15, users.`city` AS t1_r16, users.`state` AS t1_r17, users.`zipcode` AS t1_r18, users.`country` AS t1_r19 FROM assets LEFT OUTER JOIN asset_mappings ON (assets.id = asset_mappings.owner_id AND asset_mappings.`owner_type` = 'Asset' AND asset_mappings.`target_type` = 'User') LEFT OUTER JOIN users ON (users.id = asset_mappings.target_id)
January 17, 2007
1:57PM EDT
by protocool
class Asset < ActiveRecord::Base has_many :asset_mappings, :as => :owner has_many :bastards, :through => :asset_mappings, :source => :target, :source_type => 'User' end
January 17, 2007
1:39PM EDT
by protocool
SELECT assets.`id` AS t0_r0, assets.`sti_type` AS t0_r1, assets.`label` AS t0_r2, assets.`updated_at` AS t0_r3, assets.`created_at` AS t0_r4, assets.`content_type` AS t0_r5, assets.`filename` AS t0_r6, assets.`size` AS t0_r7, assets.`width` AS t0_r8, assets.`height` AS t0_r9, assets.`parent_id` AS t0_r10, assets.`thumbnail` AS t0_r11, users.`id` AS t1_r0, users.`login` AS t1_r1, users.`crypted_password` AS t1_r2, users.`salt` AS t1_r3, users.`created_at` AS t1_r4, users.`updated_at` AS t1_r5, users.`remember_token` AS t1_r6, users.`remember_token_expires_at` AS t1_r7, users.`activation_code` AS t1_r8, users.`activated_at` AS t1_r9, users.`full_name` AS t1_r10, users.`phone` AS t1_r11, users.`fax` AS t1_r12, users.`company_name` AS t1_r13, users.`address1` AS t1_r14, users.`address2` AS t1_r15, users.`city` AS t1_r16, users.`state` AS t1_r17, users.`zipcode` AS t1_r18, users.`country` AS t1_r19 FROM assets LEFT OUTER JOIN asset_mappings ON (assets.id = asset_mappings.owner_id AND asset_mappings.`owner_type` = 'Asset' AND asset_mappings.`target_type` = 'User') LEFT OUTER JOIN users ON (users.id = asset_mappings.target_id)
January 17, 2007
1:38PM EDT
by protocool
SELECT assets.`id` AS t0_r0, assets.`sti_type` AS t0_r1, assets.`label` AS t0_r2, assets.`updated_at` AS t0_r3, assets.`created_at` AS t0_r4, assets.`content_type` AS t0_r5, assets.`filename` AS t0_r6, assets.`size` AS t0_r7, assets.`width` AS t0_r8, assets.`height` AS t0_r9, assets.`parent_id` AS t0_r10, assets.`thumbnail` AS t0_r11, users.`id` AS t1_r0, users.`login` AS t1_r1, users.`crypted_password` AS t1_r2, users.`salt` AS t1_r3, users.`created_at` AS t1_r4, users.`updated_at` AS t1_r5, users.`remember_token` AS t1_r6, users.`remember_token_expires_at` AS t1_r7, users.`activation_code` AS t1_r8, users.`activated_at` AS t1_r9, users.`full_name` AS t1_r10, users.`phone` AS t1_r11, users.`fax` AS t1_r12, users.`company_name` AS t1_r13, users.`address1` AS t1_r14, users.`address2` AS t1_r15, users.`city` AS t1_r16, users.`state` AS t1_r17, users.`zipcode` AS t1_r18, users.`country` AS t1_r19 FROM assets LEFT OUTER JOIN asset_mappings ON (assets.id = asset_mappings.owner_id AND asset_mappings.`owner_type` = 'Asset' AND asset_mappings.`target_type` = 'User') LEFT OUTER JOIN users ON (users.id = asset_mappings.target_id)
January 16, 2007
12:34AM EDT
by protocool
View all 34 lines
class Post < ActiveRecord::Base def self.public_page(requested_page = 0) Paginator.new(count(:conditions => "status <> 'Private'"), 25) {|offset, per_page all_public(per_page, offset) }.page(requested_page)
