effective_events 3.3.4 → 3.3.6

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: f9b07bb93cfabb9a149aec720869d70e1fd11ad232470d235541181bcc0b219c
4
- data.tar.gz: 71ab26bdc03c680ca81480cb695f749f6a04b83fb5670c92edce04b8595eec82
3
+ metadata.gz: c5858754efeedb4638f0c9716e8db9a2314f2abf1bd2a4634a22b8504e738378
4
+ data.tar.gz: c48f446405a02f269a91774886f7e6e940d1cc78aad19297ba0b9a3c4605fb9e
5
5
  SHA512:
6
- metadata.gz: 0dc2c98118a82d433e6a1b2ff94f135e346571c7ac93c07dd9ace7a9449de6cc60414faa6384f3cd7b345667551a3a5f9dd501d9c853d5bf3ae477ccc505330d
7
- data.tar.gz: bfec9689edade44c45193c449dd8afa84b1f89d452e10cc1a76870c9ffaae8de00d0896eab3244dbe6b6d4372f15f17fc65df3b0a28bb031070539573d4fb2bd
6
+ metadata.gz: 7f84592d4b7fe6c1e6d859fd78d39b93e99cab7a28d89066a34d76ebe44328c24cf3bb1e652d6efd6adce2149182ca279f44d975895be1fa37b5f1c314843d25
7
+ data.tar.gz: 986ccd698de2eccda992a2a5a3b1ccc2303ff902168d4a8b5e6ecb42e0c38f7e6c35aaedfe5cd76d03e028558294ecaff2f1a5b7dd0ae8b8f60288a02bc544d4
@@ -22,9 +22,13 @@ module Admin
22
22
 
23
23
  col :event
24
24
 
25
- col :owner, as: :string, sql_column: 'users.last_name' do |er|
26
- er.owner.to_s
25
+ col :owner, as: :string, sql_column: 'owners.last_name' do |er|
26
+ link_to(er.owner, "/admin/users/#{er.owner_id}/edit")
27
+ end.search do |collection, term|
28
+ users = Effective::Resource.new(current_user).search_any(term, columns: [:first_name, :last_name, :email])
29
+ collection.where(owner_id: users, owner_type: current_user.class.name)
27
30
  end
31
+
28
32
  col :event_registration, visible: false
29
33
 
30
34
  if defined?(EffectiveMemberships) && EffectiveMemberships.Organization.respond_to?(:sponsors)
@@ -66,21 +70,28 @@ module Admin
66
70
  else
67
71
  'Pending Name'
68
72
  end
73
+ end.search do |collection, term|
74
+ event_registrants = Effective::Resource.new(Effective::EventRegistrant).search_any(term, columns: [:first_name, :last_name, :email])
75
+ collection.where(id: event_registrants)
69
76
  end
70
77
 
71
78
  col :user, visible: false
72
- col :organization, as: :string, sql_column: "NULLIF(organizations.title, '')", visible: EffectiveEvents.organization_enabled? do |er|
73
- er.organization.to_s
79
+
80
+ if defined?(EffectiveMemberships) && EffectiveEvents.organization_enabled?
81
+ col :organization, as: :string, sql_column: 'organizations.title', visible: true do |er|
82
+ link_to(er.organization, effective_memberships.edit_admin_organization_path(er.organization))
83
+ end.search do |collection, term|
84
+ organizations = Effective::Resource.new(EffectiveMemberships.Organization).search_any(term, columns: [:title])
85
+ collection.where(organization_id: organizations, organization_type: EffectiveMemberships.Organization.name)
86
+ end
87
+ else
88
+ col :company, visible: true
74
89
  end
75
- col :company, visible: !EffectiveEvents.organization_enabled?
76
90
 
77
91
  col :orders, visible: false
78
92
 
79
93
  col(:price, as: :price) do |registrant|
80
- [
81
- (badge('ADMIN') if registrant.created_by_admin?),
82
- price_to_currency(registrant.price)
83
- ].compact.join(' ').html_safe
94
+ [(badge('ADMIN') if registrant.created_by_admin?), price_to_currency(registrant.price)].compact.join(' ').html_safe
84
95
  end
85
96
 
86
97
  col :created_by_admin, visible: false
@@ -108,9 +119,12 @@ module Admin
108
119
  end
109
120
 
110
121
  collection do
111
- scope = Effective::EventRegistrant.deep.includes(user: :addresses).all
112
- .joins("LEFT JOIN users ON users.id = event_registrants.owner_id")
113
- .joins("LEFT JOIN organizations ON organizations.id = event_registrants.organization_id")
122
+ scope = Effective::EventRegistrant.deep.all
123
+ .joins("LEFT JOIN users AS owners ON owners.id = event_registrants.owner_id")
124
+
125
+ if defined?(EffectiveMemberships) && EffectiveEvents.organization_enabled?
126
+ scope = scope.joins("LEFT JOIN organizations AS organizations ON organizations.id = event_registrants.organization_id")
127
+ end
114
128
 
115
129
  if attributes[:event_id].present?
116
130
  scope = scope.where(event: event)
@@ -71,7 +71,7 @@ module Effective
71
71
  end
72
72
 
73
73
  scope :sorted, -> { order(:event_ticket_id, :id) }
74
- scope :deep, -> { includes(:event, :event_ticket, :owner, :user, event_registration: :orders) }
74
+ scope :deep, -> { includes(:event, :event_ticket, :owner, user: :addresses, event_registration: :orders) }
75
75
  scope :registered, -> { unarchived.where.not(registered_at: nil) }
76
76
  scope :not_registered, -> { archived.or(where(registered_at: nil)) }
77
77
  scope :purchased_or_created_by_admin, -> { purchased.or(unarchived.where(created_by_admin: true)) }
@@ -208,7 +208,7 @@ class CreateEffectiveEvents < ActiveRecord::Migration[6.0]
208
208
  t.integer :event_registration_id
209
209
  t.string :event_registration_type
210
210
 
211
- t.string :event_ticket_id
211
+ t.integer :event_ticket_id
212
212
  t.integer :quantity
213
213
 
214
214
  t.datetime :updated_at
@@ -1,3 +1,3 @@
1
1
  module EffectiveEvents
2
- VERSION = '3.3.4'.freeze
2
+ VERSION = '3.3.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_events
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.4
4
+ version: 3.3.6
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: 2026-03-26 00:00:00.000000000 Z
11
+ date: 2026-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails