similar to: Changing the current connection for Active Record

Displaying 20 results from an estimated 30000 matches similar to: "Changing the current connection for Active Record"

2005 Mar 24
0
PATCH for Active Record 0.9 SQL Server Adapter problem => Rails 0.11does not work with SQL Server
I just checked out the latest sqlserver_adapter.rb from the SVN repository, and it seems to work fine. -----Original Message----- From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Neville Burnell Sent: Thursday, 24 March 2005 2:25 PM To:
2006 Jan 18
1
Helps!!!!! Rails database connection guru needed!!!!!!!
Hi, I really need help to understand what is happening while Rails connect to a database, (we area actually using postgresql, so my example will be with postgresql) What I understand is Rails is able to connect to different DB. Actually, this is what we want, and we have made some tests, everything is juste fine. However, all these tests lead us to some important questions that we did find the
2006 Jul 24
7
[PATCH] Support for DB Clusters/Replication in ActiveRecord (RFC)
Skipped content of type multipart/alternative-------------- next part -------------- Index: connection_adapters/abstract/connection_specification.rb =================================================================== --- connection_adapters/abstract/connection_specification.rb (revision 4617) +++ connection_adapters/abstract/connection_specification.rb (working copy) @@ -1,10 +1,21 @@ require
2005 Aug 28
1
Active Record problem
Hi all I am new to Rails, and obviously I''m missing something, I''ll get straight to the question: A User has many operations (granted to her), each Operation is associated with an OperationType. Each Operation may be associated with more then one User. So the model goes like this: class User < ActiveRecord::Base has_and_belongs_to_many :operations
2006 Jan 24
3
what this line means exactly? (@@active_connections ||= {})
Hi, I have problem to understand this line does exactly? this is from the class ConnectionSpecficication, methode "active_connections" def self.active_connections #:nodoc: if allow_concurrency Thread.current[''active_connections''] ||= {} else @@active_connections ||= {} end end what the line "@@active_connections ||= {}" means exactly? as I
2006 Jun 26
1
Separate Read and Write Database
Hello, I need to access an mirrored database with one read and one write cluster. Is there a way to tell a model to use two connections? So that all updates etc go to the write database and all read from the read one? This is a fixed set up I can not use MySQL 5.x stuff and additionally i get a token on write, which can be checked on read (and wait for replication) if new data is needed. I
2005 Dec 15
2
Checking the existance of a NOT NULL constraint from Active Record
Hi, I'd like to check the existance of a NOT NULL constraint for a given attribute using ActiveRecord. Is this possible or do I have to painstakingly query the information_schema myself? I need this for some reflection in a custom association. Thanks, - Rowan -- Morality is usually taught by the immoral. _______________________________________________ Rails mailing list
2005 Jul 24
0
[Active Record] Missing optional client encoding for MySQL 4.1
MySQL since version 4.1 can use utf-8 for multilangual tables, and it uses almost the same approach like PosgreSQL where Active Record API writes: ":encoding — An optional client encoding that is using in a SET client_encoding TO <encoding> call on connection." However ActiveRecord API does not mention how to set up optional client encoding for MySQL 4.1...
2005 Sep 29
2
[BUG] Quick Fix for SCGI leaked DB connections
Hi Folks, I believe I tracked down the problem with the leaked DB connections. The simple fix is to put: ActiveRecord::Base.threaded_connections = false In your environment.rb file right before environment.rb does any ActiveRecord use. For example, here''s mine: ActiveRecord::Base.threaded_connections = false ActiveRecord::Base.configurations =
2006 Jan 26
0
If you want to disconnect a database properly, there is the code:)!!!
Hi, We have worked on a problem of connection: Connect to two databases with a single ActiveRecord::Base model class within the same action The main difficulty is how to disconnect the actual connection properly and then let the ActiveRecord establishes a new one. The actual function "remove_connection" removes the connection, but its doesn''t unbind the link between rails and
2005 Sep 09
1
meaning on active record error message
Hi everyone, I received an error message as below: Couldn''t find Project with ID in (''--- :all'',''--- \n:order: number ASC'') and it point to a statement in my controller: @projects_by_user = @an_user.projects.find(:all, :order=>"number ASC") I checked the log file, it seems the sql statement is executed with returned result. Would
2005 Dec 16
6
active record outside of rails
I really like how Active Record logs the SQL that is executed inside of rails. Is there a way to get the SQL output when using Active Record outside of rails? Thanks, phil _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
2011 Jul 26
0
active record wants root password, not sure why ..
When I run a command program (rails 3/ruby 1.9.2) as this: class MsdsAttr < ActiveRecord::Base include MsdsAttrModule belongs_to :attribute_record, :polymorphic => true has_many :attribute_values, :foreign_key => ''attribute_id'' has_many :alt_values, :as => :alternative has_many :msds_ingredients end ActiveRecord::Base.establish_connection( :adapter =>
2007 Nov 15
0
Problems connecting to remote Oracle DB on windows using active record
I am trying to connect to an older oracle DB remotely, I think version 8 or 9. I downloaded the instant client stuff from oracle and copied oci.dll and oraociei10.dll to my windows/system folder (windows XP) I get the error. C:\rb-play>ar_connect_ss.rb env.c:257:in oci8lib.so: ORA-12514: TNS:listener does not currently know of serv ice requested in connect descriptor (OCIError) from
2005 Dec 05
0
bug in bubbleshare's Active Record extensions?
I''m using add_foreign_key_constraint and remove_foreign_key_constraint from Bubbleshare''s Active Records Extension plugin now to manage the foreign key relationships I describe in my other recent posting. The constraints get added within migrations, but I''m running into two problems (Rails 0.14.3, PostgreSQL db): 1. Dumping the schema doesn''t dump the
2011 Jul 27
0
require specific version of active record
I have been having a strange problem with including active record outside of rails when it works ok in rails 3.0.3. When I do ''gem list'', I get this: actionmailer (3.0.9, 3.0.3) actionpack (3.0.9, 3.0.3) activemodel (3.0.9, 3.0.3) activerecord (3.0.9, 3.0.3) activeresource (3.0.9, 3.0.3) activesupport (3.0.9, 3.0.3) So then I tried the code below, but I get this error:
2006 Nov 04
0
Active Record and consistency
I''m running into a bit of a ideological and functional problem with ActiveRecord and would like to find out if some of these concerns are valid. Hopefully someone here already knows the answer... The concerns are that ActiveRecord has a lot of activity involving data validation (validates_uniqueness_of, validates_associated) and model definition (belongs_to, has_many, has_one).
2008 Jul 31
2
Freeze field in active record
Hello, I have a freeze field in a table (that I can''t change). When I try to find a record in this table I have the exception : C:/DATA/InstantRails-2.0/ruby/lib/ruby/gems/1.8/gems/ activerecord-2.1.0/lib/active_record/attribute_methods.rb:104:in `instance_method_already_implemented?'' C:/DATA/InstantRails-2.0/ruby/lib/ruby/gems/1.8/gems/
2009 Apr 28
1
help active record modeling.
Hi. I have difficulties to model active record. So please help my trouble. Let''s suppose there are nations which have castles at least 1, and there are 3 types of castles. So I will make these tables. NationsTable, CastlesTable have common attributes of 3 types of castle. CastlesATable, CastlesBTable, CastlesCTable each have its unique attributes. In this case how can I represent
2006 Jun 22
1
Active Record question, orphaned children
I have a Deck object and a Card object with their corresponding tables. (You know a deck of cards.) When I destory a Deck it leaves orphaned cards in the database. Is there a way to set up the objects with ActiveRecord so that when a parent object is destoryed the child objects are destroyed as well? My code below. class Deck < ActiveRecord::Base has_many :cards end class Card <