effective_events 3.1.0 → 3.1.1
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:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 5d7fc9c9bc862742ce23d16f1da5346ec09dfc20898bc773d4062300e2908b9b
         | 
| 4 | 
            +
              data.tar.gz: e1ffc22eaf468204bb6d1a1311b9be7b7630b05b83a63ac4a36467bb406bde34
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 2908eab393778019edb4a84ca383b5c829811a031349a5bc9b48e6d791a5136492d8d09b652adb33a1aa2dc2aa11b34f802191b6cd70e3db34707e7caf039e78
         | 
| 7 | 
            +
              data.tar.gz: 80b4a3ad3aab17de75edc472c735f67982e4d9ea74028156b7f7d9d69de0ddc98a49ce83dd770f6c39259257f5a4a0dbfc0596197afc764beffa90b22fe15edc
         | 
| @@ -30,12 +30,19 @@ module Admin | |
| 30 30 | 
             
                  col :published_start_at, label: "Published start", as: :datetime, visible: false
         | 
| 31 31 | 
             
                  col :published_end_at, label: "Published end", as: :datetime, visible: false
         | 
| 32 32 |  | 
| 33 | 
            -
                   | 
| 34 | 
            -
             | 
| 35 | 
            -
             | 
| 36 | 
            -
             | 
| 37 | 
            -
             | 
| 38 | 
            -
             | 
| 33 | 
            +
                  col :total_registered do |event|
         | 
| 34 | 
            +
                    registered = if event.event_tickets_with_capacity.present?
         | 
| 35 | 
            +
                      "#{event.total_registered_non_waitlisted_count}/#{event.total_capacity}"
         | 
| 36 | 
            +
                    elsif event.event_tickets.present?
         | 
| 37 | 
            +
                      "#{event.total_registered}"
         | 
| 38 | 
            +
                    end
         | 
| 39 | 
            +
             | 
| 40 | 
            +
                    waitlisted = if event.event_tickets_with_waitlist.present?
         | 
| 41 | 
            +
                      "#{event.total_registered_waitlisted_count} waitlisted"
         | 
| 42 | 
            +
                    end
         | 
| 43 | 
            +
             | 
| 44 | 
            +
                    [registered, waitlisted].compact.join(" +")
         | 
| 45 | 
            +
                  end
         | 
| 39 46 |  | 
| 40 47 | 
             
                  col :excerpt, visible: false
         | 
| 41 48 |  | 
| @@ -283,22 +283,33 @@ module Effective | |
| 283 283 | 
             
                  start_at
         | 
| 284 284 | 
             
                end
         | 
| 285 285 |  | 
| 286 | 
            +
                # For Events#index column
         | 
| 286 287 | 
             
                def event_tickets_with_capacity
         | 
| 287 | 
            -
                  event_tickets. | 
| 288 | 
            +
                  event_tickets.select { |et| et.capacity.present? }
         | 
| 288 289 | 
             
                end
         | 
| 289 290 |  | 
| 290 | 
            -
                def  | 
| 291 | 
            -
                  event_tickets_with_capacity. | 
| 291 | 
            +
                def event_tickets_with_waitlist
         | 
| 292 | 
            +
                  event_tickets_with_capacity.select { |et| et.waitlist? }
         | 
| 292 293 | 
             
                end
         | 
| 293 294 |  | 
| 294 | 
            -
                 | 
| 295 | 
            -
             | 
| 295 | 
            +
                # Total Registered and not waitlisted count
         | 
| 296 | 
            +
                def total_registered_non_waitlisted_count
         | 
| 297 | 
            +
                  event_tickets_with_capacity.sum { |et| et.registered_non_waitlisted_count }
         | 
| 298 | 
            +
                end
         | 
| 299 | 
            +
             | 
| 300 | 
            +
                # Total Registered and waitlisted count
         | 
| 301 | 
            +
                def total_registered_waitlisted_count
         | 
| 302 | 
            +
                  event_tickets_with_capacity.sum { |et| et.registered_waitlisted_count }
         | 
| 296 303 | 
             
                end
         | 
| 297 304 |  | 
| 298 305 | 
             
                def total_capacity
         | 
| 299 306 | 
             
                  event_tickets_with_capacity.sum { |et| et.capacity }
         | 
| 300 307 | 
             
                end
         | 
| 301 308 |  | 
| 309 | 
            +
                def total_registered
         | 
| 310 | 
            +
                  event_tickets.sum { |et| et.registered_count }
         | 
| 311 | 
            +
                end
         | 
| 312 | 
            +
             | 
| 302 313 | 
             
                # The amount of tickets that can be purchased except ones from an event registration
         | 
| 303 314 | 
             
                def capacity_selectable(event_ticket:, event_registration: nil)
         | 
| 304 315 | 
             
                  return 0 if event_ticket.archived?
         | 
    
        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.1. | 
| 4 | 
            +
              version: 3.1.1
         | 
| 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: 2025-10- | 
| 11 | 
            +
            date: 2025-10-08 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rails
         |