Skip to content
/ rom-fmp Public

A ruby filemaker adapter for the rom-rb data mapping & persistence gem

License

Notifications You must be signed in to change notification settings

ginjo/rom-fmp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rom-fmp

A filemaker adapter for the rom-rb data mapping & persistence gem. See rom-rb on github or rom-rb.org for more information about Ruby Object Mapper.

Installation

Add this line to your application's Gemfile:

gem 'rom-fmp'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rom-fmp

Usage

require 'rom/fmp'

DB_CONFIG = {
  adapter:            'fmp',
  host:               'my.fm.server.com',
  account_name:       'my_account',
  password:           '12345',
  database:           'MyFmpDatabase',  
}

ROM.use(:auto_registration)
ROM.setup(:fmp, DB_CONFIG)

class Users < ROM::Relation[:fmp]
  register_as :users
  dataset :user_xml # Filemaker layout name.

  def by_login(name)
    find(:login=>name.to_s)
  end

  def activated
    find(:activated_at=>'>1/1/2000')
  end

end

rom_env = ROM.finalize.env

rom_users_relation = rom_env.relation(:users)

activated_users_by_login = rom_users_relation.activated.by_login

activated_users_by_login.call('bill').to_a
activated_users_by_login.('bill').to_a
activated_users_by_login['bill'].to_a

About

A ruby filemaker adapter for the rom-rb data mapping & persistence gem

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages