Skip to content

Instantly share code, notes, and snippets.

require 'spec_helper'
describe Admin::SettingsController do
describe "as an administrator" do
before(:each) do
login_admin
end
describe "handling GET index" do
before(:each) do
require 'spec_helper'
describe Admin::SettingsController do
describe "as an administrator" do
before(:each) do
login_admin
end
describe "handling GET index" do
before(:each) do
rootfs on / type rootfs (ro)
tmpfs on /dev type tmpfs (rw,mode=755)
devpts on /dev/pts type devpts (rw,mode=600)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /sqlite_stmt_journals type tmpfs (rw,size=4096k)
none on /dev/cpuctl type cgroup (rw,cpu)
/dev/block/mtdblock4 on /system type yaffs2 (ro)
/dev/block/mtdblock6 on /data type yaffs2 (rw,nosuid,nodev)
/dev/block/mtdblock5 on /cache type yaffs2 (rw,nosuid,nodev)
# Edit at your own peril - it's recommended to regenerate this file
# in the future when you upgrade to a newer version of Cucumber.
# IMPORTANT: Setting config.cache_classes to false is known to
# break Cucumber's use_transactional_fixtures method.
# For more information see https://rspec.lighthouseapp.com/projects/16211/tickets/165
config.cache_classes = true
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
class CampMeetingReservation < ActiveRecord::Base
end
A Possible Bug in Rails 3?
With the following models, this command gives the corresponding error.
I think the error must reside in AREL since my assumption is that it fails since the WHERE statement is missing the id. Since the object is a new one, it doesn't have an ID, which is the reason for the error I assume from looking at the WHERE section of the sql (Should this query even be made?)
Model.new.contacts.size
ActiveRecord::StatementInvalid: Mysql::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 1: SELECT COUNT(*) AS count_id FROM `contacts` INNER JOIN `families` ON `contacts`.family_id = `families`.id WHERE (`contacts`.`type` = 'FamilyContact') AND ((`families`.id = ))
from /Users/nick/.rvm/gems/ruby-1.9.2-head/bundler/gems/rails-158e22d/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:211:in `rescue in log'
from /Users/nick/.rvm/gems/ruby-1.9.2-head/bundler/g
Desktop ➤ unzip attempt2.zip
Archive: attempt2.zip
signed by Moto-SignApk
warning [attempt2.zip]: 88356 extra bytes at beginning or within zipfile
(attempting to process anyway)
error [attempt2.zip]: start of central directory not found;
zipfile corrupt.
(please check that you have transferred or created the zipfile in the
appropriate BINARY mode and that you have compiled UnZip properly)
Headers:
HTTP/1.1 200 OK
Connection: close
Date: Tue, 31 Aug 2010 02:27:37 GMT
Content-Type: text/javascript; charset=utf-8
Etag: "8441eca440829f3a3e048e321968d69d"
Cache-Control: max-age=0, private, must-revalidate
X-UA-Compatible: IE=Edge,chrome=1
Set-Cookie: _clubs_session=BAh7CUkiD3Nlc3Npb25faWQGOgZFRiIlZTRlNDYyYTRjMTZlMzcyYjIxOWI2YmEzNWVhOTAxODRJIhBfY3NyZl90b2tlbgY7AEZJIjFsbllOMVBSKzZhRUIwOUhkc2VLVXhnUDN4NXVOVlkwekF5SmN3RGxySW5jPQY7AEZJIht3YXJkZW4udXNlci5wZXJzb24ua2V5BjsAVFsHSSIKU3RhZmYGOwBGaQILCkkiDGNsdWJfaWQGOwBGaWM%3D--7b09fa051b56ac2d9bda762631789ccdbab320fe; path=/; HttpOnly
X-Runtime: 0.207692
$('form').live('submit', function (e) {
var data = $(this).serializeArray();
$.ajax({
url: "http://www.example.com/",
data: data,
dataType: "script",
type: "POST",
});
e.preventDefault();
});
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.4.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
$('dl.update dd').hide();
$('dl.update dt').toggle(
function(e){
if(e.originalTarget === this){