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
App.accordion('.accordion','.item'); | |
App.accordion = function(container,item){ | |
var item_selector = container+' '+item; | |
$(item_selector+' .header').css('cursor','pointer'); | |
$(item_selector+' .header').on('click',function(){ | |
$(this).closest(item).find('.body').slideToggle(); | |
}); | |
}; |
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
# lib/tasks/db.rake | |
namespace :db do | |
desc "Dumps the database to db/APP_NAME.dump" | |
task :dump => :environment do | |
cmd = nil | |
epoch = Time.now.to_i | |
with_config do |app, host, db, user| | |
cmd = "pg_dump --verbose #{pg_login_config(host, user)} --clean --format=c #{db} > #{Rails.root}/db/#{app}-#{epoch}.dump" | |
end | |
puts cmd |
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
RSpec::Matchers.define :exceed_query_limit do |expected| | |
supports_block_expectations | |
match do |block| | |
query_count(&block) > expected | |
end | |
failure_message_when_negated do |actual| | |
"Expected a maximum of #{expected} queries, got #{@recorder.count}:\n\n#{@recorder.log_message}" | |
end |