No release in over 3 years
Low commit activity in last 3 years
Plugin to use Active Resource in Devise
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 4.7.1, < 5
>= 5.0.0, < 7
 Project Readme

Devise::Activeresource

Devise::Activeresource is an adapter that allows you to use devise with Active Resource in your models. It supports Devise >= 4.7.1 and Active Resource 5.1. It may work with earlier version of devise and activeresource, but it's not tested for those versions.

Usage

In the config/inititializer/devise.rb file, replace the default orm adapter:

  require 'devise/orm/active_record'

with the following:

  require 'devise/orm/active_resource'

Generators and API

This gem does not provide model generators because ActiveResource models adapt their attributes to the REST API you are consuming. These models may have an schema, but this is not enough to ensure proper operation.

To ensure the proper functioning of this gem, verify the REST API you are consuming, so that it contains the attributes you need for the operation of each module that you include in the model.

For more information of the attributes you need for module, look at the devise documentation.

Modules

This gem adds one aditional module to devise:

Models

The options to configure your models are the same of devise. The only consideration, is the Resource Authenticatable module. An example of a model:

class User < ActiveResource::Base
  devise :database_authenticatable, :rememberable,
         :resource_authenticatable

  self.site = 'https://some.api.com'
end

Installation

Add this line to your application's Gemfile:

gem 'devise-activeresource'

And then execute:

$ bundle

Or install it yourself as:

$ gem install devise-activeresource

License

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