Displaying 20 results from an estimated 1000 matches similar to: "[Tip] Introspection to determine if a column may be null"
2008 Mar 14
15
Is anyone running Rails 2.x against a MS SQL Server DB?
I am unable to get ActiveRecord session support to work under 2.x
against a SQL Server database. I''m starting to wonder if anyone is
running 2.x against SQL Server?
Is anyone running under the following configuration:
Rails 2.x
SQL Server 2000 DB (using AR adapter in ODBC mode)
AR store for ActionController session store.
I''d like to chat with you if you are.
Thanks,
Wes
--
2009 Sep 28
5
Multi-databases support
Hi,
While I was hacking ovirt-server, I have found that it's currently
restricted to Postgres DB. Even if I like postgres for serious work on a
server, I really prefer to hack/dev locally on a Sqlite or MySQL DB.
I have googled on rails in order to find a good answer for the "foreign
key problem" which forces OVirt to stay on pg. I have found a plugin on
this particular
2006 Jan 19
3
problems with migrations in sql server
Is anyone using migrations with a SQL Server database who might be able to
lend me a hand? I''ve used migrations with MySql in the past and haven''t
run into any issues so forgive When I run rake migrate nothing is actually
getting updated in my database. I created a migration using
./script/generate migration AddFooTable and updated the migration to look as
follows:
class
2005 Nov 24
1
Log question
development.log contains quite a few SELECTS on system tables like
COLUMNS. Wouldn''t it be more efficient to cache this info?
I''m also wondering about strings like "[4;35;1m". What''s their purpose
and is it possible to get rid of them? They look like screen coordinates
and makes no sense in a text file.
Christer
Processing ReportController#create (for
2010 Nov 25
1
RODBC
Hi,
I am running the RODBC examples form the help guide. I am trying to
UPDATE a table in an Access data base but I am having an error.
library(RODBC)
library(termstrc)
path = getwd()
setwd(getwd())
dbName = "data.mdb"
pathdbname = paste(path,"/",dbName,sep="")
accesChannel = odbcConnectAccess(pathdbname, uid = "", pwd = "")
2005 Aug 17
1
RODBC and sqlColumns
I have a Postgres database that I am connecting to with the Postgres
ODBC driver on Windows XP in R 2.1.0. In the database is a database
with two schemas (public and X). With RODBC (1.1-4) , I can connect to
the database and get the tables with sqlTables(db). I can query tables
in the schema with sqlQuery("SELECT * FROM X.test"). However, I can't
get the columns in table X.test
2005 Dec 17
1
lost in an ActiveRecord::StatementInvalid
I have an error I don''t know how to debug. I am adding the login
suport in Depot (the example in the RoR book) and
LoginController#add_user throws ActiveRecord::StatementInvalid in an
innocent /login/add_user GET request.
The trace goes down to a call to SQLiteAdapter#table_structure, and
the source code suggests what''s happening is that "PRAGMA
2006 Jan 11
8
Oracle and Rails seems really slow.... In development
I''m just looking into how to connect to Oracle using Rails. I''ve got
everything connecting and working as it should.
I have a Users table in Oracle:
create_table "users", :force => true do |t|
t.column "username", :string
t.column "created_on", :datetime
t.column "email", :string
t.column "note", :text
2006 Oct 15
3
Migrations - add_column :default=>true, :null=>false
This seems pretty brain dead:
add_column :types, :notify_on_create, :boolean, {:default=>true,
:null=>false}
$ rake migrate
Error: ERROR: column "notify_on_create" contains null values
: ALTER TABLE types ALTER notify_on_create SET NOT NULL
Why doesn''t Rails set the new column to true, as it''s supposed to
default to? I tried :default=>1 as well (same
2006 Jan 10
5
problems overriding module with plugin
Hi I am trying to create a plug-in to fix the error in the rails core
produced by the multiple delete on a HABTM relationship. I have
confirmed that my plug-in is being included into the base during
runtime however the code does not seem to be overridding the base
class.
module ActiveRecord
module Associations
module ClassMethods
def has_and_belongs_to_many(association_id, options =
2005 Dec 22
2
nonstandard postgresql sequence names
I''m working with a legacy postgresql database where the names of tables,
columns, etc., do not usually follow Rails conventions.
I''ve been able to work around it for the most part, but I ran into this:
I have the following test:
require File.dirname(__FILE__) + ''/../test_helper''
class SponsorTest < Test::Unit::TestCase
self.use_transactional_fixtures =
2007 Jun 21
3
Sqlite3, in-memory db and rspec_server
Hi everyone.
I can''t get the above(subject line) combination to work. If I use a
standard sqlite3 file db for the test db, and spec_server all the
specs on my models pass. If I use an in-memory db for the test db,
script/spec w/o spec_server, they all pass. But if I use in-memory and
spec_server I get the following error:
1)
ActiveRecord::StatementInvalid in ''User should be
2012 May 21
4
Getting model column names
Hello,
I am writing a RoR application that connects to a couchDB database using
couchrest_model.
The definition of my model is the following one:
class BdsDataAuthor < CouchRest::Model::Base
property :id, Integer
property :first_name, String
property :last_name, String
end
I would like to be able to get the list of the model columns, e.g., the
result of
BdsDataAuthor.columns would be
2006 Mar 09
3
Building a model from a database view
Hi,
I''m trying to use rails to build a model from a database view.
I get this output
C:\dev\v6\project>ruby script/generate scaffold Assignment
...
error Before updating scaffolding from new DB schema, try creating a
tab
le for your model (Assignment)
Is this not possible in Rails? It would be *really* helpful for my
application.
-------------- next part --------------
An
2006 Feb 28
10
Salted hash login, postgresql, unit tests
Hello,
I have tried to install the salted hash login generator by following the
quick start guide at:
http://wiki.rubyonrails.com/rails/pages/SaltedLoginGeneratorQuickstart.
Everything seems to work fine until I try to run the unit tests by doing
''rake test_units'', then I get the following error message:
<error-message>
[brasse@keso login-test]$ rake test_units
(in
2006 Feb 07
5
OCI adapter slowdown on dictionary access
Hi,
after some experience with Rails on MySQL databases I gave it a try on one
of our larger Oracle database.
I was facing a problem when Rails tried to detect the columns for a
model/table. The appropriate statement ran about 1 min which led to a
timeout.
Our Oracle guru told me to analyze the SYSTEM schema. After that hadn''t
helped, he said the only remaining chance is to use a
2006 Apr 17
7
MySQL backticks and column names
The upgrade to Rails 1.1 hurt my ability to run tests because it
generated the following MySQL error:
Mysql::Error: You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to
use near ''key ON config (key)'' at line 1: CREATE UNIQUE INDEX key ON
config (key)
I have a table called `config` with a column
2010 Aug 22
1
rails3: t.index in migrations not working anymore
Hello,
I''m playing around with Rails3 and trying to upgrade one of my
applications to Rails 3.0.0.rc and I get an error which should be still
working.
Migration:
t.index :name
When I execute rake:
rake aborted!
An error has occurred, all later migrations canceled:
undefined method `index'' for
#<ActiveRecord::ConnectionAdapters::TableDefinition:0x4b2b6b0>
Does some one
2016 Mar 24
10
C5 MySQL injection attack ("Union Select")
mysql Ver 14.12 Distrib 5.0.95, for redhat-linux-gnu (x86_64) using
readline 5.1
I spotted something strange and immediately installed a routine to
automatically impose an iptables block when the key used for database
access is excessively long.
My URL was something like this
...../...../.....php?key=123456
The injection was something like this
2006 May 15
8
set_table_name and self.table_name
I have some legacy tables that I used set_table_name on, I''m attempting
to write a method that will get key value from a sequence table and then
update it and return a value. I''m hoping to put this in the base
ActiveRecord method so I would like to reference the table name with
self.table_name or something...
class Contacts < ActiveRecord::Base
set_table_name