- Put this code at #{Rails.root}/db/seeds.rb
- type
rake db:setup
It supports only `id' primary key.
class Company | |
def initialize | |
@name = nil | |
@addr = nil | |
@url = nil | |
@tel = nil | |
@email = nil | |
@foundation = nil | |
end |
#! /bin/sh | |
# | |
# clean up your uncontrollable ssh sessions | |
# | |
ps a | awk '$5 ~ /^ssh/ {print $1}' | xargs kill -KILL | |
find ~/.ssh/ -name 'master-*' | xargs rm |
$KCODE='u' unless defined? ::Encoding |
module ActionDispatch | |
module Http | |
class UploadedFile | |
def to_param | |
self | |
end | |
end | |
end | |
end |
# -*- mode: ruby -*- | |
class Klass < ActiveRecord::Base | |
# "undefined ..." | |
validates_inclusion_of :in => values | |
# success ! | |
validates_inclusion_of :in => self.values | |
# cannot be called |
jQuery( function($) { | |
$.route( | |
{ | |
path: /^\/$/, | |
func: function() { | |
$LAB.script('/javascripts/console_hello.js'); | |
} | |
}, | |
{ | |
path: /^\/hello/, |
# | |
# [Param] String column | |
# [Param] Array items | |
# [Return] String | |
# | |
def self.in( column, items ) | |
if ( items.respond_to? :map and items.size > 0 ) | |
sprintf( "#{column} in ( %s )", | |
items.map { |e| | |
( e.is_a? String ) ? sanitize(e) : e |
namespace :git do | |
desc "list git-untracked files" | |
task :untracked do | |
sh 'git ls-files -o --exclude-from=.gitignore' | |
end | |
end |