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
[user] | |
name = m-nakamura145 | |
email = masato.nakamura145@gmail.com | |
[color] | |
ui = true | |
diff = auto | |
status = auto | |
branch = auto | |
interactive = auto |
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
[user] | |
name = hoge | |
email = fuga | |
[color] | |
ui = true | |
diff = auto | |
status = auto | |
branch = auto | |
interactive = auto |
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
# | |
# Executes commands at the start of an interactive session. | |
# | |
# Authors: | |
# Sorin Ionescu <sorin.ionescu@gmail.com> | |
# | |
# Source Prezto. | |
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then | |
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" |
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
# コマンドライン引数で指定した店舗IDをデモ利用可能店舗として追加する。 | |
restaurant_id = ARGV[0].to_i | |
raise "invalid restaurant id: #{ARGV[0]}" if restaurant_id.zero? | |
raise "restaurant_id : #{ARGV[0]} not found." unless Restaurant.exists?(restaurant_id) | |
property = SystemProperty.find_by(key: 'demo_restaurants') | |
demo_restaurant_ids = JSON.parse(property.value) | |
if demo_restaurant_ids.include?(restaurant_id) |
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
Restaurant.exists?('hoge') | |
# => Restaurant Exists (4.5ms) SELECT 1 AS one FROM `restaurants` WHERE `restaurants`.`id` = 0 LIMIT 1 |
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
# == Schema Information | |
# | |
# Table name: system_properties | |
# | |
# id :integer not null, primary key | |
# key :string(255) not null | |
# value :text(65535) not null | |
# description :text(65535) | |
# created_at :datetime | |
# updated_at :datetime |
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
require 'worker/base_worker' | |
class OpenRestaurantCsvWorker < BaseWorker | |
sidekiq_options queue: :default, retry: 3 | |
def self.dispatch | |
restaurant_ids = Restaurant.open.pluck(:id) | |
Sidekiq::Client.push_bulk( | |
'queue' => :default, | |
'class' => self, |
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
require 'worker/base_worker' | |
class NotifyVisitedReservationWorker < BaseWorker | |
sidekiq_options queue: :reservation, retry: 3 | |
def perform(reservation_id) | |
reservation = Reservation.find(reservation_id) | |
reservation.notify_visited | |
end | |
end |
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
require 'worker/base_worker' | |
class NotifyCancelledReservationWorker < BaseWorker | |
sidekiq_options queue: :reservation, retry: 3 | |
def perform(reservation_id) | |
reservation = Reservation.find(reservation_id) | |
reservation.notify_cancelled | |
end | |
end |
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
require 'worker/base_worker' | |
class DispatchOpenRestaurantCsvWorker < BaseWorker | |
sidekiq_options queue: :default, retry: 1 | |
def perform | |
OpenRestaurantCsvWorker.dispatch | |
end | |
end |
NewerOlder