Skip to content

Instantly share code, notes, and snippets.

@bsylvain
bsylvain / error
Last active December 26, 2015 20:58
Failures:
1) BrowseFamilleAndGoods selectionne une famille et affiche les produits
Failure/Error: fill_in "Email", :with => user.email
NoMethodError:
undefined method `fill_in' for #<RSpec::Core::ExampleGroup::Nested_1:0xb68dba4c>
# ./spec/requests/browse_famille_and_goods_spec.rb:8:in `block (2 levels) in <top (required)>'
Finished in 1.17 seconds
1 example, 1 failure
{"utf8"=>"✓",
"authenticity_token"=>"rToM1j1vHSkOpLUFOF0Y9MERqZ27xVUrQrfeOVz2GEE=",
"start_date"=>"01/03/2014",
"end_date"=>"31/03/2014",
"log_type"=>"sales",
"commit"=>"Afficher",
"locale"=>"fr"}
@bsylvain
bsylvain / gist:9808974
Created March 27, 2014 14:38
Haml conditional form
-if current_admin_user.admin
= form_tag copy_produits_backend_path, method: :post do
%table
%tr
%th Nom
%th Resume
%th Famille
%th Illustration
%th Publié
%th
undefined method `each' for "true":String
{"utf8"=>"✓",
"_method"=>"put",
"authenticity_token"=>"TTCSyAiy98vRZOKQDljKlkHYxRiLKBSnhL0iGUVMUq8=",
"shared_produit"=>{"shared"=>"true"},
"commit"=>"Autoriser partage",
"locale"=>"fr",
"produit_id"=>"37"}
-today = Time.now
=today.at_beginning_of_month.strftime("%A")
observatoire du 30/07/2015 par Vincent Coquaz
Malaise chez les chroniqueurs de Jeuxvideo.com
Plusieurs démissions révèlent leur frustration salariale
Voter pour ce contenu
Signaler une faute
Version imprimable
Envoyer à un ami
@bsylvain
bsylvain / error
Last active February 3, 2016 13:16
1) Backend::CustomersController routing effectue l'action show
Failure/Error: get :index
ActionController::RoutingError:
Not Found
# ./app/controllers/backend/application_controller.rb:47:in `not_found'
# ./app/controllers/backend/application_controller.rb:35:in `rescue in current_shop'
# ./app/controllers/backend/application_controller.rb:32:in `current_shop'
# ./app/controllers/backend/application_controller.rb:40:in `scope_current_shop'
# ./spec/controllers/backend/customers_controller_spec.rb:9:in `block (3 levels) in <top (required)>'
= f.semantic_fields_for :this_shop_data_for_user do |dfs|
=dfs.input :specific_id
@bsylvain
bsylvain / example.rb
Created May 23, 2016 10:44
the same query does not act the same depending on if it is used in scope or directly
scope :by_shop_id,->{
joins(:shop_data_for_users).where("shop_data_for_users.shop_id = ? and shop_data_for_users.specific_id= ?",2,'4').first
}
#console :
u = User.by_shop_id
u.count
#SELECT COUNT(*) FROM "users"
u = User.joins(:shop_data_for_users).where("shop_data_for_users.shop_id = ? and shop_data_for_users.specific_id= ?",2,'4').first
# config valid only for current version of Capistrano
lock '3.4.0'
set :application, '*****'
set :rails_env, 'production'
set :repo_url, 'admin@test.**********:/srv/outils/repos/******'
set :scm, :git
# Default branch is :master
# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp