class CommentsController < ApplicationController
def users_comments
posts = Post.all
comments = posts.map(&:comments).flatten
@user_comments = comments.select do |comment|
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
Post.where(...).order(created_at: :desc) |
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
2017-05-11T06:51:15.705Z 11136 TID-oug3atsxw ExportCrossalesUserSidekiqJob JID-7c624fff5139d27bf187fbba INFO: start | |
2017-05-11T06:51:15.893Z 11136 TID-oug3atsxw ExportCrossalesUserSidekiqJob JID-7c624fff5139d27bf187fbba INFO: fail: 0.188 sec | |
2017-05-11T06:51:15.893Z 11136 TID-oug3atsxw WARN: {"class":"ExportCrossalesUserSidekiqJob","args":["[email protected]"],"retry":true,"queue":"default","jid":"7c624fff5139d27bf187fbba","created_at":1494485475.6979861,"enqueued_at":1494485475.699245,"error_message":"No user could be found by email [email protected] and User#crossales_post_to_platforms failed.","error_class":"RuntimeError","failed_at":1494485475.8919208,"retry_count":0} | |
2017-05-11T06:51:15.894Z 11136 TID-oug3atsxw WARN: RuntimeError: No user could be found by email [email protected] and User#crossales_post_to_platforms failed. | |
2017-05-11T06:51:15.894Z 11136 TID-oug3atsxw WARN: /Users/developer/.rvm/gems/ruby-2.1.2@sha/bundler/gems/crossales-6711c8b6386b/app/jobs/export |
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
["USD", 264] | |
["USD", 2651] | |
["USD", 664] | |
["USD", 1281] | |
["USD", 904] | |
["USD", 648] | |
["LVL", 2] | |
["USD", 930] | |
["USD", 1332] | |
["LVL", 999] |
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
# Path to Oh My Fish install. | |
set -gx OMF_PATH "/Users/developer/.local/share/omf" | |
# Customize Oh My Fish configuration path. | |
#set -gx OMF_CONFIG "/Users/developer/.config/omf" | |
source $OMF_PATH/init.fish | |
# Path to your oh-my-fish. | |
set PATH /Applications/Postgres.app/Contents/Versions/9.5/bin $PATH |
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
# for SH | |
{ | |
:users=>7, | |
:users_subbed_at_least_once=>4, | |
:users_renewed_at_least_once=>1, | |
:subscriptions_belonging_to_users=>6, | |
:users_with_unsubscribed_last_subscription=>1, | |
:users_with_terminated_last_subscription=>1, | |
:users_with_at_least_one_upsell_purchase=>2, | |
:upsell_payments_belonging_to_users=>3, |
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
[1] pry(#<#<Class:0x007fa02286da98>>)> params | |
=> {"purchase_offer"=> | |
{"title"=>"New Title", | |
"offer_items_attributes"=> | |
[{"id"=>"364", "main"=>"0"}, | |
{"id"=>"365", "_destroy"=>"1"}, | |
{"purchase_item_id"=>"19", "main"=>"0"}]}, | |
"id"=>"238", | |
"controller"=>"admin/purchase_offers", | |
"action"=>"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
Failures: | |
1) Ryan::Const#name when given a module when the module is namespaced when the module has a const after the module declaration returns the correct module name | |
Failure/Error: expect(Kernel.const_get(subject.name)).to eq Mixins::Helpers | |
NameError: | |
wrong constant name Mixins::Helpers | |
# ./spec/lib/ryan/const_spec.rb:29:in `const_get' | |
# ./spec/lib/ryan/const_spec.rb:29:in `block (6 levels) in <top (required)>' |
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
# in example_gem/lib/example_gem.rb | |
module ExampleGem | |
# ExampleGem.root | |
def self.root | |
current_file_name = __FILE__ | |
path_to_current_file = File.expand_path(current_file_name) | |
# get out of example_gem.rb file and then out of /lib to get to root | |
root_path = Pathname.new(path_to_current_file) + "../.." |
- CPP pusē atrod ordera ID un epastu
- SHA pusē atrod SalesEvent ierakstu, kura Origin ir 1. solī atrastais ID
- Dzēš 2. solī atrasto SalesEvent
- Parūpējas, ka SHA pusē nav Useru, kuru :email vai :origin_email ir tāds, kā iecerētais jaunais epasts
- CPP pusē 1. solī atrastajam Order iestata statusu "new" un samaina epastu uz vajadzīgo
- Tam pašam Order samaina statusu uz "paid", izņem "api processed ķeksi" un saglabā
- Pārliecinās, ka SH pusē ir jauns SalesEvent ar Origin, kas sakrīt ar 1. solī iegūto ID un jaunu user asociāciju