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
# frozen_string_literal: true | |
describe Calendar::Icalendar do | |
subject :ical do | |
Calendar::Icalendar.new(account, | |
start: start, | |
stop: stop, | |
filter: filter&.params || {}, | |
filter_name: filter&.name).get_items.to_ical | |
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
module Api | |
module V3 | |
class BaseController < ActionController::Base | |
include Mixins::Audit | |
respond_to :json | |
before_filter :authenticate, except: :api_key | |
before_filter :set_user_time_zone, except: :api_key | |
doorkeeper_for :all, except: :api_key, unless: -> { request.params['api_key'].present? } | |
attr_accessor :current_user, :account, :parent_resource |
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
# == Schema Information | |
# | |
# Table name: devices | |
# | |
# id :integer not null, primary key | |
# user_id :integer | |
# token :string(255) | |
# device_type :string(255) | |
# name :string(255) | |
# os :string(255) |
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 'spec_helper' | |
describe Organization do | |
it { should have_many(:organization_bank_accounts).dependent(:destroy) } | |
it { should have_many(:organization_branches).dependent(:destroy) } | |
it { should have_many(:departments).dependent(:destroy) } | |
it { should have_many(:employees).dependent(:destroy) } | |
it { should have_many(:reports).dependent(:destroy) } | |
it { should have_many(:payments).dependent(:destroy) } | |
it { should have_many(:events).dependent(:destroy) } |
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 Organization < VersionableModel | |
belongs_to :user | |
belongs_to :country | |
belongs_to :organization_economic_type | |
has_many :purchases | |
has_many :all_subscriptions, :class_name => "Subscription", :dependent => :destroy | |
has_many :subscriptions, -> { where {(activated_at != nil) & (valid_through >= my{Time.zone.today}) & (valid_from <= my{Time.zone.today})}.order("valid_from ASC") } | |
has_one :organization_responsible_person, :dependent => :destroy , :inverse_of => :organization |