Skip to content

Instantly share code, notes, and snippets.

@pvh
Created May 2, 2012 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pvh/2579956 to your computer and use it in GitHub Desktop.
Save pvh/2579956 to your computer and use it in GitHub Desktop.
module Shogun
module Once
class OnceRecord < Sequel::Model
Sequel.extension :pg_array
DB.extend Sequel::Postgres::PGArray::DatabaseMethods
unrestrict_primary_key
end
def self.ever(*arguments, &blk)
OnceRecord.create(signature: signature(arguments), arguments: arguments.pg_array)
end
def self.signature(*arguments)
signature = arguments.join(' ')
end
end
end
@pvh
Copy link
Author

pvh commented May 2, 2012

ERROR: missing dimension value at character 73
STATEMENT: INSERT INTO "once_records" ("signature", "arguments") VALUES ('sample', '["sample"]') RETURNING *

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment