Skip to content

Instantly share code, notes, and snippets.

class Note < ActiveRecord::Base
belongs_to :customer
attr_accessible :content
end
# == Schema Information
#
# Table name: notes
#
# id :integer not null, primary key
# content :text
Searching 204 files for "@customer=" (regex)
0 matches across 0 files
Searching 204 files for "@customer ="
C:\Users\denton\code\billing\app\controllers\bills_controller.rb:
4 def new
5 @bill = Bill.new
@jamesgecko
jamesgecko / bill.rb
Created March 19, 2012 20:53
Bill#update_date_paid method not found?
#app/models/bill.rb
class Bill < ActiveRecord::Base
belongs_to :customer
attr_accessible :amount, :date_due, :paid
before_create :default_values
before_save self.update_date_paid
def default_values
self.paid ||= false
["hello","good day","how do you do"].each{
|s|
caps( s ){ |x| x.capitalize!
puts( x )
}
}
@jamesgecko
jamesgecko / output.html
Created March 23, 2012 21:23
SimpleForm Chosen input
<!DOCTYPE html>
<html>
<head>
<title>Billing</title>
<link rel="icon" type="image/png" href="/favicon.png">
<link href="/assets/application.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/activity_feed.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/bills.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/bootstrap.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/chosen.css?body=1" media="all" rel="stylesheet" type="text/css" />
@jamesgecko
jamesgecko / gist:2293030
Created April 3, 2012 15:44
Error installing clean-css with npm
vagrant@lucid32:/vagrant/etherpad-lite$ npm install clean-css
npm http GET https://registry.npmjs.org/clean-css/0.3.2
npm http 200 https://registry.npmjs.org/clean-css/0.3.2
npm http GET https://registry.npmjs.org/clean-css/-/clean-css-0.3.2.tgz
npm http 200 https://registry.npmjs.org/clean-css/-/clean-css-0.3.2.tgz
npm http GET https://registry.npmjs.org/optimist
npm http 200 https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/optimist/-/optimist-0.1.9.tgz
npm http 200 https://registry.npmjs.org/optimist/-/optimist-0.1.9.tgz
npm ERR! error installing [email protected]
@jamesgecko
jamesgecko / bill.rb
Created April 9, 2012 19:56
Date compare, line 17
class Bill < ActiveRecord::Base
belongs_to :customer
attr_accessible :amount, :date_due, :paid
validates :amount, presence: true
validates :date_due, presence: true
before_create :default_values
before_save :update_date_paid
after_save :update_history
Sequel::DatabaseError at /customer
NativeException: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
file: jdbc.rb location: execute line: 235
BACKTRACE
(condense)
JUMP TO: GET POST COOKIES ENV
c:/dev/jruby-1.6.7/lib/ruby/gems/1.8/gems/sequel-3.34.1/lib/sequel/adapters/jdbc.rb in execute
yield log_yield(sql){stmt.executeQuery(sql)}
c:/dev/jruby-1.6.7/lib/ruby/gems/1.8/gems/sequel-3.34.1/lib/sequel/database/logging.rb in log_yield
return yield if @loggers.empty?
@jamesgecko
jamesgecko / output
Created April 26, 2012 14:47
case matches using ===
unknown, String, foo
unknown, Fixnum, 42
unknown, Array,
irb(main):041:0> true.class
=> TrueClass
irb(main):042:0> true === TrueClass
=> false