similar to: Multi-statement transactions with ActiveRecord

Displaying 20 results from an estimated 30000 matches similar to: "Multi-statement transactions with ActiveRecord"

2007 Apr 12
5
Ruby-ODBC compiled for Windows... Anything newer than 0.997?
Hey :) We''re doing this large project, based on a legacy MSSQL database. We''ve had some issues, particularly with datetimes, when communicating with the server. These issues dissapeared after updating our ruby-odbc package to a new version (we''re developing on Linux and MacOS X, and connecting to the remote MSSQL server via FreeTDS and UnixODBC/iODBC, and then ruby-odbc
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 --
2006 Oct 11
5
Marshal Data too short error with ActiveRecord sess. storage
I''m seeing a "marshal data too short" error with an ActiveRecord store for my session data. Other posts say that this happens when the size of the session data exceeds the size of the "data" column in the sessions table. But my "data" column is a TEXT field so it seems unlikely that I could have blown it out. Has anyone else seen "marshal data too
2006 Jul 03
4
text_field doesn''t call overridden ActiveRecord getters
All, In a template, I have <%= text_field :target_list, :DateReceived, { :title => ''uploaded_at'', :class => ''target_list_info'', :disabled => ''true'' } %> Here is the DateReceived method on my
2006 Apr 17
3
Does render() have 2 be last statement in controller method?
I have a controller method that is attempting to do a render based on a potential error condition. So I have if (condition) render() else ..other code end ....other code in method Should I expect the render to take place immediately or does the render call not work because it isn''t the last statement in the method? Thanks, Wes -- Posted via http://www.ruby-forum.com/.
2006 Sep 09
1
Getting Valid ENUM Values in ActiveRecord
I know that Rails doesn''t handle database ENUMs. I''d say that 9/10, you can get away with just using varchar instead. However, there ARE instances where you need certain functionality that ENUMs provide (ie: integrity at the datalevel). I have a working function that will show what enum types are available for a certain column in a table (I believe this will only work for
2006 Mar 13
2
Newbie: Can''t get file to upload
Since I can''t get the fancy upload progress thing to work, I thought that I would revert back to a regular file upload scenario. I have a very simple file upload form set up. It appears that my file parameter is coming into the controller as a string, not a file object. Here''s my view: <%= form_tag :action => ''save_HTML'', :multipart
2008 Nov 06
0
problems executing a bulk load with SQL server
Hello, New to this forum so I hope the content is appropriate... I was building a some code to maniputlate some data. Given the bulk of it (the csv is about a GB), I opted to use a database. The setup, which may be part of the issue is that the SQL is one remote machine (call it 'A'), the disk that contains the data is on some other remote drive - call it 'B' and the server on
2006 Mar 14
5
Column aliasing in ActiveRecord?
Anybody know of a way to alias a column in ActiveRecord such that you could reference it via a different symbol in your view for view purposes? Like my column is named X but I want to display it as Y and maybe I have an accessor named Y set up on the model so that when I "call" Y from the view (and controller?) I''m actually manipulating the column X? Hope that makes sense.
2006 May 23
2
Can Win32 service more than one rails request at atime?
> On 5/23/06, Walter <Walter at mwsewall.com> wrote: > [...] > > I realize that mongrel is not thread safe, I was hoping mongrel might > spawn a few processes and serve them in the background to emulate what I > wanted. > > > > Rails is not thread-safe. > Yes, that?s what I meant. <snip> > > The idea of the BackgroundDrb is that you perform
2006 Oct 27
5
Purpose of after_initialize in ActiveRecord?
All, I have a quick question - is the purpose of implementing after_initialize to allow custom attribute initialization for AR descendants? I have been overriding initialize whenever I require custom setup of my model classes, like so: def initialize(attributes = nil) super self.Status = ''G'' end So I have a couple of questions: 1) Could I achieve the same
2007 Jan 19
0
Do transactions fail with polymorphic has_one relationships?
I have an AR::Base descendant with a complex object graph beneath it, like so: ArtisanQuoteInput has_one QuoteInput and then QuoteInput has several objects attached to it. Note that the relationship between ArtisanQuoteInput and QuoteInput is polymorphic, so the relationship in A is written has_one :quote_input, :as => :program_quote_input If @artisan_quote_input is an instance of
2006 Aug 09
0
ActiveRecord provides unnecessary default value (SQL Server)
All, ActiveRecord 1.14.3, sqlserver adapter, odbc mode I have a table in SQL Server with a smalldatetime column - let''s call it little_date. little_date is not allowed to have NULLs per the database schema. I am creating a new ActiveRecord object using obj.new (no database save) and calling obj.little_date. So I''m doing: obj.new obj.little_date What I observe is that if
2006 Nov 04
0
Weak DBI support for MSSQL (was rails and MSSQL transactions)
There is something seriously wrong with DBI support for SQL server. I have tried both DBI::ODBC and DBI:ADO and the following code always fails. ---------- Code require ''dbi'' host= "DEVELOPMENT_DATABASE_SERVER" database="adventureworks2000" username="someusername" password="Somepwd" db = DBI.connect("DBI:ADO:Provider=SQLOLEDB;Data
2003 Jan 13
1
Extensively slowing for(i in 1:400) statement
Hello! Here is what I have tried to do: 1. I have 400 time series 2. pull one serie at a time from ODBC 3. calculate some descriptives and regressions (about 50 statistic per serie) 4. store the results in the data frame The problem: The time consumed in each loop seems to grow linearly. I used the date() function for timing each loop and time spent in loop seems to grow at the speed of 0.6 *
2008 Apr 22
0
S3 method despatch (changed between 2.6.2 and 2.7.0 RC?)
Dear developers: I have observed a change in the behaviour of S3 method despatch (as I guess related to namespaces) between 2.6.2 and yesterday's 2.7.0 RC and would be grateful if you could comment on that: the 'Axis' function in the 'graphics' namespace calls UseMethod("Axis",x), internally to despatch on the S3 Axis method depending on the type of the argument.
2006 Jul 17
18
Inserting datetime value into SQL Server
I have a SQL Server column named StartTime of (SQL Server) type datetime If I attempt to set the attribute using public def StartTime=(time) write_attribute(:StartTime, "{ts ''1899-12-30 #{time.hour}:#{time.min}:#{time.sec}''}") end it''s inserting a NULL value. Anyone else able to successfully insert a date time value into a SQL Server table using
2006 Aug 09
10
Is there QA on Rails gem releases?
The ActionMailer/ActionPack gem release is still screwed up. Does someone test the gem releases to ensure that they work? Just an idea. Wes -- Posted via http://www.ruby-forum.com/.
2006 Mar 20
8
Best way to organize non-controller logic???
I don''t want to put certain code in my controller because I think it makes things more confusing. What is the best way to manage business logic such that it doesn''t end up in the controller? Basically, where should I put my regular utility classes and backing objects that may not be models? Thanks, Wes -- Posted via http://www.ruby-forum.com/.
2006 Jul 06
2
Custom init. of ActiveRecord objects - best practices
All, I''m wanting to initialize an ActiveRecord object. I understand that there is a method called after_initialize that appears to get called right after the ActiveRecord object is instantiated. Is after_initialize a Ruby thing or a Rails thing? Where is after_initialize documented? Can I pass parameters to it? If so, how? I want to initialize the "belongs_to" attribute of