source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | spec/services/admin/requests/volunteer_assigner_spec.rb | Ruby | mit | 19 | master | 1,587 | require 'rails_helper'
describe Admin::Requests::VolunteerAssigner do
before(:all) { I18n.locale = :cs }
describe '#perform' do
let(:volunteer) { create :volunteer }
let(:user) { create :user }
let(:request) { create :request }
let(:organisation_group) { create :organisation_group }
before do... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | spec/services/sms_service/manager_spec.rb | Ruby | mit | 19 | master | 1,156 | require 'rails_helper'
describe SmsService::Manager do
before(:all) { I18n.locale = :cs }
context '.send_welcome_msg' do
let(:standard_text) { I18n.t 'sms.welcome' }
let(:partner_text) { I18n.transliterate I18n.t('sms.welcome_channel', group_name: 'Clovek', group_slug: 'clovek') }
let(:group) ... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | spec/services/messaging_service/outgoing_message_spec.rb | Ruby | mit | 19 | master | 2,027 | require 'rails_helper'
describe MessagingService::OutgoingMessage do
before(:all) { I18n.locale = :cs }
let(:message) { create :message, text: 'foobar' }
let(:outgoing_message) { MessagingService::OutgoingMessage.new message }
describe '#text' do
it 'contains creator signature if present' do
allow(o... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | spec/services/messaging_service/callbacks_spec.rb | Ruby | mit | 19 | master | 5,367 | require 'rails_helper'
require 'support/messaging_service_helper'
describe MessagingService::Callbacks do
include MessagingServiceHelper
before(:all) { I18n.locale = :cs }
let(:requested_volunteer) { create :requested_volunteer }
let(:volunteer) { requested_volunteer.volunteer }
let(:request) { requested_vo... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | spec/services/api/volunteer/update_profile_spec.rb | Ruby | mit | 19 | master | 1,066 | require 'rails_helper'
describe Api::Volunteer::UpdateProfile do
describe '#perform' do
let(:volunteer) { create :volunteer, first_name: 'Foo', last_name: 'Bar', email: 'foo@bar.baz', description: nil }
let(:volunteer_data) do
{ first_name: 'Test',
last_name: 'Testic',
email: 'test@test... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | spec/services/api/volunteer/register_spec.rb | Ruby | mit | 19 | master | 1,405 | require 'rails_helper'
require 'support/geocoder_helper'
describe Api::Volunteer::Register do
include GeocoderHelper
before(:all) { I18n.locale = :cs }
describe '#perform' do
let(:volunteer) { create :volunteer_not_registered }
let(:volunteer_data) do
{ first_name: 'Test',
last_name: 'Test... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | spec/services/api/volunteer/update_preferences_spec.rb | Ruby | mit | 19 | master | 736 | require 'rails_helper'
describe Api::Volunteer::UpdatePreferences do
describe '#perform' do
let(:volunteer) { create :volunteer }
let(:volunteer_data) do
{ notifications_to_app: true,
sound: false }
end
it 'updates volunteer preferences' do
expect { Api::Volunteer::UpdatePreferen... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | spec/services/geography/point_spec.rb | Ruby | mit | 19 | master | 778 | require 'rails_helper'
describe Geography::Point do
context '#from_coordinates' do
it 'creates geo point with passed values' do
latitude = 50.0941811
longitude = 14.4548664
point = Geography::Point.from_coordinates longitude: longitude, latitude: latitude
expect(point.latitude).to eq lat... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | spec/services/common/request/response_processor_spec.rb | Ruby | mit | 19 | master | 5,268 | require 'rails_helper'
describe Common::Request::ResponseProcessor do
before(:all) { I18n.locale = :cs }
describe '#perform' do
let(:requested_volunteer) { create :requested_volunteer }
let(:request) { requested_volunteer.request }
let(:volunteer) { requested_volunteer.volunteer }
let(:different_r... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/seeds.rb | Ruby | mit | 19 | master | 5,226 | return unless Rails.env.development?
# create super admin
admin = SeedHelper.create_super_admin email: 'admin@example.com', password: 'password', first_name: 'Iva', last_name: 'Červená'
# seed groups and organisations
organisation1 = SeedHelper.create_organisation name: 'Oblastni charita',
... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200316153958_add_personal_information_to_users.rb | Ruby | mit | 19 | master | 203 | class AddPersonalInformationToUsers < ActiveRecord::Migration[6.0]
def change
add_column :users, :first_name, :string, null: false
add_column :users, :last_name, :string, null: false
end
end |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200316074801_create_active_admin_comments.rb | Ruby | mit | 19 | master | 414 | class CreateActiveAdminComments < ActiveRecord::Migration[6.0]
def self.up
create_table :active_admin_comments do |t|
t.string :namespace
t.text :body
t.references :resource, polymorphic: true
t.references :author, polymorphic: true
t.timestamps
end
add_index :active_admin_... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200330065010_rpush_3_3_1_updates.rb | Ruby | mit | 19 | master | 482 | class Rpush331Updates < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0] : ActiveRecord::Migration
def self.up
change_column :rpush_notifications, :device_token, :string, null: true
change_column :rpush_feedback, :device_token, :string, null: true
end
def self.down
change_column :rpus... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200319161703_create_labels.rb | Ruby | mit | 19 | master | 208 | class CreateLabels < ActiveRecord::Migration[6.0]
def change
create_table :labels do |t|
t.string :name
t.string :description
t.references :group
t.timestamps
end
end
end |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20201018175340_create_skills.rb | Ruby | mit | 19 | master | 492 | class CreateSkills < ActiveRecord::Migration[6.0]
def change
create_table :skills do |t|
t.string :name, null: false
t.string :code, null: false
t.timestamps
end
reversible do |dir|
dir.up do
['řidičský průkaz B', 'všeobecná sestra', 'ošetřovatel/ošetřovatelka', 'sanitář'... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200330065003_rpush_3_0_0_updates.rb | Ruby | mit | 19 | master | 445 | class Rpush300Updates < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0] : ActiveRecord::Migration
def self.up
add_column :rpush_notifications, :mutable_content, :boolean, default: false
change_column :rpush_notifications, :sound, :string, default: nil
end
def self.down
remove_column ... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200322094137_create_requested_volunteers.rb | Ruby | mit | 19 | master | 469 | class CreateRequestedVolunteers < ActiveRecord::Migration[6.0]
def change
create_table :requested_volunteers do |t|
t.references :volunteer, null: false, foreign_key: true
t.references :request, null: false, foreign_key: true
t.integer :state, null: false, default: 1
t.datetime :last_notif... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200330065005_rpush_3_1_0_add_pushy.rb | Ruby | mit | 19 | master | 301 | class Rpush310AddPushy < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0] : ActiveRecord::Migration
def self.up
add_column :rpush_notifications, :external_device_id, :string, null: true
end
def self.down
remove_column :rpush_notifications, :external_device_id
end
end |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20201018175934_add_other_skills_and_interests_to_volunteers.rb | Ruby | mit | 19 | master | 204 | class AddOtherSkillsAndInterestsToVolunteers < ActiveRecord::Migration[6.0]
def change
add_column :volunteers, :other_skills, :string
add_column :volunteers, :other_interests, :string
end
end |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200330065006_rpush_3_1_1_updates.rb | Ruby | mit | 19 | master | 664 | class Rpush311Updates < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0] : ActiveRecord::Migration
def self.up
change_table :rpush_notifications do |t|
t.remove_index name: 'index_rpush_notifications_multi'
t.index [:delivered, :failed, :processing, :deliver_after, :created_at], name: ... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20201021145736_add_unread_messages_count_to_requested_volunteers.rb | Ruby | mit | 19 | master | 389 | class AddUnreadMessagesCountToRequestedVolunteers < ActiveRecord::Migration[6.0]
def change
add_column :requested_volunteers, :unread_incoming_messages_count, :integer, null: false, default: 0
reversible do |dir|
dir.up do
RequestedVolunteer.all.each { |rv| rv.update unread_incoming_messages_co... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200318113649_create_requests.rb | Ruby | mit | 19 | master | 813 | # frozen_string_literal: true
class CreateRequests < ActiveRecord::Migration[6.0]
def change
create_table :requests do |t|
t.references :created_by, null: false, references: :users
t.references :closed_by, references: :users
t.references :coordinator, references: :users
t.references :orga... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20201018175319_create_interests.rb | Ruby | mit | 19 | master | 526 | class CreateInterests < ActiveRecord::Migration[6.0]
def change
create_table :interests do |t|
t.string :name, null: false
t.string :code, null: false
t.string :description
t.timestamps
end
reversible do |dir|
dir.up do
['asistence pro invalidy', 'dovoz a donáška', ... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20201123101124_add_volunteer_feedback_attributes_to_organisations.rb | Ruby | mit | 19 | master | 265 | class AddVolunteerFeedbackAttributesToOrganisations < ActiveRecord::Migration[6.0]
def change
add_column :organisations, :volunteer_feedback_message, :string, default: nil
add_column :organisations, :volunteer_feedback_send_after_days, :integer
end
end |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200313185312_add_attributes_to_volunteer.rb | Ruby | mit | 19 | master | 324 | class AddAttributesToVolunteer < ActiveRecord::Migration[6.0]
def change
add_column :volunteers, :email, :string, null: false
add_column :volunteers, :confirmation_code, :string, length: 6
add_column :volunteers, :confirmation_valid_to, :datetime
add_column :volunteers, :confirmed_at, :datetime
end
... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200330065009_rpush_3_3_0_updates.rb | Ruby | mit | 19 | master | 282 | class Rpush330Updates < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0] : ActiveRecord::Migration
def self.up
add_column :rpush_notifications, :thread_id, :string, null: true
end
def self.down
remove_column :rpush_notifications, :thread_id
end
end |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200330065007_rpush_3_2_0_add_apns_p8.rb | Ruby | mit | 19 | master | 566 | class Rpush320AddApnsP8 < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0] : ActiveRecord::Migration
def self.up
add_column :rpush_apps, :apn_key, :string, null: true
add_column :rpush_apps, :apn_key_id, :string, null: true
add_column :rpush_apps, :team_id, :string, null: true
add_colu... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200319121816_create_organisation_groups_.rb | Ruby | mit | 19 | master | 389 | class CreateOrganisationGroups < ActiveRecord::Migration[6.0]
def change
create_table :organisation_groups do |t|
t.references :group, null: false, foreign_key: true, index: false
t.references :organisation, null: false, foreign_key: true, index: false
t.timestamps
end
add_index :organ... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200313145528_create_volunteers.rb | Ruby | mit | 19 | master | 362 | class CreateVolunteers < ActiveRecord::Migration[6.0]
def change
create_table :volunteers do |t|
t.string :first_name, null: false
t.string :last_name, null: false
t.string :phone, null: false
t.string :street, null: false
t.string :city, null: false
t.string :zipcode, null: fa... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200330065004_rpush_3_0_1_updates.rb | Ruby | mit | 19 | master | 573 | class Rpush301Updates < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0] : ActiveRecord::Migration
def self.up
change_column_null :rpush_notifications, :mutable_content, false
change_column_null :rpush_notifications, :content_available, false
change_column_null :rpush_notifications, :alert... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20201018175424_create_volunteer_skills.rb | Ruby | mit | 19 | master | 272 | class CreateVolunteerSkills < ActiveRecord::Migration[6.0]
def change
create_table :volunteer_skills do |t|
t.references :volunteer, null: false, foreign_key: true
t.references :skill, null: false, foreign_key: true
t.timestamps
end
end
end |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20201210081951_add_partner_signup_fields_to_group.rb | Ruby | mit | 19 | master | 255 | class AddPartnerSignupFieldsToGroup < ActiveRecord::Migration[6.0]
def change
add_column :groups, :signup_partial_name, :string
add_column :groups, :signup_cta_button_text, :string
add_column :groups, :signup_tagline_text, :string
end
end |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20201112090825_create_location_subscription.rb | Ruby | mit | 19 | master | 210 | class CreateLocationSubscription < ActiveRecord::Migration[6.0]
def change
create_table :location_subscriptions do |t|
t.integer :distance
t.string :phone
t.timestamps
end
end
end |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200319193556_create_group_volunteers.rb | Ruby | mit | 19 | master | 467 | class CreateGroupVolunteers < ActiveRecord::Migration[6.0]
def change
create_table :group_volunteers do |t|
t.references :group, null: false, foreign_key: true
t.references :volunteer, null: false, foreign_key: true
t.integer :recruitment_status
t.integer :source
t.boolean :is_exclus... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200316080621_rolify_create_roles.rb | Ruby | mit | 19 | master | 441 | class RolifyCreateRoles < ActiveRecord::Migration[6.0]
def change
create_table(:roles) do |t|
t.string :name
t.references :resource, :polymorphic => true
t.timestamps
end
create_table(:users_roles, :id => false) do |t|
t.references :user
t.references :role
end
... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200330065012_rpush_4_1_1_updates.rb | Ruby | mit | 19 | master | 344 | class Rpush411Updates < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration["#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}"] : ActiveRecord::Migration
def self.up
add_column :rpush_apps, :feedback_enabled, :boolean, default: true
end
def self.down
remove_column :rpush_apps, :fee... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200315214932_add_better_geo_into_volunteer.rb | Ruby | mit | 19 | master | 514 | class AddBetterGeoIntoVolunteer < ActiveRecord::Migration[6.0]
def change
change_column_null :volunteers, :zipcode, true
add_column :volunteers, :street_number, :string, null: false
add_column :volunteers, :city_part, :string, null: false
add_column :volunteers, :geo_entry_id, :string, null: false
... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20201123100940_create_requested_volunteer_feedback.rb | Ruby | mit | 19 | master | 247 | class CreateRequestedVolunteerFeedback < ActiveRecord::Migration[6.0]
def change
create_table :requested_volunteer_feedbacks do |t|
t.references :requested_volunteer, null: false, foreign_key: true
t.timestamps
end
end
end |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200316074755_devise_create_users.rb | Ruby | mit | 19 | master | 1,401 | # frozen_string_literal: true
class DeviseCreateUsers < ActiveRecord::Migration[6.0]
def change
create_table :users do |t|
## Database authenticatable
t.string :email, null: false, default: ""
t.string :encrypted_password, null: false, default: ""
## Recoverable
t.stri... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200328124851_create_messages.rb | Ruby | mit | 19 | master | 641 | class CreateMessages < ActiveRecord::Migration[6.0]
def change
create_table :messages do |t|
# References
t.references :volunteer, null: true, foreign_key: true
t.references :created_by, null: true, foreign_key: { to_table: :users }
t.references :request, foreign_key: true
# Non-nul... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200330064959_rpush_2_0_0_updates.rb | Ruby | mit | 19 | master | 3,106 | class Rpush200Updates < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0] : ActiveRecord::Migration
module Rpush
class App < ActiveRecord::Base
self.table_name = 'rpush_apps'
end
class Notification < ActiveRecord::Base
self.table_name = 'rpush_notifications'
end
end
de... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200330065008_rpush_3_2_4_updates.rb | Ruby | mit | 19 | master | 282 | class Rpush324Updates < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0] : ActiveRecord::Migration
def self.up
change_column :rpush_apps, :apn_key, :text, null: true
end
def self.down
change_column :rpush_apps, :apn_key, :string, null: true
end
end |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200331095042_add_default_flag_to_address.rb | Ruby | mit | 19 | master | 581 | class AddDefaultFlagToAddress < ActiveRecord::Migration[6.0]
def change
add_column :addresses, :default, :boolean
Address.reset_column_information
reversible do |dir|
dir.up do
Address.where('addresses.id IN (SELECT MAX(addresses.id) from addresses GROUP BY addressable_id)')
... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200325100626_add_auth_code_to_volunteer.rb | Ruby | mit | 19 | master | 275 | class AddAuthCodeToVolunteer < ActiveRecord::Migration[6.0]
def change
add_column :volunteers, :authorization_code, :string
add_column :volunteers, :authorization_code_valid_to, :datetime
add_column :volunteers, :authorization_code_attempts, :integer
end
end |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200330064958_add_rpush.rb | Ruby | mit | 19 | master | 16,891 | # NOTE TO THE CURIOUS.
#
# Congratulations on being a diligent developer and vetting the migrations
# added to your project!
#
# You're probably thinking "This migration is huge!". It is, but that doesn't
# mean it'll take a long time to run, or that the reason for it being
# this size is because of lousy developers.
#... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200408101640_create_news.rb | Ruby | mit | 19 | master | 273 | class CreateNews < ActiveRecord::Migration[6.0]
def change
create_table :news do |t|
t.string :title, null: false
t.text :body
t.integer :publication_type, null: false
t.string :url
t.string :outlet
t.timestamps
end
end
end |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200330065001_rpush_2_6_0_updates.rb | Ruby | mit | 19 | master | 304 | class Rpush260Updates < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0] : ActiveRecord::Migration
def self.up
add_column :rpush_notifications, :content_available, :boolean, default: false
end
def self.down
remove_column :rpush_notifications, :content_available
end
end |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200330065013_rpush_4_2_0_updates.rb | Ruby | mit | 19 | master | 370 | class Rpush420Updates < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration["#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}"] : ActiveRecord::Migration
def self.up
add_column :rpush_notifications, :sound_is_json, :boolean, null: true, default: false
end
def self.down
remove_colum... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200321111028_create_volunteer_label.rb | Ruby | mit | 19 | master | 330 | class CreateVolunteerLabel < ActiveRecord::Migration[6.0]
def change
create_table :volunteer_labels do |t|
t.references :volunteer, null: false, foreign_key: true
t.references :label, null: false, foreign_key: true
t.references :created_by, null: false, foreign_key: { to_table: :users }
end
... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200330065000_rpush_2_1_0_updates.rb | Ruby | mit | 19 | master | 396 | class Rpush210Updates < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0] : ActiveRecord::Migration
def self.up
add_column :rpush_notifications, :url_args, :text, null: true
add_column :rpush_notifications, :category, :string, null: true
end
def self.down
remove_column :rpush_notificat... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200316172737_extract_address_from_volunteer.rb | Ruby | mit | 19 | master | 1,494 | # frozen_string_literal: true
class ExtractAddressFromVolunteer < ActiveRecord::Migration[6.0]
def change
enable_extension 'postgis'
create_table :addresses do |t|
t.string :street, null: true
t.string :street_number, null: false
t.string :city, null: false
t.string :city_part, null:... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20201210103031_add_public_flag_to_volunteer.rb | Ruby | mit | 19 | master | 324 | class AddPublicFlagToVolunteer < ActiveRecord::Migration[6.0]
def change
add_column :volunteers, :is_public, :boolean, null: true, default: true
reversible do |dir|
dir.up do
Volunteer.joins(:group_volunteers).merge(GroupVolunteer.exclusive).update_all(is_public: false)
end
end
end
... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20201108202720_relax_requests_null_constraints.rb | Ruby | mit | 19 | master | 519 | class RelaxRequestsNullConstraints < ActiveRecord::Migration[6.0]
def change
add_column :requests, :source, :integer, default: 1
reversible do |dir|
dir.up do
change_column :requests, :created_by_id, :integer, null: true
change_column :requests, :organisation_id, :integer, null: true
... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20201018175412_create_volunteer_interests.rb | Ruby | mit | 19 | master | 281 | class CreateVolunteerInterests < ActiveRecord::Migration[6.0]
def change
create_table :volunteer_interests do |t|
t.references :volunteer, null: false, foreign_key: true
t.references :interest, null: false, foreign_key: true
t.timestamps
end
end
end |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200323074614_lookup_invalid_coordinates.rb | Ruby | mit | 19 | master | 791 | class LookupInvalidCoordinates < ActiveRecord::Migration[6.0]
def change
reversible do |dir|
dir.up do
ActiveRecord::Base.transaction do
invalid_addresses.each { |address| fix_coordinate(address) if address.addressable.present? }
end
end
end
end
private
def invali... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200330065011_rpush_4_1_0_updates.rb | Ruby | mit | 19 | master | 358 | class Rpush410Updates < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration["#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}"] : ActiveRecord::Migration
def self.up
add_column :rpush_notifications, :dry_run, :boolean, null: false, default: false
end
def self.down
remove_column :rp... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200316095347_create_organisations.rb | Ruby | mit | 19 | master | 402 | class CreateOrganisations < ActiveRecord::Migration[6.0]
def change
create_table :organisations do |t|
t.string :name, null: false
t.string :abbreviation, null: false
t.string :business_id_number
t.string :contact_person, null: false
t.string :contact_person_phone, null: false
... |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200319070050_create_groups.rb | Ruby | mit | 19 | master | 201 | class CreateGroups < ActiveRecord::Migration[6.0]
def change
create_table :groups do |t|
t.string :name, null: false
t.string :slug, null: false
t.timestamps
end
end
end |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20201021113201_add_exclusive_volunteers_flag_to_groups.rb | Ruby | mit | 19 | master | 250 | class AddExclusiveVolunteersFlagToGroups < ActiveRecord::Migration[6.0]
def change
# Indicates if volunteer sign-ed up through group url is exclusive or not
add_column :groups, :exclusive_volunteer_signup, :boolean, default: true
end
end |
github | Applifting/pomuzeme.si | https://github.com/Applifting/pomuzeme.si | db/migrate/20200330065002_rpush_2_7_0_updates.rb | Ruby | mit | 19 | master | 385 | class Rpush270Updates < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0] : ActiveRecord::Migration
def self.up
change_column :rpush_notifications, :alert, :text
add_column :rpush_notifications, :notification, :text
end
def self.down
change_column :rpush_notifications, :alert, :string
... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/work-md.gemspec | Ruby | mit | 19 | master | 1,186 | # frozen_string_literal: true
require_relative 'lib/work/md/version'
Gem::Specification.new do |spec|
spec.name = 'work-md'
spec.version = Work::Md::VERSION
spec.authors = ['Henrique Fernandez Teixeira']
spec.email = ['hriqueft@gmail.com']
spec.summary = 'Track your work ... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/Gemfile | Ruby | mit | 19 | master | 333 | # frozen_string_literal: true
source 'https://rubygems.org'
ruby '2.4.10'
# Specify your gem's dependencies in work-md.gemspec
gemspec
group :test, :development do
gem 'byebug'
gem 'fakefs', require: 'fakefs/safe'
gem 'rake', '~> 13.0'
gem 'rspec', '~> 3.0'
gem 'rubocop', '~> 0.80'
gem 'rubocop-ast', '~... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/lib/work/md.rb | Ruby | mit | 19 | master | 862 | # frozen_string_literal: true
require_relative 'md/version'
require_relative 'md/config'
require_relative 'md/file'
require_relative 'md/date_file'
require_relative 'md/commands/today'
require_relative 'md/commands/config'
require_relative 'md/commands/yesterday'
require_relative 'md/commands/tomorrow'
require_relativ... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/lib/work/md/config.rb | Ruby | mit | 19 | master | 2,114 | # frozen_string_literal: true
require 'yaml'
module Work
module Md
module Config
DEFAULT_WORK_DIR = "#{Dir.home}/work-md"
TRANSLATIONS = {
'pt' =>
{
tasks: 'Atividades',
meetings: 'Reuniões',
interruptions: 'Interrupções',
difficultie... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/lib/work/md/file.rb | Ruby | mit | 19 | master | 2,851 | # frozen_string_literal: true
module Work
module Md
class File
def self.create_and_open_parsed(parser)
parser.freeze
parsed_file_path = "#{Work::Md::Config.work_dir}/parsed.md"
t = Work::Md::Config.translations
::File.delete(parsed_file_path) if ::File.exist? parsed_file_p... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/lib/work/md/cli.rb | Ruby | mit | 19 | master | 2,627 | # frozen_string_literal: true
module Work
module Md
module Cli
class CommandMissing < RuntimeError; end
ALIAS_COMMANDS =
{
't' => 'today',
'ty' => 'tyesterday',
'y' => 'yesterday',
'to' => 'tomorrow',
'c' => 'config',
'p' => 'parse'... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/lib/work/md/date_file.rb | Ruby | mit | 19 | master | 2,812 | # frozen_string_literal: true
module Work
module Md
class DateFile
def self.open_or_create(some_date)
Work::Md::File.open_in_editor(
[create_if_not_exist(some_date)]
)
end
def self.list_file_paths_by_argv_query(argv, create_inexistent: false)
file_paths = []
... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/lib/work/md/commands/yesterday.rb | Ruby | mit | 19 | master | 274 | # frozen_string_literal: true
module Work
module Md
module Commands
class Yesterday
class << self
def execute(_argv = [])
Work::Md::DateFile.open_or_create(Date.today.prev_day)
end
end
end
end
end
end |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/lib/work/md/commands/tlast.rb | Ruby | mit | 19 | master | 731 | # frozen_string_literal: true
module Work
module Md
module Commands
class Tlast
class << self
def execute(_argv = [])
last_date = Date.today.prev_day
work_dir = Work::Md::Config.work_dir
last_file_name = nil
(1..160).each do
l... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/lib/work/md/commands/tyesterday.rb | Ruby | mit | 19 | master | 431 | # frozen_string_literal: true
module Work
module Md
module Commands
class Tyesterday
class << self
def execute(_argv = [])
file_names =
[DateTime.now, Date.today.prev_day].map do |date|
Work::Md::DateFile.create_if_not_exist(date)
en... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/lib/work/md/commands/tomorrow.rb | Ruby | mit | 19 | master | 273 | # frozen_string_literal: true
module Work
module Md
module Commands
class Tomorrow
class << self
def execute(_argv = [])
Work::Md::DateFile.open_or_create(Date.today.next_day)
end
end
end
end
end
end |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/lib/work/md/commands/open.rb | Ruby | mit | 19 | master | 1,524 | # frozen_string_literal: true
module Work
module Md
module Commands
class Open
class << self
def execute(argv = [])
file_paths =
Work::Md::DateFile.list_file_paths_by_argv_query(
argv,
create_inexistent: true
)
... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/lib/work/md/commands/plast.rb | Ruby | mit | 19 | master | 1,893 | # frozen_string_literal: true
module Work
module Md
module Commands
class Plast
class << self
def execute(argv = [])
is_numeric = ->(str) {
str == "#{str.to_f}" || str == "#{str.to_i}"
}
if is_numeric.(argv.first)
last_n = a... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/lib/work/md/commands/last.rb | Ruby | mit | 19 | master | 2,213 | # frozen_string_literal: true
module Work
module Md
module Commands
class Last
class << self
def execute(argv = [])
work_dir = Work::Md::Config.work_dir
if argv == []
current_day = Date.today.prev_day
found_file = false
(... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/lib/work/md/commands/delete.rb | Ruby | mit | 19 | master | 1,639 | # frozen_string_literal: true
module Work
module Md
module Commands
class Delete
class << self
def execute(argv = [])
prompt = TTY::Prompt.new
file_paths = Work::Md::DateFile.list_file_paths_by_argv_query(argv)
if file_paths == []
puts :... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/lib/work/md/commands/annotations.rb | Ruby | mit | 19 | master | 566 | # frozen_string_literal: true
module Work
module Md
module Commands
class Annotations
class << self
def execute(_argv = [])
file_name = 'annotations.md'
work_dir = Work::Md::Config.work_dir
::FileUtils.mkdir_p(work_dir.to_s)
unless ::File.... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/lib/work/md/commands/today.rb | Ruby | mit | 19 | master | 263 | # frozen_string_literal: true
module Work
module Md
module Commands
class Today
class << self
def execute(_argv = [])
Work::Md::DateFile.open_or_create(DateTime.now)
end
end
end
end
end
end |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/lib/work/md/commands/parse.rb | Ruby | mit | 19 | master | 1,417 | # frozen_string_literal: true
module Work
module Md
module Commands
class Parse
class << self
def execute(argv = [])
parser = Work::Md::Parser::Engine.new
Work::Md::DateFile
.list_file_paths_by_argv_query(argv)
.each { |file_path| parse... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/lib/work/md/commands/config.rb | Ruby | mit | 19 | master | 1,037 | # frozen_string_literal: true
module Work
module Md
module Commands
class Config
class << self
def execute(_argv = [])
file_name = 'config.yml'
work_dir = ::Work::Md::Config::DEFAULT_WORK_DIR
unless ::File.exist?("#{work_dir}/#{file_name}")
... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/lib/work/md/commands/daily.rb | Ruby | mit | 19 | master | 2,320 | # frozen_string_literal: true
module Work
module Md
module Commands
class Daily
class << self
def execute(_argv = [])
last_date = Date.today.prev_day
work_dir = Work::Md::Config.work_dir
last_file_name = nil
(1..160).each do
l... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/lib/work/md/parser/engine.rb | Ruby | mit | 19 | master | 7,415 | # frozen_string_literal: true
require 'date'
module Work
module Md
module Parser
class Error < StandardError; end
# rubocop:disable Metrics/ClassLength
class Engine
IS_FROZEN_ERROR_MESSAGE = 'Work::Md::Parser::Engine is frozen'
IS_NOT_FROZEN_ERROR_MESSAGE = 'Work::Md::Parser::... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/spec/spec_helper.rb | Ruby | mit | 19 | master | 966 | # frozen_string_literal: true
require "./spec/helpers"
require "byebug"
require "fileutils"
require "work/md"
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
# Disable RSpec exposing methods globally on `Module` an... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/spec/work/md/date_file_spec.rb | Ruby | mit | 19 | master | 3,057 | # frozen_string_literal: true
require 'fileutils'
RSpec.describe Work::Md::DateFile do
context 'open or creating a file' do
let(:some_date) { DateTime.now }
after do
FileUtils.rm_rf(test_work_dir)
ENV['EDITOR'] = nil
end
let(:expected_md_file) { "#{Work::Md::Config.work_dir}/#{some_dat... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/spec/work/md/file_spec.rb | Ruby | mit | 19 | master | 3,115 | # frozen_string_literal: true
require 'fileutils'
RSpec.describe Work::Md::File do
context 'opening the md file in the work dir' do
let(:file_name) { Work::Md::DateFile.create_if_not_exist(some_date) }
let(:some_date) { DateTime.now }
after do
FileUtils.rm_rf(test_work_dir)
ENV['EDITOR'] = ... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/spec/work/md/cli_spec.rb | Ruby | mit | 19 | master | 2,057 | # frozen_string_literal: true
RSpec.describe Work::Md::Cli do
describe "executing today command" do
context "when options not given" do
it "execute the given command" do
argv = ["today"]
expect(Work::Md::Commands::Today).to receive(:execute).with([])
Work::Md::Cli.execute(argv)
... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/spec/work/md/commands/annotations_spec.rb | Ruby | mit | 19 | master | 2,197 | # frozen_string_literal: true
require 'fileutils'
RSpec.describe Work::Md::Commands::Annotations do
let(:annotations_file) { "annotations.md" }
after do
FileUtils.rm_rf(test_work_dir)
ENV['EDITOR'] = nil
end
context 'executing' do
let(:expected_md_file) { "#{Work::Md::Config.work_dir}/#{annotati... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/spec/work/md/commands/config_spec.rb | Ruby | mit | 19 | master | 2,142 | # frozen_string_literal: true
require 'fileutils'
RSpec.describe Work::Md::Commands::Config do
after do
FileUtils.rm_rf(test_work_dir)
end
context 'executing' do
let(:file_name) { "config.yml" }
let(:expected_config_file_dir) { ::Work::Md::Config::DEFAULT_WORK_DIR }
let(:expected_config_file) {... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/spec/work/md/commands/yesterday_spec.rb | Ruby | mit | 19 | master | 2,655 | # frozen_string_literal: true
require 'fileutils'
RSpec.describe Work::Md::Commands::Yesterday do
let(:yesterday) { Date.today.prev_day }
before do
allow(Date).to receive(:today).and_return(double(prev_day: yesterday))
end
after do
FileUtils.rm_rf(test_work_dir)
ENV['EDITOR'] = nil
end
cont... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/spec/work/md/commands/tomorrow_spec.rb | Ruby | mit | 19 | master | 2,647 | # frozen_string_literal: true
require 'fileutils'
RSpec.describe Work::Md::Commands::Tomorrow do
let(:tomorrow) { Date.today.next_day }
before do
allow(Date).to receive(:today).and_return(double(next_day: tomorrow))
end
after do
FileUtils.rm_rf(test_work_dir)
ENV['EDITOR'] = nil
end
context... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/spec/work/md/commands/open_spec.rb | Ruby | mit | 19 | master | 2,694 | # frozen_string_literal: true
require 'fileutils'
RSpec.describe Work::Md::Commands::Open do
context 'executing' do
it 'given only day, it open this day in current month and year' do
allow(Work::Md::File).to(receive(:open_in_editor).and_return(true))
allow(::File).to(receive(:exist?).and_return(true... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/spec/work/md/commands/last_spec.rb | Ruby | mit | 19 | master | 2,834 | # frozen_string_literal: true
require 'fileutils'
RSpec.describe Work::Md::Commands::Last do
let(:last) { Date.today.prev_day.prev_day.prev_day }
after do
FileUtils.rm_rf(test_work_dir)
ENV['EDITOR'] = nil
end
context 'executing' do
let(:expected_md_file) { "#{Work::Md::Config.work_dir}/#{last.s... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/spec/work/md/commands/tlast_spec.rb | Ruby | mit | 19 | master | 918 | # frozen_string_literal: true
require 'fileutils'
RSpec.describe Work::Md::Commands::Tlast do
let(:today) { DateTime.parse "20210729" }
let(:yesterday) { Date.today.prev_day }
before do
allow(DateTime).to receive(:now).and_return(today)
allow(Date).to receive(:today).and_return(double(prev_day: yesterd... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/spec/work/md/commands/today_spec.rb | Ruby | mit | 19 | master | 2,689 | # frozen_string_literal: true
require 'fileutils'
RSpec.describe Work::Md::Commands::Today do
let(:today) { DateTime.now }
before do
allow(DateTime).to receive(:now).and_return(today)
end
after do
FileUtils.rm_rf(test_work_dir)
ENV['EDITOR'] = nil
end
context 'executing' do
let(:expecte... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/spec/work/md/commands/delete_spec.rb | Ruby | mit | 19 | master | 2,279 | # frozen_string_literal: true
require 'fileutils'
RSpec.describe Work::Md::Commands::Delete do
before do
allow_any_instance_of(TTY::Prompt).to receive(:yes?).and_return(true)
end
context 'executing' do
it 'given only day, it delete this day in current month and year' do
allow(::File).to(receive(:... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/spec/work/md/commands/parse_spec.rb | Ruby | mit | 19 | master | 4,724 | # frozen_string_literal: true
require 'fileutils'
RSpec.describe Work::Md::Commands::Parse do
let(:today) { DateTime.now }
let(:file_1_path) { "#{test_work_dir}/#{today.strftime('%Y/%m/%d')}.md" }
let(:file_2_path) { "#{test_work_dir}/#{today.strftime('%Y/%m/%d')}2.md" }
let(:parsed_file_path) { Work::Md::Con... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/spec/work/md/commands/plast_spec.rb | Ruby | mit | 19 | master | 1,176 | # frozen_string_literal: true
require 'fileutils'
RSpec.describe Work::Md::Commands::Plast do
let(:today) { DateTime.parse "20210729" }
let(:yesterday) { Date.today.prev_day }
before do
allow(DateTime).to receive(:now).and_return(today)
allow(Date).to receive(:today).and_return(double(prev_day: yesterd... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/spec/work/md/commands/tyesterday_spec.rb | Ruby | mit | 19 | master | 1,018 | # frozen_string_literal: true
require 'fileutils'
RSpec.describe Work::Md::Commands::Tyesterday do
let(:today) { DateTime.now }
let(:yesterday) { Date.today.prev_day }
before do
allow(DateTime).to receive(:now).and_return(today)
allow(Date).to receive(:today).and_return(double(prev_day: yesterday))
e... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | gem/spec/work/md/parser/engine_spec.rb | Ruby | mit | 19 | master | 2,523 | # frozen_string_literal: true
RSpec.describe Work::Md::Parser::Engine do
describe "parsing work-md files" do
context "when not find a work-md file" do
it do
parser = Work::Md::Parser::Engine.new
parser.add_file("not existent")
parser.freeze
expect(parser.tasks).to eq([])
... |
github | henrique-ft/work-md | https://github.com/henrique-ft/work-md | packaging/Gemfile | Ruby | mit | 19 | master | 200 | # frozen_string_literal: true
source 'https://rubygems.org'
# Specify your gem's dependencies in work_md.gemspec
gem 'tty-box', '~> 0.7.0'
gem 'tty-editor', '~> 0.7.0'
gem 'tty-prompt', '~> 0.23.1' |
github | pocke/graphql-coverage | https://github.com/pocke/graphql-coverage | Gemfile | Ruby | mit | 19 | master | 281 | # frozen_string_literal: true
source "https://rubygems.org"
# Specify your gem's dependencies in graphql-coverage.gemspec
gemspec
gem "rake", "~> 13.0", require: false
gem "rspec", "~> 3.0", require: false
gem "rubocop", "~> 1.21", require: false
gem 'steep', require: false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.