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
/Users/galvatron/Sites/project/vendor/ruby/1.9.1/gems/cucumber-rails-1.0.2/lib/cucumber/rails.rb:4:in `dirname': can't convert nil into String (TypeError) | |
»·······from /Users/galvatron/Sites/project/vendor/ruby/1.9.1/gems/cucumber-rails-1.0.2/lib/cucumber/rails.rb:4:in `<top (required)>' | |
»·······from /Users/galvatron/.rvm/gems/ruby-1.9.2-p180-fastrequire/gems/bundler-1.1.pre.9/lib/bundler/runtime.rb:76:in `require' | |
»·······from /Users/galvatron/.rvm/gems/ruby-1.9.2-p180-fastrequire/gems/bundler-1.1.pre.9/lib/bundler/runtime.rb:76:in `rescue in block in require' | |
»·······from /Users/galvatron/.rvm/gems/ruby-1.9.2-p180-fastrequire/gems/bundler-1.1.pre.9/lib/bundler/runtime.rb:62:in `block in require' | |
»·······from /Users/galvatron/.rvm/gems/ruby-1.9.2-p180-fastrequire/gems/bundler-1.1.pre.9/lib/bundler/runtime.rb:55:in `each' | |
»·······from /Users/galvatron/.rvm/gems/ruby-1.9.2-p180-fastrequire/gems/bundler-1.1.pre.9/lib/bundler/runtime.rb:55:in `require' | |
»·······from /Users/galvatron/.rvm/gems/ruby-1.9.2-p180-fast |
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 node | |
// USAGE | |
// if you have given this executable permissions | |
// and you named the file something like "hn" | |
// then you can run "hn" which will | |
// print all of the news items on hackernews. | |
// You could also run "hn 1" which opens the first url. | |
// Make sure $BROWSER is set to a value. |
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
module ActiveRecord | |
class Base | |
class << self | |
def default_scope(options = {}) | |
reset_scoped_methods | |
default_scoping = self.default_scoping.dup | |
previous = default_scoping.pop | |
if previous.respond_to?(:call) or options.respond_to?(:call) |
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
def pending_total | |
if not_needed? | |
0.00 | |
else | |
# everyone gets the member pricing | |
daily_rate = ACCOMMODATION_RATES[room_type][:member] | |
departure_date = departure.to_date | |
arrival_date = arrival.to_date | |
total_days = departure_date - arrival_date | |
before_discounted_days = [[start_date - arrival_date, 3].min, 0].max |
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
# for testing validates_length_of :name, :within => 3..100, :allow_nil => true | |
it "should not be valid with a name having less than 3 or more than 100 characters, if name is given" do | |
@category = Category.new @valid_attributes | |
@category.name = 'to' | |
@category.should have(1).errors_on(:name) | |
@category.errors.on(:name).should include "too short" | |
@category = Category.new @valid_attributes | |
@category.name = 't'*101 | |
@category.should have(1).errors_on(:name) | |
@category.errors.on(:name).should include "too long" |
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
# app/models/student.rb | |
class Student < ActiveRecord::Base | |
include CommonValidations::StudentTeacherValidations | |
end | |
# app/models/teacher.rb | |
class Teacher < ActiveRecord::Base | |
include CommonValidations::StudentTeacherValidations | |
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
/* Centering a DIV */ | |
body { | |
text-align: center; | |
min-width: 600px; | |
} | |
#wrapper { | |
margin:0 auto; | |
width:600px; |
NewerOlder