Assuming you already have a Devise model named User
and you want to add following Devise Security Extension to it
- Password Expirable
- Password Archivable
- Session Limitable
then your User
model should look like following:
User model
Assuming you already have a Devise model named User
and you want to add following Devise Security Extension to it
then your User
model should look like following:
User model
Download http://airdownload.adobe.com/air/lin/download/2.6/AdobeAIRInstaller.bin
Make the .bin file executable
$ chmod a+x AdobeAIRInstaller.bin
Run the .bin file by executing following
Can be useful in generating fake MAC addresses while writing specs for a class which has a MAC address attribute.
FactoryGirl.define do
sequence :mac do |n|
12.times.map { num = (0..15).to_a.sample; num.to_s(16) }.each_slice(2).to_a.map { |arr| arr.join('') }.join(":").upcase
end
end
Note: At the time of writing this the commands shown below were executed on Ubuntu 14.04
Updated .ruby-version
by replacing 2.2.1
WITH 2.2.3
. In case this file is not present, its better to create it.
Updated .ruby-gemset
by replacing <MY_APP_NAME>
WITH <MY_APP_NAME>-on-rails-5
, where <MY_APP_NAME>
represents your app's name. In case this file is not present, its better to create it.
Upgraded rvm
by running command $ rvm get stable
.
Installed latest stable Ruby version listed here using command: $ rvm install 2.2.3
Can be useful in generating random cell numbers while writing specs for a class which has a Cell Number attribute.
FactoryGirl.define do
sequence :cell_number do |n|
# ---------------------------------------- ----------------------
#| SUFFIX PART | | PREFIX PART |
9.times.map { (0..9).to_a.sample }.join("").prepend([7, 8, 9].sample.to_s)
end
end
/config/initializers/omniauth.rb
def provider_facebook
'facebook'
end
def facebook_opts
my_model_obj = MyModelService.find_by_provider_name(provider_facebook)
Host github.com-jiggneshhgohel
HostName github.com
User git
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_work_gmail
AddKeysToAgent yes
Host csexperimental.abc.com
Rails 5.0.0.1
Doorkeeper 4.2.6
Devise 4.2.0
With reference to my comment
I was facing the same situation just recently when made my existing Rails 5 application as an OAuth Provider using Doorkeeper.
rails new <APP_NAME> --database=postgresql --skip-yarn --skip-active-storage --skip-puma --skip-action-cable --skip-spring --skip-listen --skip-coffee --skip-turbolinks --skip-test --skip-system-test --skip-bootsnap --no-rc
Note:
rails new --help