Project

detectify

0.03
No commit activity in last 3 years
No release in over 3 years
Detectify provides a simple way to retrieve an ActiveRecord entity based on the domain/subdomain request information.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.12
~> 9.0
~> 0.8
~> 2.0
~> 10.0
~> 3.0

Runtime

>= 1.6
 Project Readme

Detectify

Gem Version Code Climate Coverage Status Build Status

Detectify provides a simple way to retrieve an ActiveRecord entity based on the domain/subdomain request information.

It’s a Ruby gem, similar to Houser, that helps you retrieve an Active Record entity from a database with a URL. You know Houser is a multi-tenancy gem that can send database requests using subdomain names. But Houser is a relatively old Ruby library. For modern Rails-based SaaS apps, we wanted more flexibility. That's why we've developed Detectify. For more information, you can read here Detectify review.

Installation

Add this line to your application's Gemfile:

gem 'detectify', github: 'rubygarage/detectify'

and then execute: $ bundle

Finally, restart the server to apply the changes.

Detectify only supports applications built with Ruby 2.2.2 and Rails 4.2 or higher.

Usage

Start off by generating an initializer:

$ bundle exec rails g detectify:install

this will create file config/initializers/detectify.rb in your application directory.

You can configure Detectify for your application needs via initializer. After this you can access detected entity via: request.env['Detectify-Entity'].

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/rubygarage/detectify. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.


RubyGarage Logo

RubyGarage is a leading software development and consulting company in Eastern Europe. Our main expertise includes Ruby and Ruby on Rails, but we successfully employ other technologies to deliver the best results to our clients. Check out our portfolio for even more exciting works!