This file contains 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
PG::Error: ERROR: prepared statement "a3" already exists : | |
SELECT COUNT(*) FROM pg_class c LEFT JOIN pg_namespace n ON n.on = c.rel namespace WHERE c.relkind in ('v','r') AND c.relname = $1 AND n.nsp name = ANY (current_schema(false)) |
This file contains 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
http://jimneath.org/2011/03/24/using-redis-with-ruby-on-rails.html |
This file contains 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
Add to file [engine_path]/application.css | |
//= require twitter/bootstrap | |
$(document).ready(function(){ | |
/* Your javascripts goes here... */ | |
}); | |
Add to file [engine_path]/application.css | |
/* | |
*= require bootstrap_and_overrides |
This file contains 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
# ==> ORM configuration in file devise.rb | |
require 'devise/orm/active_record' | |
# ==> Application configuration in application.rb | |
config.generators do |g| | |
g.orm :active_record | |
end |
This file contains 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
@file = YAML.load_file("#{Rails.root.join('path/to/folder', 'file.yml')}") |
This file contains 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 Person | |
validates :gender_id, :presence => true, :inclusion => { :in => proc { |req| req.gender_types.map{ |key, value| key } } } #req - self 'Person' object | |
validates :title_id, :presence => true, :inclusion => { :in => proc { |req| req.title_types.map{ |key, value| key } } } | |
end |
This file contains 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 EmploymentInformation < ActiveRecord::Base | |
attr_accessible :employment_status_id, :company_name, :university | |
validates :employment_status_id, :presence => true, :inclusion => { :in => proc { |req| req.employment_status_types.map{ |key, value| key } } } | |
validates :company_name, :presence => true, :format => { :with => /\A[A-z\s\-\._]+\z/ }, :unless => proc { |req| req.employment_status.nil? } | |
validates :university, :presence => true, :format => { :with => /\A[A-z\s\-\._]+\z/ }, :unless => proc { |req| req.employment_status.nil? } | |
end |
This file contains 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
/^([0-9]{3}([0-9]{3})?|[0-9]{4})$/ -> 111. 1111, 111111 |
This file contains 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 bash | |
apt-get -y update | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev lib64readline-gplv2-dev libyaml-dev | |
cd /tmp | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz | |
tar -xvzf ruby-1.9.3-p194.tar.gz | |
cd ruby-1.9.3-p194/ | |
./configure --prefix=/usr/local | |
make | |
make install |
This file contains 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
actionpack (3.2.8) lib/action_view/base.rb:209:in `initialize' | |
app/builders/templates_builder.rb:3:in `new' | |
app/builders/templates_builder.rb:3:in `process' | |
app/controllers/templates_controller.rb:6:in `create' | |
actionpack (3.2.8) lib/action_controller/metal/implicit_render.rb:4:in `send_action' | |
actionpack (3.2.8) lib/abstract_controller/base.rb:167:in `process_action' | |
actionpack (3.2.8) lib/action_controller/metal/rendering.rb:10:in `process_action' | |
actionpack (3.2.8) lib/abstract_controller/callbacks.rb:18:in `block in process_action' | |
activesupport (3.2.8) lib/active_support/callbacks.rb:436:in `_run__2734696839539265386__process_action__2538432014012520187__callbacks' | |
activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `__run_callback' |
OlderNewer