Skip to content

Instantly share code, notes, and snippets.

View bogdan's full-sized avatar

Bogdan Gusiev bogdan

View GitHub Profile
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
if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER')
require 'logger'
RAILS_DEFAULT_LOGGER = Logger.new(STDOUT)
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]
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)
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")}
<!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' />
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) : []
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
#!/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"
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, "git@github.com:railsware/startwire.git"
ssh_options[:forward_agent] = true