activerecord-jdbc

Using Sybase ASE 12.5.4 with jTDS drivers with JRuby

谁说胖子不能爱 提交于 2019-12-05 02:07:56
问题 Problem I am trying to build a small ruby script - which will be run using jruby once a day - to connect to a Sybase ASE 12.5.4 database and perform a complex query. Ultimately I intend to do some processing on the data and insert the new data in a MySQL table for use within a rails application. Environment jruby v1.4.0 java v1.6.0_15 on Ubuntu Karmic JRuby Installed Gems activerecord-jdbc-adapter (0.9.1) activerecord-2.3.4 Jruby Lib Directory jtds-1.2.5 Query SET rowcount 10 SELECT * FROM

CamelCase instead of snake_case in Rails DB

邮差的信 提交于 2019-12-05 00:24:09
问题 My DB tables and field names are in CamelCase. Is it possible to convert those names into snake_case on a fly? To make model methods look pretty? The app is JRubyOnRails 3.0 / MSSQL DB / ActiveRecord-JDBC-adapter. 回答1: @arkadiy,as a matter of fact, I was looking into this just this very day. For table names, we of course have the set_table_name method: class CamelCasedFoo < ActiveRecord::Base set_table_name :CamelCasedTable end For things like primary keys, we have set_primary_key: class

Using Sybase ASE 12.5.4 with jTDS drivers with JRuby

£可爱£侵袭症+ 提交于 2019-12-03 20:19:58
Problem I am trying to build a small ruby script - which will be run using jruby once a day - to connect to a Sybase ASE 12.5.4 database and perform a complex query. Ultimately I intend to do some processing on the data and insert the new data in a MySQL table for use within a rails application. Environment jruby v1.4.0 java v1.6.0_15 on Ubuntu Karmic JRuby Installed Gems activerecord-jdbc-adapter (0.9.1) activerecord-2.3.4 Jruby Lib Directory jtds-1.2.5 Query SET rowcount 10 SELECT * FROM TEST_TABLE Code Snippet require 'java' require 'jtds-1.2.5.jar' require 'rubygems' require 'active_record

Rails Schema creation problem

女生的网名这么多〃 提交于 2019-12-02 19:39:18
I am using Jruby and rails 2.2.2. My problem is I have a migration that is not being correctly written to the database schema. Here is my migration: class CreateNotes < ActiveRecord::Migration def self.up create_table(:notes, :options => 'ENGINE=MyISAM') do |t| t.string :title t.text :body t.timestamps end execute "alter table notes ADD FULLTEXT(title, body)" end Here is what it produces on in schema.rb create_table "notes", :force => true do |t| t.string "title" t.text "body" t.datetime "created_at" t.datetime "updated_at" end add_index "notes", ["title", "body"], :name => "title" I have two