<commit_before># ActiveAdmin-Mongoid
[![Version         ][rubygems_badge]][rubygems]
[![Build Status](https://travis-ci.org/activeadmin/activeadmin-mongoid.svg?branch=master)](https://travis-ci.org/activeadmin/activeadmin-mongoid)

## Updates

ActiveAdmin is holding off on pulling Mongoid support into the core ActiveAdmin application.  This repo was pulled into the ActiveAdmin org from previous work done by <NAME>, and will be maintained by <NAME>, <NAME>, <NAME>, <NAME> and other ActiveAdmin and community members.

### Requirements for version 1.0.0
* Ruby 2.4.0 or greater.
* Tested working on Rails 5.2.3
* Mongoid 6.x (**WARNING**:, using a Mongoid version >= 6.1.x has resulted in a fair amount of errors seen in the wild.  Test your upgrade very carefully with any apps in which you're using this gem with Mongoid >= 6.1.x!)
* ActiveAdmin 1.4.3 or greater
* `ransack-mongoid` - it needs to be explicitly declared in Gemfile, pointing to github's master since it has no releases on rubygems yet.

## Previous versions
* Rails 4.x with Mongoid 5.x use branch rails4-mongoid5
* Rails 4.x with Mongoid 4.x branch rails4
* Mongoid 3.x with older versions of rails use v 0.3.0

## ♻️ INFO

This gem has been brought into the ActiveAdmin org for support and maintenance.

# ActiveAdmin::Mongoid

ActiveAdmin hacks to support Mongoid.
Some ActiveAdmin features are disabled or not working properly:

- comments are disabled by default
- filters are somewhat broken

For more on Mongoid support in ActiveAdmin see [this issue](https://github.com/gregbell/active_admin/issues/26).

## Installation

### Some Gems
Add the following gems to your application's Gemfile, and lock the version:

```ruby
gem 'activeadmin-mongoid', '1.0.0'
gem 'ransack-mongoid', github: 'activerecord-hackery/ransack-mongoid'
```

You can safely remove the following lines, since are already activeadmin-mongoid dependencies:

```ruby
gem 'activeadmin'
```

### Remove Application Dependencies
In your config/application.rb, replace:

```ruby
require 'rails/all'
```

with:

```ruby
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "action_view/railtie"
require "sprockets/railtie"
require "rails/test_unit/railtie"
```

NOTE: This gem will NOT work if you use both ActiveRecord AND Mongoid in the same app.  rails/all includes elements requiring ActiveRecord::Connection

### Bundle & Crank

Execute:

    $ bundle
    $ rails g devise:install
    $ rails g active_admin:install

Check that the generated initializers/devise.rb file requires mongoid orm.
You may find a line like this :

```ruby
require 'devise/orm/mongoid'
```

Then create an admin user:

    $ bundle exec rails console
    >> AdminUser.create email: '<EMAIL>', password: 'password', password_confirmation: 'password'

And that's pretty much it !

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

## Copyright

Copyright © 2012 <NAME>. See LICENSE for details.

[rubygems_badge]: https://img.shields.io/gem/v/activeadmin-mongoid.svg
[rubygems]: https://rubygems.org/gems/activeadmin-mongoid
<commit_msg>Replace travis badge with Github actions<commit_after># ActiveAdmin-Mongoid
[![Version         ][rubygems_badge]][rubygems]
![Tests](https://github.com/activeadmin/activeadmin-mongoid/actions/workflows/tests.yml/badge.svg)
![Codecheck](https://github.com/activeadmin/activeadmin-mongoid/actions/workflows/codecheck.yml/badge.svg)

## Updates

ActiveAdmin is holding off on pulling Mongoid support into the core ActiveAdmin application.  This repo was pulled into the ActiveAdmin org from previous work done by <NAME>, and will be maintained by <NAME>, <NAME>, <NAME>, <NAME> and other ActiveAdmin and community members.

### Requirements for version 1.0.0
* Ruby 2.4.0 or greater.
* Tested working on Rails 5.2.3
* Mongoid 6.x (**WARNING**:, using a Mongoid version >= 6.1.x has resulted in a fair amount of errors seen in the wild.  Test your upgrade very carefully with any apps in which you're using this gem with Mongoid >= 6.1.x!)
* ActiveAdmin 1.4.3 or greater
* `ransack-mongoid` - it needs to be explicitly declared in Gemfile, pointing to github's master since it has no releases on rubygems yet.

## Previous versions
* Rails 4.x with Mongoid 5.x use branch rails4-mongoid5
* Rails 4.x with Mongoid 4.x branch rails4
* Mongoid 3.x with older versions of rails use v 0.3.0

## ♻️ INFO

This gem has been brought into the ActiveAdmin org for support and maintenance.

# ActiveAdmin::Mongoid

ActiveAdmin hacks to support Mongoid.
Some ActiveAdmin features are disabled or not working properly:

- comments are disabled by default
- filters are somewhat broken

For more on Mongoid support in ActiveAdmin see [this issue](https://github.com/gregbell/active_admin/issues/26).

## Installation

### Some Gems
Add the following gems to your application's Gemfile, and lock the version:

```ruby
gem 'activeadmin-mongoid', '1.0.0'
gem 'ransack-mongoid', github: 'activerecord-hackery/ransack-mongoid'
```

You can safely remove the following lines, since are already activeadmin-mongoid dependencies:

```ruby
gem 'activeadmin'
```

### Remove Application Dependencies
In your config/application.rb, replace:

```ruby
require 'rails/all'
```

with:

```ruby
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "action_view/railtie"
require "sprockets/railtie"
require "rails/test_unit/railtie"
```

NOTE: This gem will NOT work if you use both ActiveRecord AND Mongoid in the same app.  rails/all includes elements requiring ActiveRecord::Connection

### Bundle & Crank

Execute:

    $ bundle
    $ rails g devise:install
    $ rails g active_admin:install

Check that the generated initializers/devise.rb file requires mongoid orm.
You may find a line like this :

```ruby
require 'devise/orm/mongoid'
```

Then create an admin user:

    $ bundle exec rails console
    >> AdminUser.create email: '<EMAIL>', password: 'password', password_confirmation: 'password'

And that's pretty much it !

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

## Copyright

Copyright © 2012 <NAME>. See LICENSE for details.

[rubygems_badge]: https://img.shields.io/gem/v/activeadmin-mongoid.svg
[rubygems]: https://rubygems.org/gems/activeadmin-mongoid

{'fraction_non_alphanumeric': 0.1006120316465144, 'fraction_numerical': 0.012539184952978056, 'mean_word_length': 4.560165975103734, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 25, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2781032', 'n_tokens_mistral': 2130, 'n_tokens_neox': 1987, 'n_words': 773}