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
Recommendation.transaction do | |
Contributor.with_user.each do |contributor| | |
rand(5).times do | |
recommendation_group = groups.rand | |
Recommendation.create( | |
:user => contributor.user, | |
:group => recommendation_group, | |
:body => Faker::Lorem.sentence(5) | |
) | |
end |
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
if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER') | |
require 'logger' | |
RAILS_DEFAULT_LOGGER = Logger.new(STDOUT) |
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
namespace :routes do | |
task :check => [:environment] do | |
STANDARD_METHODS = %w(index new create show edit update destroy) | |
SUPPORT_CONTROLLERS = [ "ApplicationController", /BaseController$/] | |
unexisted_controllers = [] | |
unexisted_actions = [] | |
bound_controllers = [] | |
ActionController::Routing::Routes.routes.each do |route| | |
controller_path = route.requirements[:controller] |
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
filters = populate(Filter, 4) do |filter| | |
filter.title = words | |
filter.service = services.rand | |
(2+rand(3)).times do | |
filter.options << FilterOption.new(:filter => filter, :value => words) | |
end | |
end | |
display_amount(FilterOption) | |
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
context "without password confirmation" do | |
before(:each) do | |
subject.instance_eval do | |
def password_confirmation | |
self.password | |
end | |
end | |
end | |
it {should accept_values_for(:password, "abcdefg1")} | |
it {should_not accept_values_for(:password, "Abcdefgh", "12345678")} |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns:fb='http://www.facebook.com/2008/fbml' xmlns='http://www.w3.org/1999/xhtml'> | |
<head> | |
<meta content='text/html;charset=utf-8' http-equiv='Content-Type' /> | |
<title>JIBE</title> | |
<meta content='JIBE, Inc.' name='author' /> | |
<meta content='jobs, employment' name='keywords' /> | |
<meta content='JIBE finds jobs for you based on your social connections.' name='description' /> | |
<link href='/images/favicon.ico' rel='shortcut icon' /> |
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
class SearchController < ApplicationController | |
AUTHORS_TYPE = "AUTHORS_TYPE" | |
BOOKS_TYPE = "BOOKS_TYPE" | |
RECOMMENDATIONS_TYPE = "RECOMMENDATIONS_TYPE" | |
ALL_TYPES = [ AUTHORS_TYPE, BOOKS_TYPE, RECOMMENDATIONS_TYPE] | |
def index | |
@keywords = params[:keywords] | |
@category_ids = params[:category_ids] ? params[:category_ids].map(&:to_i) : [] |
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
ActionController::Routing::Routes.draw do |map| | |
map.login 'login', :controller => 'user_sessions', :action => 'new' | |
map.logout 'logout', :controller => 'user_sessions', :action => 'destroy' | |
map.resource :user_session | |
map.resources :users | |
map.resources :tasks |
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
#!/usr/bin/env ruby | |
require "rubygems" | |
require "god" | |
rails_env = ENV['RAILS_ENV'] || "production" | |
rails_root = ENV['RAILS_ROOT'] | |
queues = ENV['QUEUE'] || "critical,medium,low" |
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
require 'capistrano/ext/multistage' | |
set :stages, %w(staging production) | |
set :default_stage, "staging" | |
#set :branch, "default" | |
set :scm, :git | |
set :scm_verbose, false | |
set :repository, "[email protected]:railsware/startwire.git" | |
ssh_options[:forward_agent] = true |