Dandelion is a fair source project. View the code on Github · See the design guide

Commits on Nov 11, 2026
3418c14

Show an attendee's feedback, or the link to send them the feedback email, through one partial, events/feedback_cell, in place of a copy in each of the tickets and orders tables

8916b2d

Total the event's credit and fixed discounts with one private orders_total(field) (event_accounting.rb), in place of the same eight lines in each of credit_applied, credit_on_behalf_of_organisation, credit_on_behalf_of_revenue_sharer, fixed_discounts_applied, fixed_discounts_on_behalf_of_organisation and fixed_discounts_on_behalf_of_revenue_sharer, which now each memoise it

f1189e9

Decide who the followers lists' Subscribed to mailer filter leaves out in one place, Organisation#mailer_unsubscribed_member_ids: followers of the organisation unsubscribed from everything or from it. The activity, local group and organisation followers lists each built that list themselves (the organisation's only from those unsubscribed from everything, which comes to the same, as those unsubscribed from it have unsubscribed organisationships), and now each filter is one line. A browser test checks the filter on an activity's followers

91e1161

Use load_context (accounts_helper.rb) for the organisation, activity, local group or event the account form is reached from, in GET and POST /accounts/edit, in place of a copy of it in each

19b9be8

Filter and search an event's tickets in one helper, event_tickets_from_params (events_helper.rb), in place of the same twenty lines in the tickets list (orders_admin.rb) and the check-in list (check_in.rb), which differed only in what they include. The search now matches id, token, name and email in one $or query rather than one query each

1d053ce

Add someone by email through one helper, account_from_email_param! (accounts_helper.rb), in place of the same thirteen lines in the add-follower routes of organisations, activities and local groups and gathering's add_member: it finds the account with that email, making one named after the email's local part if there's none, and redirects back if there's no email or the account can't be made. Browser tests cover adding a follower to an organisation (a new email, then the same one again in another case, which says they already follow) and to an activity (an existing account), and a gathering member by a new email

120700d

Share when_details and concise_when_details between Event and EventSession in a WhenDetails concern, in place of a copy in each that differed only in where it read the location (EventSession already delegates location to its event). The copies had drifted: Event's concise_when_details had stopped leaving a trailing space when the zone is left out, and EventSession's still did; both now use Event's

b27e8e2

Remove three methods nothing calls, found with debride: password_block (lib/form_builder.rb), unused since changing the password moved to /accounts/password, whose form uses password_field_tag; and the organisation_monthly_donor_plus? helper with the Organisation.monthly_donor_plus? it wrapped, left behind when the monthly-donor members' area was removed

789ac90

Build every form block from one shared method: field_block (lib/form_builder.rb) works out whether the field is required (when asked, or when the model's validations require it), defaults container_class to mb-3 and passes the layout options on to block_layout, and input_block builds on it to give the field its class (with is-invalid when it has an error), required and disabled. Each _block now takes only its own options, in place of 21 copies of the same body and ten-keyword signature. secret_block, file_block and image_block still call block_layout themselves, as a saved secret is never required and a new upload isn't required by the model. id_block stays, as an alias of text_block: the admin gives a polymorphic association's id the type :id, and dadmin/build calls it by name

57522f9

Send every email through Mailer.deliver, and check none is built by hand

Mailer (lib/mail/mailer.rb) builds the one Mailgun::BatchMessage per email, so EmailHelper::RecipientVariables still makes every subject and recipient variable safe and the tests' RecordedEmail still records it. It renders a template in the email layout (or takes content:, html: or text:), sends to accounts (Account#mail_recipient: the email with firstname, or there, the link token and the id), an email alone (no variables) or [email, variables] pairs, picks the Mailgun domain and default sender by stream: (notifications, tickets, pmails, posts), applies the Microsoft-domain workaround where asked, sends through an organisation's own Mailgun account with via:, writes attachments: to tempfiles it removes in an ensure, and sends in production only, or wherever there's an API key with send_when: :configured or via:, returning Mailgun's message ids. It sends nothing to no one, as Mailgun's finalize did.

Every sender but the newsletters becomes one Mailer.deliver call with the same domain, sender, reply-to, subject, body, recipients, variables and sending condition: the account, admin, organiser, event, feedback, waitlist, comment, message, membership and CSV export emails, the referral reward claim in app/app.rb, EmailHelper.send_to_founder, MailgunDeliveryStats.send_to_admins, the ticket, refund and cancelled RSVP emails (tickets stream, Microsoft workaround; send_tickets still sends wherever there's an API key and stores the message ids) and the organisation welcome emails (via: organisation). Ticket PDFs and ICS files are no longer written into the working directory, and CSV exports' attachments, now from .csv tempfiles, go as text/csv rather than application/octet-stream. sender_info, defined the same in OrderNotifications and TicketNotifications, is now defined once in Refundable.

Dandelion/MailgunDirect flags Mailgun::BatchMessage.new and Mailgun::Client.new outside lib/mail. Pmail's send_batch_message keeps its own batch, with a disable saying why (three ways to pick account, domain and sender, tags, the already-sent check, delivery-time optimisation), as do Pmail#metrics, which reads stats, and the test of RecipientVariables on a real BatchMessage. AGENTS.md's Conventions say emails go through Mailer.deliver.

RecordedEmail now also keeps the text body, sender, reply-to and whether the email was sent. test/mailer_test.rb checks the recipient variables with and without a first name, each stream's domain and sender, the Microsoft workaround, via: with and without a key, attachment names and their tempfiles gone afterwards even when sending raises, and that nothing is sent outside production.

26d10ea

Work out the checkout's price once, on the server: Quote (lib/bookings/quote.rb) prices a booking without writing anything (percentage discounts per ticket, then credit, a fixed discount and the donation in the order OrderBuilder applied them, with a donation to Dandelion dropped when credit or a fixed discount pays for the tickets in full), and the purchase form shows it rather than working it out again in purchase.js

  • POST /e/:slug/quote takes the ticket form's fields, refuses what the purchase would (locked or restricted events, hidden ticket types without their link, prices outside their range, invalid or used-up codes, donations the event doesn't take) and returns the quote. purchase.js posts the form to it a moment after each change, shows only the latest answer, fades the totals and holds the payment buttons until it comes, and takes a percent button's donation from the quote's tickets. priceWithoutDonation, price, credit, fixedDiscount, ticketsPaidFor and balance are gone, with the data-price attributes and #total input that fed them
  • OrderBuilder checks the choices with the quote and takes the order's credit, fixed discount and donation from it, so Order#apply_credit and #apply_fixed_discount are gone. Tickets are still priced as they're created, and the order is refused (and reported) unless they come to the quote's. Ticket.discounted_price and Event#monthly_donor_discount are shared by Ticket, Order and Quote
  • The purchase response says whether a payment is required, replacing the form's guess from a response with only an order id
  • test/quotes_test.rb quotes each case and books it through OrderBuilder, checking the order is what the quote said, and tests the route and the form
  • Without a quote for the choices as they are, the payment buttons stay disabled, as they'd still show the last quote's amount: a refused quote shows why in #quote-error, and a request that fails is tried again up to three times
  • Quote and OrderBuilder count a quantity that isn't a number as none (Quote.quantities_from), and Quote treats a price too big to be one (1e400) as not chosen, so crafted requests are refused rather than raising. An order that lost its discount code to another booking since the quote is refused as used up, rather than given the code's fixed discount
ebdd234

Keep lint_test.rb's actionlint test out of the real repository when the pre-commit hook runs it: the test makes a scratch repository with git init and runs script/lint there, but git exports GIT_DIR and other GIT_ variables to hooks, and the test passed them on. Run from the hook in a worktree, git init then reinitialised the checkout's own repository rather than the scratch one, setting core.bare = true in the shared .git/config, which stops git working in the checkout and every worktree, and actionlint looked there for its config, so the test failed and the commit with it. Both commands now run with every GIT_ variable unset, and the test asserts that git init succeeded and made its repository in the scratch directory

0738e34

Build the gathering members table from one list of columns: membership_columns (gatherings_helper.rb) names each column's cell partial (membership_row/), header, th attributes and footer, and which of the gathering's settings and the viewer's role show it. The table's header, each row (gatherings/membership_row, also served alone to reload a row) and its footer all read it, in place of the same six conditions repeated in each

e353ef7

Keep each answer under its own question in the gathering members CSV: a member's joining answers were added only if they had some, so a member with application answers but no joining answers had their application answers shifted left, under the joining questions. Every question now gets a cell, answered or not

c1ef601

Build the events stats table and CSV from one list of columns: event_stats_columns (events_helper.rb) names each column's cell partial, header and th attributes, whether it's in the table, the CSV or both, any CSV text of its own, and whether it's blank for events whose revenue the viewer can't see. The table's header, rows and footer and the CSV's header and rows all read it, in place of the counted blanks they kept in step by hand (Array.new(13, ''), 14.times of footer cells, 9.times of row cells); events/_event_stats_row.erb goes, as event_stats_rows builds each row from the columns

9e5bbc4

Check the models Dandelion/GatheringScope lists against the models themselves: the cop names the models to find through their gathering by hand, so lint_test.rb now fails when that list differs from the models that belong to a gathering, and a new one can't be left findable by id alone

f40b539

Share the Stripe.js redirect stub: record_stripe_redirect in test/test_helpers.rb stands in for Stripe.js and records on the page which checkout session it would have gone to, and has_checkout_session? checks it. event_bookings_test.rb's pay_by_card and gathering_features_test.rb's card payment used their own copies of it, and event_boosts_test.rb, whose stub recorded nothing, now waits for its session to be recorded rather than for the form's opacity to come back

Commits on Nov 10, 2026
0f0ae9f

Use the shared test helpers where tests still did their work by hand: the confirm popovers in seven tests go through click_link_and_confirm or click_button_and_confirm (and account_sign_ins_test.rb loses the copy of click_button_and_confirm the split left behind), with_env moves to test/test_helpers.rb from pmails_test.rb and replaces webhooks_test.rb's and with_recaptcha's own setting and restoring of ENV, activities_test.rb and evergreen_events_test.rb record their emails with emails_sent_by_jobs and recorded_email, event_bookings_test.rb's donation test stubs Stripe with with_stubbed_stripe_session, and account_sign_ins_test.rb's three Google sign-in helpers share as_google_account

2936394

Split accounts_test.rb in two, and share the test helpers several files defined for themselves: account_sign_ins_test.rb now has signing in with a code, a link, a password, Google, Ethereum or Bluesky, sessions, connecting providers and confirming the email (77 tests), and accounts_test.rb signing up, profiles, avatars, notifications, signing up from an organisation, activity, local group or event, merging accounts and maps (49). test/test_helpers.rb, included in every test, has the helpers more than one file used: one RecordedEmail standing in for Mailgun::BatchMessage in place of eight copies in four versions (it keeps recipients and their variables, subject, HTML and attachment names, all any of them kept), recorded_emails, recorded_email, emails_sent_by_jobs, with_stubbed_stripe_session, create_member, gathering_path, click_link_and_confirm and click_button_and_confirm, and the two sign up helpers both account files use. create_paid_order and create_incomplete_order stay in their files, as their versions differ in what they make

e69d626

Sign in with Bluesky through our own ATProto OAuth client instead of the omniauth-atproto gem: bsky.social requires pushed authorization requests (PAR), which the gem never made, so Bluesky sign-in sent people straight to an authorize URL the server refuses. AtprotoOAuth (lib/auth/atproto_oauth.rb) resolves the handle or DID to its PDS and the authorization server the PDS names, pushes the request with PKCE, a fresh DPoP key per sign-in (retrying once with the server's DPoP nonce) and a private_key_jwt client assertion, and on callback checks the state and the iss parameter (RFC 9207), exchanges the code with the same DPoP key, and refuses the token unless its sub is the DID the handle resolved to and that DID's own PDS names the token's issuer, as the ATProto OAuth spec requires of clients. Every request goes through SsrfFilter, and POSTs don't follow redirects. A small OmniAuth strategy (lib/auth/atproto_strategy.rb) keeps /auth/atproto, the callback, /auth/failure and existing provider links as they were; the sign-in in progress is one session value, cleared before anything can fail and used once. This replaces AtprotoSetup, the strategy patch and the controller's DID check, and drops the gem with atproto_client; didkit is now in the Gemfile itself. The tests run against a stubbed authorization server that checks the client assertion, asks for a DPoP nonce and gives a token only for its own code, DPoP key and PKCE verifier