Skip to content

Instantly share code, notes, and snippets.

@jyrkive
jyrkive / (only search action) IdeasController.rb
Created June 25, 2012 08:55
"Invalid query" caused by faceting
def search
@per_page = 20
@page = (params[:page] && params[:page].to_i) || 1
params[:category_filters] ||= {}
all_ideas = Idea.search_tank(params['searchterm'],
:category_filters => params[:category_filters]).select {
|result| result.published?}
@idea_count = all_ideas.length
@jyrkive
jyrkive / gist:3016480
Created June 29, 2012 07:32
db:setup crashes within Tanker
$ rake db:setup --trace
** Invoke db:setup (first_time)
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:create
** Invoke db:schema:load (first_time)
** Invoke environment (first_time)
@jyrkive
jyrkive / Virhe
Created July 2, 2012 10:37
Varoitus: Verkkojen välinen pyyntö
Salattu yhteys: ohittamaton virhe (552)
https://localhost:3000/signatures/1/returning/Alandsbankentesti?B02K_VERS=0002&B02K_TIMESTMP=60020120702133618000001&B02K_IDNBR=0000004296&B02K_STAMP=2012070213343993412&B02K_CUSTNAME=DEMO+ANNA&B02K_KEYVERS=0001&B02K_ALG=03&B02K_CUSTID=010170-960F&B02K_CUSTTYPE=08&B02K_MAC=1909BF6B9FD632116D51D5911E5EBCE5ACFAF2212B2B98EE031DDC03E87F9E14
Opera ei voinut yhdistää palvelimeen, koska palvelin ei käytä mitään Operan tunnistamaa suojattua yhteyskäytäntöä.
@jyrkive
jyrkive / gist:3052668
Created July 5, 2012 09:46
IndexTank::HttpCodeException in Citizens::SessionsController#create
IndexTank::HttpCodeException in Citizens::SessionsController#create
Rails.root: /mnt/data/Avoin Ministerio/avoinministerio
Application Trace | Framework Trace | Full Trace
/usr/share/ruby-rvm/gems/ruby-1.9.3-p125/bundler/gems/tanker-6f0d0cb82560/lib/indextank_client.rb:64:in `execute'
/usr/share/ruby-rvm/gems/ruby-1.9.3-p125/bundler/gems/tanker-6f0d0cb82560/lib/indextank_client.rb:22:in `PUT'
/usr/share/ruby-rvm/gems/ruby-1.9.3-p125/bundler/gems/tanker-6f0d0cb82560/lib/indextank_client.rb:138:in `add_document'
/usr/share/ruby-rvm/gems/ruby-1.9.3-p125/bundler/gems/tanker-6f0d0cb82560/lib/tanker.rb:404:in `update_tank_indexes'
activesupport (3.1.6) lib/active_support/callbacks.rb:401:in `_run_save_callbacks'
@jyrkive
jyrkive / gist:3052779
Created July 5, 2012 10:12
tanker:reindex crashes
$ rake tanker:reindex --trace
** Invoke tanker:reindex (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute tanker:reindex
reindexing all models
Indexing Citizen model
rake aborted!
/usr/share/ruby-rvm/gems/ruby-1.9.3-p125/bundler/gems/tanker-6f0d0cb82560/lib/indextank_client.rb:64:in `execute'
@jyrkive
jyrkive / gist:3083301
Created July 10, 2012 13:40
db:setup crashes within Tanker, again
$ rake db:setup --trace
** Invoke db:setup (first_time)
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:create
** Invoke db:schema:load (first_time)
** Invoke environment (first_time)
@jyrkive
jyrkive / gist:3134916
Created July 18, 2012 07:54
Avoin Ministeriö crashes when a citizen tries to use shortcut_fillin without authentication
3) Idea signing white-box testing the citizen attempts to use shortcut fillin but has not authenticated
Failure/Error: visit signature_idea_shortcut_fillin_path(idea.id)
NameError:
undefined local variable or method `redirect_to_introduction' for #<SignaturesController:0xcab424c>
# ./app/controllers/signatures_controller.rb:318:in `shortcut_fillin'
# ./spec/acceptance/signing/idea_signing_spec.rb:563:in `block (3 levels) in <top (required)>'
@jyrkive
jyrkive / gist:3135209
Created July 18, 2012 09:19
Capybara claims that we are not redirected
3) Idea signing white-box testing the citizen attempts to sign with shortcut_fillin but has not authenticated
Failure/Error: should_be_on signature_idea_introduction(idea.id)
expected: "/ideat/1/introduction"
got: "/signatures/1/shortcut_finalize_signing" (using ==)
# ./spec/acceptance/support/helpers.rb:74:in `should_be_on'
# ./spec/acceptance/signing/idea_signing_spec.rb:590:in `block (3 levels) in <top (required)>'
@jyrkive
jyrkive / It worked when I disabled pull.rebase :)
Created August 8, 2012 07:25
My fork of avoinministerio is not up-to-date but "git push" claims it is
jyrki@Jyrki:/mnt/data/Avoin Ministerio/avoinministerio$ git config pull.rebase false
jyrki@Jyrki:/mnt/data/Avoin Ministerio/avoinministerio$ git pull avoinministerio master
From github.com:avoinministerio/avoinministerio
* branch master -> FETCH_HEAD
Merge made by the 'recursive' strategy.
jyrki@Jyrki:/mnt/data/Avoin Ministerio/avoinministerio$ git push
Counting objects: 7324, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (1786/1786), done.
Writing objects: 100% (7048/7048), 690.64 KiB, done.
@jyrkive
jyrkive / gist:3293306
Created August 8, 2012 08:01
Pulling from upstream fails
jyrki@Jyrki:/mnt/data/Avoin Ministerio/avoinministerio$ git checkout master
Switched to branch 'master'
jyrki@Jyrki:/mnt/data/Avoin Ministerio/avoinministerio$ git pull avoinministerio master
From github.com:avoinministerio/avoinministerio
* branch master -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Applying: Facebook login progess started. Not working yet.
Using index info to reconstruct a base tree...
<stdin>:131: trailing whitespace.