effective_memberships 0.2.6 → 0.3.0

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
  SHA256:
3
- metadata.gz: 6edc66bd8a9a8c6b9d38fb90cb42c8041efde67d7e2d5b80b14169678e70e9ff
4
- data.tar.gz: 928861f7ee7ee4a2e2f1f77f3e8209909948ba7470ad2894267cbe29084e1290
3
+ metadata.gz: 299989dcd361fdf24b0ba06461caaf5708934a416c356c9a24ab088bad96e4bb
4
+ data.tar.gz: b2ea47e531173ce84ca9732f75f1d9d4dd3f82f0f382fc6723d4efdc3124f455
5
5
  SHA512:
6
- metadata.gz: 9a928f4b12eead76fc74ebd7fe39838829484796b4dd017dbbc35236f9bdd16d0bdcf7cc74526fbb95dee1711c82157c817f084352aa6bcde3ce35c2306e5a59
7
- data.tar.gz: b2dca432e504b87d57b88c2e36624cf857f3364c346828d355b58e28188b01a4ff38bdaece31b60cadc976075d9e62f4d7bf0530d260d63ecdd31b051702f014
6
+ metadata.gz: 520f5f62ef9b6faa7d281a93055cf078fc3138ce29c0a176852c6ee3504ea3412936166463e3fd0603b19fe627e1ea5c1074457ecedf238b5d2f6b98e1983f53
7
+ data.tar.gz: 96ccdbb68a88d7faeb8c97addc37b4f85d7c96a2c36d9967309e4edb50e8c27a793387a96c29ea0a18a8999287338a65cdae6d76b9606f700eca2803f12edb28
@@ -77,20 +77,20 @@ module EffectiveMembershipsApplicant
77
77
  belongs_to :category, polymorphic: true, optional: true
78
78
  belongs_to :from_category, polymorphic: true, optional: true
79
79
 
80
- has_many :applicant_reviews, -> { order(:id) }, inverse_of: :applicant, dependent: :destroy
80
+ has_many :applicant_reviews, -> { order(:id) }, as: :applicant, dependent: :destroy
81
81
  accepts_nested_attributes_for :applicant_reviews, reject_if: :all_blank, allow_destroy: true
82
82
 
83
83
  # Effective Namespace
84
- has_many :applicant_courses, -> { order(:id) }, class_name: 'Effective::ApplicantCourse', inverse_of: :applicant, dependent: :destroy
84
+ has_many :applicant_courses, -> { order(:id) }, class_name: 'Effective::ApplicantCourse', as: :applicant, dependent: :destroy
85
85
  accepts_nested_attributes_for :applicant_courses, reject_if: :all_blank, allow_destroy: true
86
86
 
87
- has_many :applicant_educations, -> { order(:id) }, class_name: 'Effective::ApplicantEducation', inverse_of: :applicant, dependent: :destroy
87
+ has_many :applicant_educations, -> { order(:id) }, class_name: 'Effective::ApplicantEducation', as: :applicant, dependent: :destroy
88
88
  accepts_nested_attributes_for :applicant_educations, reject_if: :all_blank, allow_destroy: true
89
89
 
90
- has_many :applicant_experiences, -> { order(:id) }, class_name: 'Effective::ApplicantExperience', inverse_of: :applicant, dependent: :destroy
90
+ has_many :applicant_experiences, -> { order(:id) }, class_name: 'Effective::ApplicantExperience', as: :applicant, dependent: :destroy
91
91
  accepts_nested_attributes_for :applicant_experiences, reject_if: :all_blank, allow_destroy: true
92
92
 
93
- has_many :applicant_references, -> { order(:id) }, class_name: 'Effective::ApplicantReference', inverse_of: :applicant, dependent: :destroy
93
+ has_many :applicant_references, -> { order(:id) }, class_name: 'Effective::ApplicantReference', as: :applicant, dependent: :destroy
94
94
  accepts_nested_attributes_for :applicant_references, reject_if: :all_blank, allow_destroy: true
95
95
 
96
96
  has_many :fees, -> { order(:id) }, as: :parent, class_name: 'Effective::Fee', dependent: :nullify
@@ -4,8 +4,8 @@ module Effective
4
4
 
5
5
  belongs_to :applicant_course_area
6
6
 
7
+ belongs_to :applicant, polymorphic: true, optional: true
7
8
  belongs_to :applicant_course_name, optional: true
8
- belongs_to :applicant, optional: true
9
9
 
10
10
  effective_resource do
11
11
  title :string
@@ -1,6 +1,6 @@
1
1
  module Effective
2
2
  class ApplicantEducation < ActiveRecord::Base
3
- belongs_to :applicant
3
+ belongs_to :applicant, polymorphic: true
4
4
 
5
5
  log_changes(to: :applicant) if respond_to?(:log_changes)
6
6
 
@@ -1,6 +1,6 @@
1
1
  module Effective
2
2
  class ApplicantExperience < ActiveRecord::Base
3
- belongs_to :applicant
3
+ belongs_to :applicant, polymorphic: true
4
4
 
5
5
  log_changes(to: :applicant) if respond_to?(:log_changes)
6
6
 
@@ -5,7 +5,7 @@ module Effective
5
5
  acts_as_statused :submitted, :completed
6
6
  log_changes(to: :applicant) if respond_to?(:log_changes)
7
7
 
8
- belongs_to :applicant
8
+ belongs_to :applicant, polymorphic: true
9
9
 
10
10
  KNOWNS = ['6 months - 1 year', '1 year - 2 years', '2 - 5 years', '5 - 10 years', 'More than 10 years']
11
11
  RELATIONSHIPS = ['Supervisor', 'Employer', 'Colleague', 'Other']
@@ -172,6 +172,7 @@ class CreateEffectiveMemberships < ActiveRecord::Migration[6.0]
172
172
  # Applicant Educations
173
173
  create_table :applicant_educations do |t|
174
174
  t.integer :applicant_id
175
+ t.string :applicant_type
175
176
 
176
177
  t.date :start_on
177
178
  t.date :end_on
@@ -191,6 +192,7 @@ class CreateEffectiveMemberships < ActiveRecord::Migration[6.0]
191
192
  # Applicant Experiences
192
193
  create_table :applicant_experiences do |t|
193
194
  t.integer :applicant_id
195
+ t.string :applicant_type
194
196
 
195
197
  t.string :level
196
198
  t.integer :months
@@ -216,6 +218,7 @@ class CreateEffectiveMemberships < ActiveRecord::Migration[6.0]
216
218
  # Applicant References
217
219
  create_table :applicant_references do |t|
218
220
  t.integer :applicant_id
221
+ t.string :applicant_type
219
222
 
220
223
  t.string :name
221
224
  t.string :email
@@ -264,7 +267,9 @@ class CreateEffectiveMemberships < ActiveRecord::Migration[6.0]
264
267
  create_table :applicant_courses do |t|
265
268
  t.integer :applicant_course_area_id
266
269
  t.integer :applicant_course_name_id
270
+
267
271
  t.integer :applicant_id
272
+ t.string :applicant_type
268
273
 
269
274
  t.string :title
270
275
  t.integer :amount
@@ -279,7 +284,9 @@ class CreateEffectiveMemberships < ActiveRecord::Migration[6.0]
279
284
  # Applicant Reviews
280
285
  create_table :applicant_reviews do |t|
281
286
  t.string :token
287
+
282
288
  t.integer :applicant_id
289
+ t.string :applicant_type
283
290
 
284
291
  t.integer :reviewer_id
285
292
  t.string :reviewer_type
@@ -1,3 +1,3 @@
1
1
  module EffectiveMemberships
2
- VERSION = '0.2.6'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_memberships
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect