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
namespace :test_for_stats do | |
desc "Create data for test displaying charts" | |
task create_data: :environment do | |
date = Time.now | |
year = date.strftime("%Y") | |
quarter = date.strftime("%Y")+"Q#{1 + ((date.month - 1) / 3)}" | |
month = date.strftime("%Y%m") | |
week = date.strftime("%Y%V") | |
yesterday = date.yesterday.strftime("%Y%m%d") |
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
desc "V3::Create a group" | |
params do | |
use :group_params | |
requires :send_group_invitation_email, | |
type: Boolean, | |
desc: "Send invitations to group users?" | |
optional :private, type: Boolean, default: false | |
end | |
post do | |
group_params = permitted_params.fetch(:group) |
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 "spec_helper" | |
describe Actions::HR::Groups::AssignMembersGroup, sidekiq: false do | |
let!(:tag_first) { create(:tag) } | |
let!(:tag_second) { create(:tag) } | |
let!(:organization) { create(:organization) } | |
let!(:action_maker) { create(:employee, organization: organization) } | |
let!(:group) { create(:group, organization: organization) } |
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
class CreateUsersPropositions < ActiveRecord::Migration | |
NOW_QUERY = "CAST(NOW() at time zone 'utc' AS timestamp)" | |
def up | |
create_table :widget_to_do_users_propositions do |t| | |
t.integer :user_id | |
t.integer :proposition_id | |
t.timestamps | |
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
class StripeContext | |
class UseCases | |
class HandleWebhook | |
EXPIRES_AT = Time.zone.now + 1.month | |
USER_PREMIUM_EXPIRES_AT = EXPIRES_AT + 1.day | |
CUSTOMER_NAME = "customer".freeze | |
EVENT_TYPES = { | |
"customer.subscription.created" => "created_subscription", | |
"invoice.payment_succeeded" => "continued_subscription", | |
"invoice.payment_failed" => "deleted_subscription", |
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
module Slack | |
module UseCases | |
module Users | |
class Update | |
include Import[user_repository: "repositories.user_repository"] | |
def initialize( | |
slack_api: ::Slack::Services::SlackApi, | |
create_command: ::Slack::Commands::Create, | |
archive_command: ::Slack::Commands::Archive |
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
# frozen_string_literal: true | |
module ProjectApp | |
module Commands | |
module UsersProject | |
class Upsert | |
include Import["interactors.users_project_repository"] | |
def call(params) | |
@params = params |
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
var fs = require('fs'); | |
var formidable = require('formidable'); | |
/* | |
ogólnie fajnie byłoby użyć es5/es6 i np zamiast var używać const i let | |
i import mógłby wyglądać tak | |
import fs from 'fs'; | |
i fs możesz używać normalnie jak z require |