effective_memberships 0.1.10 → 0.1.11

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: f2fa9825b98ff831e92982093f101688968d4a9de0e1b61bd40d30b4ecdc508a
4
- data.tar.gz: 3099497fce47b55f6d47009e5637aac7fdc70990f2bccd4d5d08cd448b7982a3
3
+ metadata.gz: 23096ca68807bea4bee0124d266ccb80d5e26e2bd2fd9cd9357a527a451212af
4
+ data.tar.gz: ed6e17ce553edf22b22fabeb6b6a85bf3260b1dc595ef57a1c1dfbfce21e9e4f
5
5
  SHA512:
6
- metadata.gz: 1ea91efb59aa3d7408a76fbc463febca221f0150f83964361a72aa2c79ae8f14071be1fd91ef6e060dcdd2d08d36edb74c369b6287d2698722000b80ffce02c6
7
- data.tar.gz: 826d97b4c4f2fc50cd30dde0b0bbccf2eefdea7c2e1fc73c27e87916ae64a07a00d0d74e2b775cf41b8e2f55268403885a92e3fc932969ed350aa0fde1893737
6
+ metadata.gz: 498f8de4da09f11cd4933563db907a608d5b261a1e84425f5d7dc07ddefa04bf5feeb58a0b511810a758188fc8c5748e24e67eadb1f1a748e8fc55f8283bf352
7
+ data.tar.gz: 061176c89de004535b1c619ef7b67f4849a72539689f678724e6217691f75e1653ae895f78a5597b38ac6f63b9122348b3d22785bf467161159fdff8ae2c438b
@@ -0,0 +1,9 @@
1
+ module Admin
2
+ class MembershipsController < ApplicationController
3
+ before_action(:authenticate_user!) if defined?(Devise)
4
+ before_action { EffectiveResources.authorize!(self, :admin, :effective_memberships) }
5
+
6
+ include Effective::CrudController
7
+
8
+ end
9
+ end
@@ -0,0 +1,40 @@
1
+ module Admin
2
+ class EffectiveMembershipsDatatable < Effective::Datatable
3
+
4
+ datatable do
5
+ order :id
6
+ col :id, visible: false
7
+
8
+ col :owner
9
+ col :categories
10
+
11
+ col :number
12
+ col :number_as_integer, visible: false
13
+
14
+ col :joined_on
15
+ col :registration_on
16
+
17
+ col :fees_paid_period, visible: false, label: 'Fees Paid'
18
+ col :fees_paid_through_period, label: 'Fees Paid Through'
19
+
20
+ col :bad_standing
21
+ col :bad_standing_admin, visible: false
22
+ col :bad_standing_reason, visible: false
23
+
24
+ actions_col
25
+ end
26
+
27
+ collection do
28
+ memberships = Effective::Membership.deep.all
29
+
30
+ raise('expected an owner_id, not user_id') if attributes[:user_id].present?
31
+
32
+ if attributes[:owner_id].present?
33
+ memberships = memberships.where(owner_id: attributes[:owner_id])
34
+ end
35
+
36
+ memberships
37
+ end
38
+
39
+ end
40
+ end
@@ -26,7 +26,7 @@ module Effective
26
26
  timestamps
27
27
  end
28
28
 
29
- scope :deep, -> { includes(owner: [:fees, :membership]) }
29
+ scope :deep, -> { includes(:membership_categories) }
30
30
  scope :sorted, -> { order(:id) }
31
31
 
32
32
  scope :with_paid_fees_through, -> (period = nil) {
data/config/routes.rb CHANGED
@@ -27,6 +27,7 @@ EffectiveMemberships::Engine.routes.draw do
27
27
  resources :applicant_course_names, except: [:show]
28
28
 
29
29
  resources :fee_payments, only: [:index, :show]
30
+ resources :memberships, only: [:index]
30
31
  resources :registrar_actions, only: [:create]
31
32
  end
32
33
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveMemberships
2
- VERSION = '0.1.10'
2
+ VERSION = '0.1.11'
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.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
@@ -216,6 +216,7 @@ files:
216
216
  - app/controllers/admin/categories_controller.rb
217
217
  - app/controllers/admin/fee_payments_controller.rb
218
218
  - app/controllers/admin/fees_controller.rb
219
+ - app/controllers/admin/memberships_controller.rb
219
220
  - app/controllers/admin/registrar_actions_controller.rb
220
221
  - app/controllers/effective/applicant_references_controller.rb
221
222
  - app/controllers/effective/applicants_controller.rb
@@ -227,6 +228,7 @@ files:
227
228
  - app/datatables/admin/effective_fee_payments_datatable.rb
228
229
  - app/datatables/admin/effective_fees_datatable.rb
229
230
  - app/datatables/admin/effective_membership_histories_datatable.rb
231
+ - app/datatables/admin/effective_memberships_datatable.rb
230
232
  - app/datatables/effective_applicant_courses_datatable.rb
231
233
  - app/datatables/effective_applicant_educations_datatable.rb
232
234
  - app/datatables/effective_applicant_experiences_datatable.rb