Skip to content

Instantly share code, notes, and snippets.

@all_items = []
@all_items.concat Message.all
@all_items.concat Writeboard.all
@items = {}
@all_items.each do |item|
t = item.created_at
date = Date.new(t.year, t.month, t.day)
if @items.has_key? date
@items[date] << item
else
after_create do
revision = WriteboardRevision.create(:content => self.content, :user_id => self.user_id, :writeboard_id => self.id)
self.update(:current_revision => revision.id)
end
--------------------
>> w = Writeboard.new
=> #<Writeboard @values={}>
>> w.title ="Title"
~ CREATE TABLE `users` (`id` integer PRIMARY KEY AUTO_INCREMENT, `email` string UNIQUE NOT NULL, `username` string UNIQUE NOT NULL, `crypted_password` string(41) NOT NULL, `salt` string(41) NOT NULL, `created_at` datetime, `name` string)
~ ROLLBACK
rake aborted!
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 'string UNIQUE NOT NULL, `username` string UNIQUE NOT NULL, `crypted_password` st' at line 1
# For details on Sequel migrations see
# http://sequel.rubyforge.org/
# http://sequel.rubyforge.org/rdoc/classes/Sequel/Database.html#M000607
class UserMigration < Sequel::Migration
def up
create_table :users do
primary_key :id
string :email, :null => false, :unique => true
~ INSERT INTO `sessions` (`created_at`, `data`, `session_id`) VALUES ('2009-03-15T18:22:51+01:00', {"return_to["/"
flashC: Mash{', 'BAh7CiIJdXNlcmkGIhRjdXJyZW50X3Byb2plY3RvOgxQcm9qZWN0CTobQHJh%0AaXNlX29uX3NhdmVfZmFpbHVyZVQ6DEB2YWx1ZXN7CDoQZGVzY3JpcHRpb24i%0AADoHaWRpBjoKdGl0bGUiCVRlc3Q6EkBhc3NvY2lhdGlvbnN7BjoNbWVzc2Fn%0AZXNbC286DE1lc3NhZ2UIOwd7CzoPcHJvamVjdF9pZGkGOgxjb250ZW50Igl0%0AZXN0Ogx1c2VyX2lkaQY7CWkGOgltb3JlIgZ0OwoiCVRFdGU7C3sGOgxwcm9q%0AZWN0QAg6CUBuZXdGbzsNCDsHews7DmkGOw8iBnc7EGkGOwlpDTsRIgh3d3c7%0ACiIId3d3Owt7BjsSQAg7E0ZvOw0IOwd7CzsOaQY7DyIJVGVzdDsQaQY7CWkO%0AOxEwOwoiCVRlc3Q7C3sGOxJACDsTRm87DQg7B3sLOw5pBjsPIgA7EGkGOwlp%0ADzsRIgA7CiIJYXNkZDsLewY7EkAIOxNGbzsNCDsHews7DmkGOw8iADsQaQY7%0ACWkQOxEiBmQ7CiIKYXNkZGQ7C3sGOxJACDsTRm87DQg7B3sLOw5pBjsPIgA7%0AEGkGOwlpETsRIgA7CiIHcXE7C3sGOxJACDsTRjsTRiIeYXV0aGVudGljYXRp%0Ab25fc3RyYXRlZ2llczAiDnJldHVybl90bzAiCmZsYXNoQzoJTWFzaHsA--175a07d7dcba51b719365b44ae82db7c12d188d6')
merb : worker (port 4000) ~ Could not persist session to Merb::SequelSession: SQLite3::SQLExcep
# This file is specifically setup for use with the merb-auth plugin.
# This file should be used to setup and configure your authentication stack.
# It is not required and may safely be deleted.
#
# To change the parameter names for the password or login field you may set either of these two options
#
Merb::Plugins.config[:"merb-auth"][:login_param] = :username
# Merb::Plugins.config[:"merb-auth"][:password_param] = :my_password_field_name
begin