Skip to content
CAI
Software that uses CAICheck a score

scambra/devise_invitable

69.8

Adequate · 5 October 2026

847

lines of production code

Ruby

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a Ruby gem that extends the Devise authentication library to support user invitation workflows. It provides controllers, models, and views to manage the lifecycle of invitations, including sending invites, accepting them, and handling expiration. The library integrates with both ActiveRecord and Mongoid ORMs and includes generators to streamline setup within Rails applications.

How it got here

2009 — Devise Invitable release and CI modernization

11 changes.

This period focused on the initial release and stabilization of the Devise Invitable module, including comprehensive test coverage for models, generators, and integration scenarios. Concurrently, the project modernized its build infrastructure by migrating to GitLab CI and updating gem management tools.

2010 — Devise Invitable feature implementation

13 changes.

This period focused on the initial implementation of the Devise Invitable gem, introducing core controllers, views, and generators to manage user invitation workflows. The work included establishing the invitation lifecycle, updating migration templates to track invitation states, and enhancing email notifications with expiration details. Comprehensive test coverage was added for Rails 3.2 and Mongoid to ensure stability across different ORM configurations.

2011–2026 — Rails 8.0 support and security hardening

12 changes.

This period focused on extending compatibility to Rails 8.0 and refining the test suite with new database schemas, functional tests, and view templates. It also introduced Mongoid generator support and implemented security improvements by hiding sensitive invitation attributes from serialization.

Features

Add Mongoid generator for Devise Invitable

Adds a new generator class for the Devise Invitable gem specifically tailored for Mongoid ORM. This allows users to generate Devise Invitable components (such as models and views) that are compatible with Mongoid instead of the default ActiveRecord.

lib/generators/mongoid · high confidence

Add invitation edit and new view templates

Added the \edit.html.erb\ and \new.html.erb\ templates for the Devise invitations feature. The edit view handles accepting an invitation, including a hidden field for the invitation token and optional password fields controlled by the \require\_password\_on\_accepting\ configuration. The new view provides the form for sending invitations, iterating over configured \invite\_key\_fields\ to generate the appropriate input fields.

app/views/devise/invitations · high confidence

Initial implementation of Devise Invitable controller

Adds the \Devise::InvitationsController\ to enable user invitation workflows. This controller handles creating new invitations (with optional inviter authentication and invitation limits), accepting invitations (supporting both secure and insecure sign-in modes), and removing invitations. It integrates with Devise's parameter sanitization, flash messaging, and routing helpers to provide a complete invitation lifecycle.

app/controllers/devise · high confidence

Initial release of Devise Invitable module

This change introduces the core configuration and module structure for the new Devise Invitable feature. It registers the 'invitable' module with Devise, defining default behaviors for invitation validity periods, validation on invite, invitation limits, and the specific key used to identify users (defaulting to email). It also sets up autoloads for the Inviter, Mailer, Mapping, ParameterSanitizer, and controller helpers, establishing the foundation for sending and accepting user invitations.

lib · high confidence

New generators for installation, model setup, and views

The gem now provides dedicated Rails generators to streamline integration: the install generator adds commented configuration options (such as invite expiration, invitation limits, and auto-sign-in settings) to the Devise initializer and copies locale files; the model generator injects the :invitable directive into existing models and triggers ORM-specific migrations; and the views generator copies invitation and mailer templates to the application, supporting both SimpleForm and standard form builders.

_lib/generators/devise\invitable · high confidence

Behavioural changes

Devise Invitable updated to version 2.0.14

The library has been upgraded to version 2.0.14, introducing a refactored architecture that extracts invitation logic into a dedicated \Inviter\ module and updates the mailer to use \Devise.mailer\ for better compatibility. This release includes fixes for Ruby 2.7 deprecation warnings, ensures invitation tokens and acceptance timestamps are rolled back on failed saves to prevent invalid user states, and corrects the invitation mail subject key typo. Users benefit from improved stability with modern Devise versions and cleaner API methods that use bang notation for model-saving operations.

_lib/devise\invitable · high confidence

Hide invitable attributes from serialization and inspection

The \invitation\_token\, \invitation\_created\_at\, \invitation\_sent\_at\, \invitation\_accepted\_at\, \invitation\_limit\, \invited\_by\_type\, \invited\_by\_id\, and \invitations\_count\ attributes are now explicitly added to the serialization blacklist (either \UNSAFE\_ATTRIBUTES\_FOR\_SERIALIZATION\ or \BLACKLIST\_FOR\_SERIALIZATION\, depending on availability). This ensures these sensitive invitation-related fields are excluded from object serialization and inspection outputs, addressing security and privacy concerns raised in issue \#735.

_lib/devise\invitable/models · high confidence

Invitation email templates now display expiration due dates

The invitation email templates (HTML and plain text) have been updated to include a message indicating when an invitation expires. If the invited resource has an \invitation\_due\_at\ date set, the email will now display a localized 'accept until' message showing that specific due date, ensuring users are aware of the invitation's validity period.

app/views/devise/mailer · high confidence

Invited users are now confirmed and accepted during registration

The new DeviseInvitable::RegistrationsController overrides the build\_resource method to automatically accept invitations and send confirmation instructions when an invited user registers. This ensures that invited users are fully activated and receive their confirmation email immediately upon completing the registration process, rather than requiring a separate confirmation step.

_app/controllers/devise\invitable · high confidence

Migrate CI to GitLab Dependency Scanning and update build infrastructure

The project replaces its previous CI configuration with a new GitLab CI pipeline (.gitlab-ci.yml) that runs dependency scanning using the official GitLab security products image. The build infrastructure is modernized by removing the Jeweler gem in favor of Bundler for gem management, updating test file patterns to \*\_test.rb, and adding a Rake task to run tests across all configured ORMs. Documentation is consolidated by replacing the Rdoc README with a Markdown version, and the .gitignore is updated to exclude generated test artifacts and lock files.

(repo-wide) · high confidence

Migration template now includes Rails version for Rails 5+

The ActiveRecord generator for devise\_invitable now appends the current Rails version (e.g., \[5.0\]) to the generated migration filename when running on Rails 5 or later. This ensures migration files are correctly versioned and avoids conflicts with other migrations, addressing issues where the extension or naming might otherwise be ambiguous in newer Rails versions.

_lib/generators/active\record · high confidence

Standardize invitation acceptance paths and authentication

The controller helpers now define default behavior for post-invitation and post-acceptance redirects, sending users to the signed-in root path in both cases. A new helper method allows customizing the path displayed when an invitation token is invalid, defaulting to the sign-out path. Additionally, the internal authentication method for the inviter has been renamed to authenticate\_inviter! to better reflect its purpose and align with Devise core conventions.

_lib/devise\invitable/controllers · high confidence

Updated migration template for Devise Invitable

The ActiveRecord migration generator template has been updated to include new columns for tracking invitation lifecycle and limits. Users generating migrations will now see \invitation\_created\_at\, \invitation\_sent\_at\, \invitation\_accepted\_at\, \invitation\_limit\, and \invitations\_count\ columns added to their tables, along with a polymorphic \invited\_by\ reference. The template also ensures proper indexing on \invitation\_token\ and \invited\_by\_id\, and provides a corresponding \down\ migration to remove these fields cleanly.

_lib/generators/active\record/templates · high confidence

Updated simple\_form templates for invitation views

The simple\_form templates for the invitation edit and new views have been updated to use \f.button :submit\ instead of the previous implementation. This change ensures that the generated submit buttons include the standard \btn\ CSS class when used with simple\_form, providing consistent styling for the invitation acceptance and creation forms.

_lib/generators/devise\invitable/templates · high confidence

Test coverage

Add ORM test configuration for ActiveRecord and Mongoid; Added ApplicationHelper stub in test app; Added ApplicationMailer base class for test app; Added environment configuration files for the test Rails application; Added functional tests for controller helpers and registration flows; Added integration tests for invitation removal and acceptance flows; Added layout template for the Rails test application; Added model tests for invitation lifecycle and token management; Added test application configuration for Rails 5 and Devise integration; Added test application controllers for Devise integration scenarios; Added test application initializer configuration files; Added test application models for Devise integration testing; Added test coverage for user invitation view; Added test database schema for Rails 5.1 compatibility; Added test infrastructure for Rails 3.2 and Mongoid; Added test suite for generators, models, and routes; Added test view for admin invitation form; Added test view for free invitation form; Added test view template for Devise sessions; Added tests for invitation mailer and parent mailer resolution.

Dependencies

Add test dependency files for Rails 6.1 through 8.0

Added new Gemfile variants in the gemfiles directory to pin specific test dependencies for Rails versions 6.1, 7.0, 7.1, 7.2, and 8.0, as well as a main branch configuration. These files define the required gems (such as activerecord, actionmailer, devise, and sqlite3) and their version constraints for testing the library against each supported Rails release, including specific adjustments for Ruby 3.4 compatibility and JRAD support.

gemfiles · high confidence

Housekeeping

Added empty placeholder file in tmp directory

An empty .gitkeep file was added to the tmp directory to ensure the folder is tracked by version control.

tmp · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 69 → 70 (+0.3)
  • Rubric changed (rubric-2026.09.15 → rubric-2026.10.1) — scores are not directly comparable.

Lenses

  • Code Health 100 → 100 (+0.0)
  • Architecture 69 → 69 (+0.0)
  • Maturity 61 → 61 (+0.0)
  • Readiness 77 → 79 (+1.7)
  • Security 93 → 94 (+1.1)

Resolved (3)

  • Low CVE: [GHSA redacted] (Gemfile)
  • The method _invite appears to be an internal implementation detail (indicated by the leading underscore) that is exposed in the public API surface alongside the public invite! method. This creates redundancy where one is likely a private helper for the other, yet both are visible.
  • There is a signature inconsistency between the class method invite! and the instance method invite!. The class method takes attributes as the first argument, while the instance method does not (presumably using self). While this is a common pattern in Ruby ORMs, the naming collision without clear distinction in the signature list can be confusing for API consumers expecting uniform behavior.

New (4)

  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Medium vulnerability: [GHSA redacted] (Gemfile)
  • Redundant naming convention for safe vs. bang methods. Same as above.

Changes since last survey

  • 6 commits — 5 feature/other, 1 fixes

By area

  • .github/workflows — 2 commits
  • lib/devise_invitable — 2 commits
  • (root) — 1 commit
  • config/locales — 1 commit

Notable commits

  • fix: Fix NameError when Devise.parent_mailer is an app mailer
  • change: Bump actions/checkout from 5 to 6
  • change: bump to 2.0.13
  • change: bump to 2.0.14
  • change: ci: check locale interpolations against en
  • change: i18n(zh-HK, zh-TW): fix %{email) typo in invitations.send_instructions

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

scambra/devise_invitable was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 5 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 99af9b2404e63a97d9dd780b19ed88da47b91f21 — the exact code this score is about.
  • Scored under rubric-2026.10.1 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-3f806db95659.