Displaying 20 results from an estimated 1000 matches similar to: "Where to override ActiveRecord::ConnectionAdapters::SQLServerAdapter?"
2006 Feb 01
0
Please explain transactions within sqlserveradapter.rb ?
Hello everyone,
I am needing to resolve an error on sqlserveradapter revolving around a
trigger on a table. When the AR object is saved, AR throws
Cannot create new connection because in manual or distributed transaction
mode.
at
from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract_adapter.rb:88:in
`log''
In order to resolve this, I
2006 Aug 02
2
mangle ActiveRecord
Dear Gurus on Rails!
How do I change the behaviour of one method in
ActiveRecord::ConnectionAdapters::SchemaStatements ?
Full story:
I''d like to mangle
ActiveRecord::ConnectionAdapters::SchemaStatements
so when it creates a new sql table, it also (optionally) creates my
created_at, deleted, key_id, session_id etc columns that I use on basically
all tables.
It would not be DRY to repeat
2008 Feb 26
5
Rails 2.0.2 MySQL 'year' datatype missing from ActiveRecord?
Hi all,
This is my first post to the forum, and I''ll point out right away that
I''m a noob to everything, Ruby, Rails, MySQL, etc., so I expect that I''m
wrong here, but is the ''year'' datatype missing from ActiveRecord in
2.0.2? According to my MySQL 5.0 reference manual, ''year'' is a datatype,
but when I try to run a migration that has
2006 Feb 07
0
Creating DB from within Rails
Hi,
Is it possible to create a new database (I know how to establish a
secondary connection) from within rails, using ActiveRecord::Schema?
There''s a create_database method under
ActiveRecord::ConnectionAdapters::SQLServerAdapter but I don''t see
similar methods for the other adapters.
Thanks,
Mike
2007 Sep 04
2
Use of uniqueidentifer type for primary key?
I''m working on a legacy SQL db. It is distributed, to they are using
the uniqueidentifier type for the primary key.
At first, at least, I won''t be updating records, but I''m seeing a lot
of negativity about using anything other than incrementing integers
for the pk--which are obviously inadequate for this environment.
It is enough to use set_primary_key? Do I need
2008 Mar 19
2
ActiveRecord bug? ActiveRecord::ConnectionAdapters::Column.type_cast for float columns
Hi all,
I just noticed that in ActiveRecord::ConnectionAdapters::Column.type_cast[1]
(and type_cast_code[2]) the type casting for float columns simply does
value.to_f, whereas all the others have a rescue or call out to a method,
the default implementations of which have rescues or enough logic in that I
don''t think they''d fail.
Imagine the following:
create_table :vehicle do
2006 Apr 08
4
Calling validates_inclusion_of out of default namespace
Hi,
I''m trying to run the "validates_inclusion_of" method in a before_save hook,
because the range is dependant on the related data. But I can''t figure out how
to call it. When calling it normally, it says it can''t find it.
I''ve tried several combinations like
"ActiveRecord::Validations.validates_inclusion_of", but I can''t seem to
2008 Jun 24
9
ActiveRecord 2.1 Migration support
Hi all,
I am in the process of adding Migration support to the Ingres
ActiveRecord adapter and have run in to a problem. During the call to
create_table the Ingres adapter some how causes ruby to blow the stack
and coredump/segv. I have tracked down the problem down to
"add_column_options!" in
"lib/active_record/connection_adapters/abstract/schema_statements.rb".
2008 Jun 24
9
ActiveRecord 2.1 Migration support
Hi all,
I am in the process of adding Migration support to the Ingres
ActiveRecord adapter and have run in to a problem. During the call to
create_table the Ingres adapter some how causes ruby to blow the stack
and coredump/segv. I have tracked down the problem down to
"add_column_options!" in
"lib/active_record/connection_adapters/abstract/schema_statements.rb".
2008 Nov 03
17
SQL queries in Rails
Hi...
I want to know the equivalent instructions to insert, update, search
and delete a registry. I know Rails can do it easily Thanks to
ActiveRecord, but here''s the catch: I''m using PostgreSQL. As I''m using
SQL to do the migration (Including the foreign keys), I need to know
if I can use SQL queries to do those actions. Is there an example out
there?
I uncommented
2010 Sep 02
1
ActiveRecord::ConnectionAdapters::Column value_to_boolean(value) does not return a boolean value.
value_to_boolean(value), does not always return a boolean value, only
when true.
150: def value_to_boolean(value)
151: if value.is_a?(String) && value.blank?
152: nil
153: else
154: TRUE_VALUES.include?(value)
155: end
156: end
If value is contained in TRUE_VALUES then it returns true(TrueClass).
But if value is
2016 Jan 26
2
Corregir mismo ID para individuos diferentes en una serie temporal
Hola,
Please, mira si esta vez funciona:
#----------------------------------------------
ID <- c(1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6,
1, 2, 6, 8, 12, 7, 15, 16, 17, 18, 19, 20, 1, 21, 22, 19 )
Year <- c (1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6)
df <- data.frame (ID, Year)
df
ID <- c(1,
2004 Dec 03
0
[LLVMdev] [Fwd: Updated LLVM Visual Studio project files]
On Fri, 3 Dec 2004, Reid Spencer wrote:
> Could someone please apply this patch to the Win32 support so that
> Morten and Jeff can handle the recent changes? I can't do it because
> I"m on the road with only email access.
I'd be happy to do it. Can someone send me the patch as an attachment
off-list?
-Chris
> > <Tool
> >
2016 Jan 26
2
Corregir mismo ID para individuos diferentes en una serie temporal
Hola,
Antes de nada, muchas gracias por tu ayuda.
El código se ha acercado bastante, pero no termina de funcionar porque considera cada captura de un individuo como años consecutivos aunque haya pasado más tiempo entre ellos.
Por ejemplo el individuo 4 es capturado por primera vez el año 1 y por segunda vez el año 3, por lo que debería de ser renombrado ya que en este ejemplo en concreto
2007 Dec 27
0
SAS to R - if you have SAS 8.2+
Hi there,
the attached R function uses the SAS Integrated Object
Model (IOM) and it can deal with SAS dates and long
variable names. All you need to provide is the folder
where the SAS data file is and the data file name
without the extension. The function requires the rcom
package.
This is meant to be first cut...but improvements and
suggestions are more than welcome!
Gyula
import.sas.data
2006 Feb 28
0
ActiveRecord: Legacy primary keys
Hi,
I''m building a frontend for a legacy schema, with tables like this:
CREATE TABLE `types` (
`a_type_cd` varchar(6) NOT NULL default '''',
`a_type` varchar(30) NOT NULL default '''',
PRIMARY KEY (`a_type_cd`)
);
The primary key is specified by the user (not auto-generated), and needs
to be updateable. I create the following a base class to
2013 Jan 21
1
Percentiles with R for a big data.frame
Dear R users,
I came up to a problem dealing with percentiles in R.
>From my previous questions: I do have a big data.frame, with lots of
columns and rows. The following command enables me to calculate means for
all data frame.
dat1$newID<-rep(1:(nrow(dat1)/12),each=12) #if nrow(dat1)/12 is integer
dat2<-with(dat1,aggregate(cbind(dat1[,1:71]),by=list(newID),mean))
What I need is to
2004 Dec 03
2
[LLVMdev] [Fwd: Updated LLVM Visual Studio project files]
Could someone please apply this patch to the Win32 support so that
Morten and Jeff can handle the recent changes? I can't do it because
I"m on the road with only email access.
Thanks,
Reid.
-----Forwarded Message-----
> From: Morten Ofstad <morten at hue.no>
> To: Reid Spencer <reid at x10sys.com>
> Subject: Updated LLVM Visual Studio project files
> Date: Thu,
2010 Feb 26
2
Problem accessing sub-methods of functions stored in a vector
Hi folks,
I am having trouble accessing sub-functions when the main function is
stored in an array. For example, the following test code works fine:
fcns = c(abs, sqrt)
fcns[[1]](-2)
fcns[[2]](2)
However, when I try to access sub-functions declared within list() in a
function, this only works directly. When I try to access these within an
array only the first declared sub-function is run.
2008 Jan 03
0
Wx::Menu, get parent menu functions?
I have been looking in the API Docs for get_parent type stuff for the
Menu''s - so I can track a click path across sub-menus and have not found
anything. Are there really no functions for that or did I just miss the
right place to look?
If it is true then consider this below:
class MyMenu < Wx::Menu
def initialize(mymasterclass, name = nil, id = -1, parent_menu = nil,
title =