Skip to content

Instantly share code, notes, and snippets.

NoMethodError (You have a nil object when you didn't expect it!
The error occurred while evaluating nil.klass):
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:2868:in `execute_callstack_for_multiparameter_attributes'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:2867:in `each'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:2867:in `execute_callstack_for_multiparameter_attributes'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:2853:in `assign_multiparameter_attributes'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:2591:in `attributes='
/app/controllers/orders_controller.rb:60:in `purchase'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:1253:in `send'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:1253:in `perform_action_without_filters'
$('select#limit_amount').change(function() {
var limit = $('select#limit_amount option:selected').text();
var new_script = $('#widget_text').val().replace(/.js(\?limit=[0-9]+)*\"\>/, '.js?limit='+ limit +'\"\>');
$('#widget_text').val(new_script);
var link = $('#widget_text').val().match(/src=\"(.*)\"\>/)[1]
$.getScript(link);
});
SELECT * FROM `delayed_jobs` WHERE ((run_at <= '2009-03-12 02:59:22' AND (locked_at IS NULL OR locked_at < '2009-03-11 22:59:22') OR (locked_by = 'host:client1.gethandcrafted.com pid:4664')) AND failed_at IS NULL) ORDER BY priority DESC, run_at ASC LIMIT 5;
# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: mysql
database: uc_development
username: root
password:
# Warning: The database defined as 'test' will be erased and
# re-generated from your development database when you run 'rake'.
We couldn’t find that file to show.
#!/usr/bin/env ruby
require 'yaml'
cluster = YAML::load(File.open(File.dirname(__FILE__) + '/../config/cluster.yml'))
command = ARGV.shift.to_s.to_sym
0.upto(cluster["cluster_size"].to_i - 1) do |server|
`./bin/tweetbots #{command} --config daemon_name="tweetbots #{server}" --pid /tmp/tweetbots.#{server}.pid`
end`
server {
listen 80;
server_name www.web20show.com;
rewrite ^(.*) http://web20show.com$1 permanent;
}
server {
listen 80;
server_name web20show.com *.web20show.com;
root /data/web20show.com/current/public;
%ul
- item.pros.each do |pro|
%li
= pro
<table>
<tr>
<th><input id="id_selector" name="id_selector" toggle_all="items_form_checkbox" type="checkbox" value="" /></th>
<th>Title</th>
<th>Body</th>
<th>Posted At</th>
def method_missing(name, *args)
value = find_value(name)
value.empty? ? super(name, *args) : value
end
def find_value(name)
field_values.collect {|field_value| field_value.value.value if name.to_s == field_value.form_field.name.to_s.downcase}.flatten.compact.to_s
end