This file contains hidden or 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
| AmzLookUp.item_lookup(query:{'ItemId' => 'B000CST01A'}).to_h["ItemLookupResponse"]["Items"]["Item"] | |
| mLookupResponse"]["Items"]["Item"] | |
| => {"ASIN"=>"B000CST01A", | |
| "DetailPageURL"=> | |
| "http://www.amazon.com/LiftMaster-Chamberlain-315MHz-Wireless-377LM/dp/B000CST01A%3FSubscriptionId%3DAKIAI42PXZ2Q3M2SUVBQ%26tag%3Dmborisbeginin-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB000CST01A", | |
| "ItemLinks"=> | |
| {"ItemLink"=> | |
| [{"Description"=>"Technical Details", | |
| "URL"=> | |
| "http://www.amazon.com/LiftMaster-Chamberlain-315MHz-Wireless-377LM/dp/tech-data/B000CST01A%3FSubscriptionId%3DAKIAI42PXZ2Q3M2SUVBQ%26tag%3Dmborisbeginin-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB000CST01A"}, |
This file contains hidden or 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
| MAX_WORKERS_IN_QUEUE = 2000 | |
| def self.get_products | |
| find_each do |result| | |
| wait_for_sidekq | |
| GetProductsWorker.perform_async(result.id) | |
| end | |
| end | |
| def self.wait_for_sidekq |
This file contains hidden or 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
| DEPRECATION WARNING: [Devise] config.email_regexp will have a new default on Devise 4.1 | |
| To keep the current behavior please set in your config/initializers/devise.rb the following: | |
| Devise.setup do |config| | |
| config.email_regexp = /\A[^@\s]+@([^@\s]+\.)+[^@\W]+\z/ | |
| end | |
| If you want to use the new default: | |
| Devise.setup do |config| |
This file contains hidden or 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
| <%= message.subject %> | |
| <%= message.render_body.html_safe %> | |
| <%= message.published_at%> | |
This file contains hidden or 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
| require 'rails_helper' | |
| describe "the signin process", :type => :feature do | |
| before :each do | |
| AdminUser.create(:email => 'user@example.com', :password => 'password') | |
| end | |
| let(:sign_in) { visit '/admin' | |
| within("#session_new") do | |
| fill_in 'Email', :with => 'user@example.com' | |
| fill_in 'Password', :with => 'password' |
This file contains hidden or 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
| require 'rails_helper' | |
| describe History ,type: :model do | |
| let(:member){ create(:member) } | |
| let(:channel){ create(:channel) } | |
| let(:create_sub){create(:subscription )} | |
| it 'should be created after subscribe' do | |
| expect{create_sub}.to change{History.count}.by(1) | |
| end |
This file contains hidden or 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
| class CreatePermissions < ActiveRecord::Migration | |
| def change | |
| create_table :permissions do |t| | |
| t.integer :publisher_id | |
| t.integer :channel_id | |
| t.timestamps null: false | |
| end | |
| end | |
| end |
This file contains hidden or 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
| # == Schema Information | |
| # | |
| # Table name: users | |
| # | |
| # *id*:: <tt>integer, not null, primary key</tt> | |
| # *email*:: <tt>string, default(""), not null</tt> | |
| # *encrypted_password*:: <tt>string, default(""), not null</tt> | |
| # *reset_password_token*:: <tt>string</tt> | |
| # *reset_password_sent_at*:: <tt>datetime</tt> | |
| # *remember_created_at*:: <tt>datetime</tt> |
This file contains hidden or 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
| #require 'rubygems' | |
| #require 'Celerity' | |
| require 'nokogiri' | |
| require 'watir-webdriver' | |
| require "open-uri" | |
| #b.goto 'bit.ly/watir-webdriver-demo' | |
| #b.text_field(:id => 'entry_1000000').set 'your name' | |
| #b.select_list(:id => 'entry_1000001').select 'Ruby' | |
| #b.select_list(:id => 'entry_1000001').selected? 'Ruby' |
This file contains hidden or 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
| # be sure to comment out the require 'capistrano/deploy' line in your Capfile! | |
| # config valid only for Capistrano 3.1 | |
| lock '3.2.1' | |
| set :application, 'my-cool-application' | |
| # the base docker repo reference | |
| set :name, "johns-stuff/#{fetch(:application)}" |