Code Monkey home page Code Monkey logo

help_find_back's People

Contributors

inlibra-cpa avatar jimenezmiguela avatar mechamanny avatar olegkolyaka78 avatar saltedseacorn avatar

Watchers

 avatar  avatar  avatar

help_find_back's Issues

Log in with Google, github, facebook (gem omniauth)

OmniAuth is a library that standardizes multi-provider authentication for web applications. It was created to be powerful, flexible, and do as little as possible. Any developer can create strategies for OmniAuth that can authenticate users via disparate systems. OmniAuth strategies have been created for everything from Facebook to LDAP.

In order to use OmniAuth in our applications, we will need to leverage one or more strategies.
One strategy, called Developer, is included with OmniAuth and provides a completely insecure, non-production-usable strategy that directly prompts a user for authentication information and then passes it straight through. We can use it as a placeholder when we start development and easily swap in other strategies later.

Create PR template

Add a PR template to help standardize PRs for easy consumption.

Add checklist to help guide local development and testing.

Switching to Postgresql

Step by step process:
Install PostgreSql: https://www.postgresql.org/download/

gemfile:
add gem 'pg', '~> 1.3', '>= 1.3.5' #or higher versions
remove gem "sqlite"
run bundle

Configure database.yml:
Manually modify our database.yml to add PostgreSQL related configuration:
default: &default
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>

development:
<<: *default
database: sample_development #insert the name of your app instead of "sample"

test:
<<: *default
database: sample_test #insert the name of your app instead of "sample"

production:
<<: *default
database: sample_production #insert the name of your app instead of "sample"
username: sample #insert the name of your app instead of "sample"
password: <%= ENV['SAMPLE_DATABASE_PASSWORD'] %> #insert the name of your app instead of "sample"

console:
Install Postgresql and create a user:
sudo apt install postgresql libpq-dev
sudo su postgres
createuser --interactive
"your_name"
y
exit
Check version of postgresql
pg_config --version
To create another user with a password:
sudo su postgres
createuser --interactive --pwprompt
username
password
y
exit
Set default password for a postgresql user: in this case we set password myPassword for user postgres
sudo -u postgres psql
ALTER USER postgres PASSWORD 'myPassword';
\q
Now you can install the gem and run migrations:
bundle
rails db:create db:migrate #if you are creating new app
rake db:setup db:migrate #if you are switching from sqlite or other db to postgresql
rails s #run your server to see if it works
That’s it!
To use the Rails 6 db system change command, you simply need to specify the new database adapter with the --
to option. #me personally got the error: invalid option: --to=postgresql
rails db:system:change --to=postgresql
rails db:system:change --to=mysql
rails db:system:change --to=sqlite3
rails db:system:change --to=oracle
rails db:system:change --to=frontbase
rails db:system:change --to=sqlserver
rails db:system:change --to=jdbc

Keep in mind, you may need to change the version numbers of the database adapter in your Gemfile after
running this command.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.