Sha256: 44134df50a550e253ce45f819c2b8bd9480af3ce685e35a01170b290ba225762

Contents?: true

Size: 1.16 KB

Versions: 1

Compression:

Stored size: 1.16 KB

Contents

require "ensembl/version"
require 'active_record'
require 'yaml'
require 'active_support/core_ext'

module Ensembl
  # Load configuration from database.yml
  ActiveRecord::Base.configurations = YAML::load(IO.read('config/database.yml'))

  module TableNameOverrides
    def table_name
      self.name.split('::').last.underscore || ''
    end
  end

  module PrimaryKeyOverrides
    def primary_key
      self.table_name + '_id'
    end
  end

  # module AttributeLike
  #   def a_like(attribute, string, search_type=:between)
  #     at=self.arel_table
  #     if search_type == :ends_with
  #       where(at[attribute].matches("%#{string}"))
  #     elsif search_type == :starts_with
  #       where(at[attribute].matches("#{string}%"))
  #     else
  #       where(at[attribute].matches("%#{string}%"))
  #     end
  #   end
  # end
end

require File.dirname(__FILE__) + '/ensembl/helpers/like_search.rb'
require File.dirname(__FILE__) + '/ensembl/core/activerecord.rb'
require File.dirname(__FILE__) + '/ensembl/helpers/variation_position.rb'
require File.dirname(__FILE__) + '/ensembl/variation/activerecord.rb'
require File.dirname(__FILE__) + '/ensembl/variation/tableless.rb'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ensembl-0.0.7 lib/ensembl.rb