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 'test_helper' | |
| class CreateShippoTransactionJobTest < ActiveJob::TestCase | |
| test "the truth" do | |
| @order = FactoryGirl.create(:order) | |
| assert_enqueued_with(:job => CreateShippoTransactionJob) do | |
| @shipment = @order.create_shipment! |
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 Shippo::Address < Shippo::TestBase | |
| @@store = {:test => 'Address'} | |
| cattr_reader :store | |
| 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
| Form | |
| employer:belongs_to | |
| name:string | |
| review_required:boolean | |
| signature_required:boolean | |
| Question (has_many :question_answers; multiple choice; text; multiple answer) | |
| text:text | |
| type:string (MultipleAnswerQuestion, MultipleChoiceQuestion, OpenQuestion) | |
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 CollapseLabelsJob < ActiveJob::Base | |
| queue_as :default | |
| def perform(tracking_sheet) | |
| pdf_paths, destination = tracking_sheet.pdf_paths, File.join(Rails.root, "tmp/#{SecureRandom.hex}.pdf") | |
| paths = pdf_paths.map{ |i| open(i).path }.join(' ') | |
| options = "-q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite" |
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
| web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb | |
| worker: bundle exec sidekiq -C config/sidekiq.yml -v -e $RAILS_ENV | |
| web: ~/Sites/api/bin/rails s |
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
| #<HelloSign::Resource::SignatureRequest:0x007fe1d729c640 | |
| @data= | |
| {"signature_request_id"=>"051eb2733453faf3fb0c2703ffd9aaf7237c8df8", | |
| "title"=>"test4", | |
| "original_title"=>"test4", | |
| "subject"=>"test4", | |
| "message"=>nil, | |
| "test_mode"=>true, | |
| "metadata"=>#<HelloSign::Resource::BaseResource:0x007fe1d729c438 @data={}, @raw_data={}>, | |
| "is_complete"=>false, |
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
| $bundle exec rake | |
| Run options: --seed 62924 | |
| # Running: | |
| ................autoprefixer: /home/rof/src/bitbucket.org/sharecoffee/share/app/assets/stylesheets/application.scss:6859:5: Gradient has outdated direction syntax. New syntax is like "to left" instead of "right". | |
| autoprefixer: /home/rof/src/bitbucket.org/sharecoffee/share/app/assets/stylesheets/application.scss:6868:5: Gradient has outdated direction syntax. New syntax is like "to left" instead of "right". | |
| ........................................autoprefixer: /home/rof/src/bitbucket.org/sharecoffee/share/app/assets/stylesheets/coming_soon.scss:6859:5: Gradient has outdated direction syntax. New syntax is like "to left" instead of "right". | |
| autoprefixer: /home/rof/src/bitbucket.org/sharecoffee/share/app/assets/stylesheets/coming_soon.scss:6868:5: Gradient has outdated direction syntax. New syntax is like "to left" instead of "right". |
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 User < ActiveRecord::Base | |
| after_initialize do | |
| def addresses.<<(val) | |
| push(val) | |
| user.save! | |
| end | |
| end | |
| def addresses |
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
| Subscription Load (0.9ms) SELECT "subscriptions".* FROM "subscriptions" WHERE (subscriptions.away @> 'away_action => NULL') | |
| => 0 | |
| Subscription Load (1.2ms) SELECT "subscriptions".* FROM "subscriptions" WHERE (subscriptions.away @> 'away_action => NULL' OR away ? 'away_action') | |
| => 34 | |
| Subscription Load (2.4ms) SELECT "subscriptions".* FROM "subscriptions" WHERE ((away -> 'away_action') IS NULL) | |
| => 140 |
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
| ActiveAdmin.register User do | |
| scope("all", :default => true) | |
| scope("setup a subscription"){ |scope| scope.where("(SELECT COUNT(*) FROM subscriptions WHERE subscriptions.user_id = users.id LIMIT 1) = 1") } | |
| scope("canceled"){ |scope| scope.where(" | |
| (SELECT COUNT(*) FROM subscriptions WHERE subscriptions.user_id = users.id LIMIT 1) = 1 AND | |
| (SELECT COUNT(*) FROM subscriptions WHERE subscriptions.user_id = users.id AND subscriptions.archived_at IS NULL) = 0 | |
| ") } | |
| scope("active"){ |scope| scope.where(:id => Subscription.find_active.select(:user_id)) } | |
| # scope("30 days +"){ |scope| scope.where(:id => Subscription.find_active.where("subscriptions.created_at < ?", 30.days.ago).select(:user_id)) } |