Module: Sequel
- Defined in:
- lib/sequel/serializer/xml_serializer.rb,
lib/sequel/core_patch.rb,
lib/sequel/metaprogramming.rb,
lib/sequel/pervasive_adapter.rb,
lib/sequel/serializer/serializer.rb,
lib/sequel/serializer/json_serializer.rb
Overview
:nodoc:
Defined Under Namespace
Modules: Metaprogramming, Pervasive, Serialization Classes: Model, XmlSerializer
Class Method Summary collapse
- .fos(odbc_name, opts = {}) ⇒ Object
- .fos_dbr(opts = {}) ⇒ Object
-
.fos_id_to_lookup_key(fos_id) ⇒ Object
take a fos_id like: “SEMJ.0.15.40210.1342” and convert to [“SEMJ”, 0, 15, 40210, 1342].
-
.set_db(db) ⇒ Object
sets the db to all sequel models.
Class Method Details
.fos(odbc_name, opts = {}) ⇒ Object
4 5 6 7 8 |
# File 'lib/sequel/core_patch.rb', line 4 def fos(odbc_name,opts={}) db = Sequel.odbc(odbc_name,opts) db.extend(Sequel::Pervasive::DatabaseMethods) db end |
.fos_dbr(opts = {}) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/sequel/core_patch.rb', line 10 def fos_dbr(opts={}) db = Sequel.mysql(opts) db.extend(MySql::Pervasive::DatabaseMethods) # require the dbr libs Dir["#{File.dirname(__FILE__)}/../dbr_models/*.rb"].each{|f| load f} db end |
.fos_id_to_lookup_key(fos_id) ⇒ Object
take a fos_id like: “SEMJ.0.15.40210.1342” and convert to [“SEMJ”, 0, 15, 40210, 1342]
24 25 26 |
# File 'lib/sequel/core_patch.rb', line 24 def fos_id_to_lookup_key(fos_id) fos_id.split('-').collect{|v| v.match(/\d+/) ? v.to_i : v} end |
.set_db(db) ⇒ Object
sets the db to all sequel models
19 20 21 |
# File 'lib/sequel/core_patch.rb', line 19 def set_db(db) Sequel::Model.find_children.each { |klass| klass.to_s.constantize.db=db } end |