No release in over a year
Adds Filemaker Rest to the orm_adaptor project.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.17
~> 10.0
~> 3.0

Runtime

>= 3.0.0, < 8.0.0
>= 3.0.0, < 8.0.0
~> 0.18
~> 0.5, >= 0.5.0
 Project Readme

OrmAdapter::Fmrest

Adds Filemaker Rest to the orm_adaptor project.

ORM Adapter

Provides a single point of entry for popular ruby ORMs. Its target audience is gem authors who want to support more than one ORM.

For more information see the orm_adapter project.

FmRest

A Ruby client for FileMaker's Data API with ActiveRecord-ish ORM features.

For more information see the fmrest-ruby gem.

Installation

Add this line to your application's Gemfile:

gem 'orm_adapter-fmrest'

And then execute:

$ bundle

Or install it yourself as:

$ gem install orm_adapter-fmrest

Devise

Devise is a flexible authentication solution for Rails.

For more information see the Devise.

And now you can use Devise authentication based on Filemaker REST ORM.

Add the following lines to Gemfile:

gem 'fmrest-ruby'
gem 'orm_adapter-fmrest'
gem 'devise'

And then configure Devise using "--orm fmrest" parameter:

$ rails generate devise:install --orm fmrest

or require 'devise/orm/fmrest' in your config/initializers/devise.rb manually.

After that you can create User model:

class User < FmRest::Layout
  layout('your_user_layout')
  extend Devise::Models
  include ActiveModel::Validations
  include ActiveModel::Validations::Callbacks

  devise :database_authenticatable, :rememberable, :trackable

end

Date/Time coerce

as Devise uses time calculation, FileMaker Date/Time fields must be converted from the internal string representation to Date/Time classes.
fmrest needs to be configured to do so, see DateFields in the fmrest documentation.

Set either in FmRest.default_connection_settings or in the model's fmrest_config

coerce_dates: true

or

coerce_dates: :full

Known Limitations and Issues

  • There is no unit test. Fill free to add it.

Acknowledge

Part of the code and logic (i.e. devise compatibility) is ripped from orm_adapter-her.

Contributing

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

License

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