Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

activerecord-arel_depth_first

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

activerecord-arel_depth_first

  • 1.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Active Record Arel DepthFirst Visitor

This gem re-introduces Arel code that was removed from Rails 6.1: https://github.com/rails/rails/pull/36492 . The code existed in the arel gem from 4.0.0 to 9.0.0, and the rails gem from 4.0.0 to 6.0.0.

It provides a DepthFirst visitor for Arel that allows you to traverse the Arel AST, e.g. for visualizations.

Installation

Include this gem into your Gemfile:

gem 'activerecord-arel_depth_first'

Example

This visitor makes the Arel AST enumerable, so you can do a depth-first iteration over it:

User.some_arbitrary_scope.arel.ast.each do |node|
  case node
  when Arel::Table
    # do something for table nodes
  when Arel::Nodes::Equality
    # do something for equality nodes
  else 
    # and so on ...
  end
end

License

activerecord-arel_depth_first is released under the MIT License.

FAQs

Package last updated on 15 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc