effective_memberships 0.2.6 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6edc66bd8a9a8c6b9d38fb90cb42c8041efde67d7e2d5b80b14169678e70e9ff
4
- data.tar.gz: 928861f7ee7ee4a2e2f1f77f3e8209909948ba7470ad2894267cbe29084e1290
3
+ metadata.gz: 32415f21f0400cb757d09cb4779d18e0ba4462059d4c31410cd916ff7dc384eb
4
+ data.tar.gz: f5394ac52d43975b6a1b12386029936131ffce521226343d39e5d57267053a40
5
5
  SHA512:
6
- metadata.gz: 9a928f4b12eead76fc74ebd7fe39838829484796b4dd017dbbc35236f9bdd16d0bdcf7cc74526fbb95dee1711c82157c817f084352aa6bcde3ce35c2306e5a59
7
- data.tar.gz: b2dca432e504b87d57b88c2e36624cf857f3364c346828d355b58e28188b01a4ff38bdaece31b60cadc976075d9e62f4d7bf0530d260d63ecdd31b051702f014
6
+ metadata.gz: 573a3eafaedd539e47fababe8a253075ab3258e6bf8c5275838c80a4f1d96aa8ee9589d41e112415f530d7780b8f532c5a1cca40f3245b1c087ebf6576d80a03
7
+ data.tar.gz: aaeb899f86c0c4811729a1619583afc1100d579aacc65ba234b0cf623392359fea274f8f63a7d1805ec8a50d770552322c311eec114e9c72fc0ec282d7c2ecef
@@ -13,6 +13,9 @@ module Admin
13
13
  col :late_fee, as: :price
14
14
  col :rich_text_body, label: 'Body'
15
15
 
16
+ col :tax_exempt
17
+ col :qb_item_name, visible: false
18
+
16
19
  actions_col
17
20
  end
18
21
 
@@ -77,26 +77,26 @@ 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, inverse_of: :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, inverse_of: :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, inverse_of: :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, inverse_of: :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, inverse_of: :applicant, dependent: :destroy
94
94
  accepts_nested_attributes_for :applicant_references, reject_if: :all_blank, allow_destroy: true
95
95
 
96
- has_many :fees, -> { order(:id) }, as: :parent, class_name: 'Effective::Fee', dependent: :nullify
96
+ has_many :fees, -> { order(:id) }, as: :parent, inverse_of: :parent, class_name: 'Effective::Fee', dependent: :nullify
97
97
  accepts_nested_attributes_for :fees, reject_if: :all_blank, allow_destroy: true
98
98
 
99
- has_many :orders, -> { order(:id) }, as: :parent, class_name: 'Effective::Order', dependent: :nullify
99
+ has_many :orders, -> { order(:id) }, as: :parent, inverse_of: :parent, class_name: 'Effective::Order', dependent: :nullify
100
100
  accepts_nested_attributes_for :orders
101
101
 
102
102
  effective_resource do
@@ -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
@@ -17,7 +17,7 @@ module Effective
17
17
  timestamps
18
18
  end
19
19
 
20
- scope :deep, -> { includes(:applicant_course_area, :applicant_course_name, :applicant) }
20
+ scope :deep, -> { includes(:applicant_course_area, :applicant_course_name) }
21
21
  scope :sorted, -> { order(:title) }
22
22
 
23
23
  before_validation(if: -> { applicant_course_name.present? }) do
@@ -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
 
@@ -16,7 +16,7 @@ module Effective
16
16
  timestamps
17
17
  end
18
18
 
19
- scope :deep, -> { includes(:applicant) }
19
+ scope :deep, -> { all }
20
20
 
21
21
  validates :start_on, presence: true
22
22
  validates :end_on, presence: true
@@ -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
 
@@ -25,7 +25,7 @@ module Effective
25
25
  timestamps
26
26
  end
27
27
 
28
- scope :deep, -> { includes(:applicant) }
28
+ scope :deep, -> { all }
29
29
 
30
30
  before_validation(if: -> { start_on.present? && end_on.present? }) do
31
31
  self.months ||= ((end_on - start_on) / 1.month).to_i
@@ -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']
@@ -38,7 +38,7 @@ module Effective
38
38
  timestamps
39
39
  end
40
40
 
41
- scope :deep, -> { includes(:applicant) }
41
+ scope :deep, -> { all }
42
42
 
43
43
  # All step validations
44
44
  validates :applicant, presence: true
@@ -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.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
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.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-31 00:00:00.000000000 Z
11
+ date: 2022-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails