Skip to content

Instantly share code, notes, and snippets.

-diff --git a/app/models/pdf_container.rb b/app/models/pdf_container.rb
-index 7187e3f..a871181 100644
---- a/app/models/pdf_container.rb
-+++ b/app/models/pdf_container.rb
-@@ -133,12 +133,16 @@ class PdfContainer < Variant
- pdf.text picture.title
- pdf.text picture.year
- pdf.text picture.technique
-- pdf.text picture.edition
-+ unless picture.edition.blank?
@ncri
ncri / gist:1322038
Created October 28, 2011 10:28
globalize3 test errors
1) Error:
test_a_translated_attribute_reader_returns_the_correct_translation_for_a_saved_record_after_locale_switching(AttributesTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such column: title: UPDATE "posts" SET "title" = 'Titel' WHERE "posts"."id" = 2
/Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/sqlite3-1.3.4/lib/sqlite3/database.rb:91:in `initialize'
/Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/sqlite3-1.3.4/lib/sqlite3/database.rb:91:in `new'
/Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/sqlite3-1.3.4/lib/sqlite3/database.rb:91:in `prepare'
/Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/sqlite_adapter.rb:227:in `block in exec_query'
/Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract_adapter.rb:244:in `block in log'
/Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/Users/nico/
# ---------------------------------------
# Helpers for creating translated routes
# ---------------------------------------
module RouteTranslation
BASE_LOCALES = [:de, :'de-CH']
URL_PREFIX_LOCALES = [:'fr-CH']
LOCALES = [BASE_LOCALES, URL_PREFIX_LOCALES].flatten
translated_named_route 'advertise', 'site#advertise'
translated_named_route 'userhome', 'users#show'
translated_named_route 'contact', 'contact#index'
translated_named_route 'business_contact', 'contact#business_enquiry'
de-CH:
routes:
advertise: inserieren
userhome: mein_profil
contact: kontakt
business_contact: unternehmen
ActiveRecord::StatementInvalid: PGError: ERROR: column "description" of relation "job_categories" does not exist
LINE 1: UPDATE "job_categories" SET "description" = 'buuuuh', "updat...
^
: UPDATE "job_categories" SET "description" = 'buuuuh', "updated_at" = '2011-12-08 18:09:54.047697' WHERE "job_categories"."id" = 2
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:1003:in `async_exec'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:1003:in `exec_no_cache'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:602:in `block in exec_delete'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract_adapter.rb:244:in `block in log'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/activesuppor
module Coffee
module Rails
class HamlTemplateHandler
def self.haml_handler
@@haml_handler ||= ActionView::Template.registered_template_handler(:haml)
end
def self.call(template)
compiled_source = haml_handler.call(template)
"CoffeeScript.compile(begin;#{compiled_source};end)"
if xyz == 1
do_this y
do_that x
:plain
if xyz == 1
do_this y
do_that x
Delayed::Worker.backend = :active_record
Delayed::Worker.max_attempts = 1
module Delayed
class Worker
# Do num jobs and return stats on success/failure.
# Exit early if interrupted.