base_class.metadata.sorted_tables
.each_value
.select do |value|
models.any? { |model| value.description.include?(model.__tablename__) }
end
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# set the base image to Debian | |
# https://hub.docker.com/_/debian/ | |
FROM debian:latest | |
# replace shell with bash so we can source files | |
RUN rm /bin/sh && ln -s /bin/bash /bin/sh | |
# update the repository sources list | |
# and install dependencies | |
RUN apt-get update \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# check ruby version && rbenv | |
rbenv local | |
# Check last available version of Ruby | |
rbenv install --list | |
# Create app | |
rails _5.1.4_ new appname --database=postgresql | |
# Add pg gem to Gemfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run server | |
./manage.py runserver | |
# Interactive shell | |
./manage.py shell | |
# don't forget to import the objects you need (models, ...) | |
# eg from polls.models import Question, Choice | |
################################# | |
########### Generators ########## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Update files that are already in the index and commit. | |
# == git add . + git commit -m "A message" | |
git commit -a -m "Ajouté itinéraire dans checklist-vacances.md" | |
# Create a new commit to cancel another one. | |
git revert SHACommit | |
# Change last commit message. | |
git commit --amend -m "Votre nouveau message" |
Create a new objet and associate it to a new variable before each scenario
or it
.
let!(:message) { create(:message) } # if used with FactoryGirl, otherwise Message.create(params)
Check if objets have been created
expect { createsomething }.to change{Message.count}.by(20)
#Matchers
expect(page).to have_content 'Success'
expect(page).to have_xpath("//a",:href => "google.com")
expect(page).to have_selector(:xpath, "//p/h1")
expect(page).to have_selector(:css, "p a#post_edit_path")
expect(page).to have_selector("input", :value =>"Post Title")
#Actions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
client = get_client | |
positions = client.profile(:fields => ["positions"]) | |
positions.values # should return a hash with companies, dates and so on. | |
# This is what I did with Devise: | |
# devise.rb | |
config.omniauth :linkedin, ENV['OAUTH_LINKEDIN_ID'], ENV['OAUTH_LINKEDIN_SECRET'], | |
fields: %w(id email-address first-name last-name headline industry picture-url public-profile-url location num-connections positions) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Javascript Cheat Sheet | |
/************************************ | |
*********** DOM: How to... ********* | |
************************************/ | |
// Find an element by its ID | |
document.getElementById("anId"); | |
// Show an element | |
element.show(); |
#Video
##Pré-Production
- brief : 10 points
https://gist.github.com/ManyBaby/aeab61ac281e66fe55df
- script : clair et court
- scénario : détaillé et précis