arkaan 0.8.6 → 0.8.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c581074988dfee89cb041de819bc4c5411b7801
4
- data.tar.gz: e129be05da29f0fbec6aa523670dfb723998f5ec
3
+ metadata.gz: 3f5d9fc3ef6923c34badd58cf36705e09e8f0071
4
+ data.tar.gz: bbcde8e534548e501c7018e1cf071e3dfdc7e882
5
5
  SHA512:
6
- metadata.gz: 92331a2b46ae5b824d7ba2dad73819e1dd3a4bb537caaa572dbfbb964a296778b60464c2fdc5bba51a7fe862c2f9a10efcdb84c8072f637e0e7e6fe23519cc23
7
- data.tar.gz: 1d747f187e188a160b8ace22aa49b99a65b40819dcd450d059f4cf14be504cd92de82b9a44c34d176207651774a2a221fb062f438a3ef30fd71c754539bc0db3
6
+ metadata.gz: 2894da2f86d4bfd714c500c2b9dd088797c43e352cf2877f786a451f2a7284e08e6ee0054e999323a7c7e5ccc4d3a44c66e6c9e8a7270f69ef8219992d6fa227
7
+ data.tar.gz: 2c11f7f91d72a4e9ef6cfc97fb27735b767beee4dcb8973cc43027391a0aee8360503f207b8f1e9f6c482b758c71574d8e841bb81a00608b650c8822812266a7
@@ -34,6 +34,7 @@ module Arkaan
34
34
  # @!attribute [rw] groups
35
35
  # @return [Array<Arkaan::Permissions::Group>] the groups giving their corresponding rights to the current account.
36
36
  has_and_belongs_to_many :groups, class_name: 'Arkaan::Permissions::Group', inverse_of: :accounts
37
+
37
38
  # @!attribute [rw] applications
38
39
  # @return [Array<Arkaan::OAuth::Application] the applications this user has created and owns.
39
40
  has_many :applications, class_name: 'Arkaan::OAuth::Application', inverse_of: :creator
@@ -49,6 +50,9 @@ module Arkaan
49
50
  # @!attribute [rw] campaigns
50
51
  # @return [Array<Arkaan::Campaign>] the campaigns this account has created.
51
52
  has_many :campaigns, class_name: 'Arkaan::Campaign', inverse_of: :creator
53
+ # @!attribute [rw] invitations
54
+ # @return [Array<Arkaan::Campaigns::Invitation>] the invitations in campaigns you have been issued.
55
+ has_many :invitations, class_name: 'Arkaan::Campaigns::Invitation', inverse_of: :account
52
56
 
53
57
  validates :username,
54
58
  presence: {message: 'account.username.blank'},
@@ -22,6 +22,10 @@ module Arkaan
22
22
  # @return [Arkaan::Campaign] the account creating the campaign, and considered "game master".
23
23
  belongs_to :creator, class_name: 'Arkaan::Account', inverse_of: :campaigns
24
24
 
25
+ # @!attribute [rw] invitations
26
+ # @return [Array<Arkaan::Campaigns::Invitation>] the invitations to players that have been made for this campaign.
27
+ has_many :invitations, class_name: 'Arkaan::Campaigns::Invitation', inverse_of: :campaign
28
+
25
29
  validates :title,
26
30
  presence: {message: 'campaign.title.blank'},
27
31
  length: {minimum: 4, message: 'campaign.title.short', if: :title?}
@@ -3,5 +3,6 @@ module Arkaan
3
3
  # @author Vincent Courtois <courtois.vincent@outlook.com>
4
4
  module Campaigns
5
5
  autoload :Tag, 'arkaan/campaigns/tag'
6
+ autoload :Invitation, 'arkaan/campaigns/invitation'
6
7
  end
7
8
  end
@@ -0,0 +1,21 @@
1
+ module Arkaan
2
+ module Campaigns
3
+ # An invitation is the linked between a player and a campaign, accepted or not.
4
+ # @author Vincent Courtois <courtois.vincent@outlook.com>
5
+ class Invitation
6
+ include Mongoid::Document
7
+ include Mongoid::Timestamps
8
+
9
+ # @!attribute [rw] accepted
10
+ # @return [Boolean] TRUE if the invitation has been accepted, false otherwise.
11
+ field :accepted, type: Boolean, default: false
12
+
13
+ # @!attribute [rw] account
14
+ # @return [Arkaan::Account] the account the invitation has been issued to.
15
+ belongs_to :account, class_name: 'Arkaan::Account', inverse_of: :invitations
16
+ # @!attribute [rw] campaign
17
+ # @return [Arkaan::Campaign] the campaign the invitation has been made in.
18
+ belongs_to :campaign, class_name: 'Arkaan::Campaign', inverse_of: :invitations
19
+ end
20
+ end
21
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arkaan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.6
4
+ version: 0.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent Courtois
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-29 00:00:00.000000000 Z
11
+ date: 2018-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -190,6 +190,7 @@ files:
190
190
  - lib/arkaan/authentication/session.rb
191
191
  - lib/arkaan/campaign.rb
192
192
  - lib/arkaan/campaigns.rb
193
+ - lib/arkaan/campaigns/invitation.rb
193
194
  - lib/arkaan/campaigns/tag.rb
194
195
  - lib/arkaan/concerns.rb
195
196
  - lib/arkaan/concerns/activable.rb
@@ -235,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
235
236
  version: '0'
236
237
  requirements: []
237
238
  rubyforge_project:
238
- rubygems_version: 2.5.1
239
+ rubygems_version: 2.6.11
239
240
  signing_key:
240
241
  specification_version: 4
241
242
  summary: The model layer for my table-RPG application