Skip to content

Instantly share code, notes, and snippets.

View thedelchop's full-sized avatar

Joseph DelCioppio thedelchop

View GitHub Profile
class ActiveMembership < ActiveRecord::Base
belongs_to :member
belongs_to :qualifying_motion, :class_name => "Motion",
:foreign_key => :qualifying_motion_id
belongs_to :disqualifying_motion, :class_name => "Motion",
:foreign_key => :disqualifying_motion_id
validates :qualifying_motion, :presence => true
-tags.in_groups(3).each do |tags_in_group|
.span-7
%ul
-tags_in_group.each do |tag_name|
-if tag_name
%li{'data-tags-id' => tag_name.id}
%span{:class => highlight_new_tag(tag_name)}
-unless tag_name.motions.count > 0 || !removable
=link_to raw("<span>Remove</span>"), admin_tag_path(tag_name), :method => 'delete', :confirm => "Are you sure you want to delete the tag \"#{tag_name.name}\"?", :class => 'remove'
=tag_name.name
describe "email notifications" do
before(:each) do
# Disable database hits for speed, we're only interested in whether the callbacks fire
# Joseph DelCioppio - Using PG this breaks the specs, most likely because motions are being created.
# In the interest of getting the project done first and foremost I'm removing it.
# ActiveRecord::Base.connection.stub(:execute)
@member_1 = Factory.stub(:member, :email => "member1@email.com")
@member_2 = Factory.stub(:member, :email => "member2@email.com")
Membership.stub(:members_active_at).and_return([@member_1, @member_2])
module RSpec
module Rails
module ViewRendering
PathSetDelegatorResolver.class_eval do
def find_all(path, prefix, *args)
path_set.find_all(path, [prefix],*args).collect do |template|
::ActionView::Template.new(
"",
template.identifier,
template.handler,
Failures:
1) MotionsController#new with member logged in should set memeber id
Failure/Error: get :new
Could not render layout: undefined method `each' for "layouts":String
# /home/chopper/.rvm/gems/ruby-1.9.2-p0@jquery-governance/bundler/gems/rails-eb1e727544d9/actionpack/lib/abstract_controller/layouts.rb:347:in `rescue in _default_layout'
# /home/chopper/.rvm/gems/ruby-1.9.2-p0@jquery-governance/bundler/gems/rails-eb1e727544d9/actionpack/lib/abstract_controller/layouts.rb:344:in `_default_layout'
# /home/chopper/.rvm/gems/ruby-1.9.2-p0@jquery-governance/bundler/gems/rails-eb1e727544d9/actionpack/lib/abstract_controller/layouts.rb:323:in `_layout_for_option'
# /home/chopper/.rvm/gems/ruby-1.9.2-p0@jquery-governance/bundler/gems/rails-eb1e727544d9/actionpack/lib/abstract_controller/layouts.rb:290:in `_normalize_options'
# /home/chopper/.rvm/gems/ruby-1.9.2-p0@jquery-governance/bundler/gems/rails-eb1e727544d9/actionpack/lib/action_controller/metal/rendering.rb:40:in `_nor
@thedelchop
thedelchop / demo_instructions.md
Created January 5, 2011 22:16
These are the instructions for getting a demo of the jQuery governance site up and running

#Install instructions and Demo notes

git clone git@github.com:wycats/jquery-governance

bundle 

rake setup

This will populate the db with several members and motions in various states.

Using the default profile...
...Member
SELECT "events".* FROM "events" WHERE "events"."event_type" = 'second' AND ("events"."member_id" = 1298)
Motion
SELECT "events".* FROM "events" WHERE "events"."event_type" = 'second' AND ("events"."member_id" = 1298) AND ("events"."motion_id" = 788)
...Member
SELECT "events".* FROM "events" WHERE "events"."event_type" = 'second' AND ("events"."member_id" = 1296)
.Member
SELECT "events".* FROM "events" WHERE "events"."event_type" = 'second' AND ("events"."member_id" = 1296)
Motion
@thedelchop
thedelchop / export
Created May 20, 2011 18:57
Output of export
declare -x Apple_PubSub_Socket_Render="/tmp/launch-DW5Sty/Render"
declare -x COLORFGBG="7;0"
declare -x COMMAND_MODE="unix2003"
declare -x COM_GOOGLE_CHROME_FRAMEWORK_SERVICE_PROCESS/USERS/THEDELCHOP/LIBRARY/APPLICATION_SUPPORT/GOOGLE/CHROME_SOCKET="/tmp/launch-Utvq76/ServiceProcessSocket"
declare -x DESTINATION="/var/folders/H5/H561aN6KFOCKYXIrl-0bgU+++TI/-Tmp-/Alfred 107 Update"
declare -x DISPLAY="/tmp/launch-icmj7T/org.x:0"
declare -x DYLD_LIBRARY_PATH="/usr/local/mysql/lib:"
declare -x GEM_HOME="/Users/thedelchop/.rvm/gems/ruby-1.9.2-p180"
declare -x GEM_PATH="/Users/thedelchop/.rvm/gems/ruby-1.9.2-p180:/Users/thedelchop/.rvm/gems/ruby-1.9.2-p180@global"
declare -x GREP_OPTIONS="--color"
@thedelchop
thedelchop / .autotest.rb
Created June 29, 2011 13:03
Autotest setup
Autotest.add_hook :initialize do |at|
if ARGV.empty?
%w{.git test vendor rerun.txt tmp public/system sqlite3 log/development.log log/production.log log/test.log log/server.log}.each {|exception| at.add_exception(exception)}
else
at.find_directories = ARGV.dup
end
end
@thedelchop
thedelchop / autotest bash
Created June 29, 2011 13:05
Bash command
autotest app/models spec/models