Sha256: 97421d06ba7dd2d6b442c8a601d09a29e6b8468a09354b23eab325ebc7f1f94a

Contents?: true

Size: 794 Bytes

Versions: 16

Compression:

Stored size: 794 Bytes

Contents

class Dorsale::UserScope
  attr_reader :user

  def initialize(user)
    @user = user
  end

  # Common

  def colleagues(context = nil)
    User.all
  end

  def comments
    Dorsale::Comment.all
  end

  # Flyboy

  def folders
    Dorsale::Flyboy::Folder.all
  end

  def new_folder(*args)
    folders.new(*args)
  end

  def tasks
    Dorsale::Flyboy::Task.all
  end

  def new_task(*args)
    tasks.new(*args)
  end

  # CustomerVault

  def individuals
    Dorsale::CustomerVault::Individual.all
  end

  def new_individual(*args)
    individuals.new(*args)
  end

  def corporations
    Dorsale::CustomerVault::Corporation.all
  end

  def new_corporation(*args)
    corporations.new(*args)
  end

  def people
    (individuals + corporations).sort_by { |e| e.name.downcase }
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
dorsale-2.4.0 spec/dummy/app/models/dorsale/user_scope.rb
dorsale-2.3.5 spec/dummy/app/models/dorsale/user_scope.rb
dorsale-2.3.4 spec/dummy/app/models/dorsale/user_scope.rb
dorsale-2.3.3 spec/dummy/app/models/dorsale/user_scope.rb
dorsale-2.3.2 spec/dummy/app/models/dorsale/user_scope.rb
dorsale-2.3.1 spec/dummy/app/models/dorsale/user_scope.rb
dorsale-2.3.0 spec/dummy/app/models/dorsale/user_scope.rb
dorsale-2.2.16 spec/dummy/app/models/dorsale/user_scope.rb
dorsale-2.2.15 spec/dummy/app/models/dorsale/user_scope.rb
dorsale-2.2.14 spec/dummy/app/models/dorsale/user_scope.rb
dorsale-2.2.13 spec/dummy/app/models/dorsale/user_scope.rb
dorsale-2.2.12 spec/dummy/app/models/dorsale/user_scope.rb
dorsale-2.2.11 spec/dummy/app/models/dorsale/user_scope.rb
dorsale-2.2.10 spec/dummy/app/models/dorsale/user_scope.rb
dorsale-2.2.9 spec/dummy/app/models/dorsale/user_scope.rb
dorsale-2.2.8 spec/dummy/app/models/dorsale/user_scope.rb