search for: abstractadapt

Displaying 20 results from an estimated 26 matches for "abstractadapt".

Did you mean: abstractadapter
2008 Mar 06
1
ActiveRecord exception handling
Hi, I''m writing some scripts on the command line using ActiveRecord, and some interesting (read: confusing) things are happening with the way exceptions are caught and re-raised. In AbstractAdapter.log (connection_adapters/abstract_adapter.rb:144), Exception is rescued and reraised as an ActiveRecord::StatementInvalid exception. While in most cases I''m sure this is fine, Exception includes things like SystemExit and SignalException, which have nothing to do with invalid SQL. If I...
2006 May 25
4
Using an external database behind a firewall
Hi everyone, There''s a separate database I''m using to get mail group info for our users (Sympa), and I''ve got Rails configured to pull data directly from it via an entry in database.yml The issue we''re having is that the database server in question is behind an internal firewall that has idle timeouts set at 30 minutes. If the connection isn''t used
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 Apr 03
4
How to fake composite primary keys?
I know ActiveRecord doesn''t support composite primary keys, but I need to use one, and I need it ASAP. I don''t need any composite foreign keys, luckily; what I have is a table that stores old versions of rows in another table, so the composite key is an id + date stamp. Would someone tell me a hack I can use to support this? -- View this message in context:
2008 May 06
4
Git support - kinda works, have design questions
...create a project from Git repository, run a builder on it, and even run the dashboard. Build pages look ugly because build.label in git is very long, a bunch of unit tests is failing, and I had to disable some functionality, namely displaying source control errors in the dashboard. SourceControl::AbstractAdapter#execute_with_error_log (formerly known as Subversion::execute_with_error_log) had a bold assumption that any command writing anything in stderr has failed. This is not true for Git. Actually (and this really sucks), I even found a case where Git command returns a non-zero exit code upon successfu...
2005 Mar 04
17
active record logs format
Hi, I think this has already been asked on the list, but I can''t seem to be able to find it again: currently, active record does some weird thing with its sql logs i.e.: [4;33mSQL (0.000000) [1;37mPRAGMA table_info(map_locations) how do I remove the "[4;35m" thx Jean
2006 Aug 16
0
How to reconnect to the database?
...I''d like to do is catch that exception and then reconnect to the database. Hwo do I do this? I saw a reconnect! method, but I have no idea which object to run that on how how to actually use it. Here is where I saw it: http://api.rubyonrails.com/classes/ActiveRecord/ConnectionAdapters/AbstractAdapter.html#M000753 Do I just do Product.reconnect!, ha ha. I know that''s not right, but how do I use that reconnect! method? Thanks for your help. -- Posted via http://www.ruby-forum.com/.
2006 May 18
0
Showing SQL in script/console
Is there an easy way to display the SQL in script/console (similar to what is done in development.log)? The following works but it''s ugly: $ script/console Loading development environment. >> class ActiveRecord::ConnectionAdapters::AbstractAdapter >> def logger= (logr) >> @logger = logr >> end >> end => nil >> ActiveRecord::Base.connection.logger = Logger.new(STDOUT) => #<Logger:0x866a89f4 @level=0, @progname=nil, @logdev=#<Logger::LogDevice:0x866a7f7c @filename=nil, @mutex=#<Logger::Log...
2006 Apr 25
0
Migrate default now()
...ot; DEFAULT #{quote(options[:default], options[:column])}" unless options[:default].nil? end end sql << " NOT NULL" if options[:null] == false end end end end module ActiveRecord module ConnectionAdapters class PostgreSQLAdapter < AbstractAdapter def now(value, column) "current_timestamp" end end end end test code: class CreateUsers < ActiveRecord::Migration def self.up create_table :users do |t| # ... t.column :created_at, :timestamp, :null => false, :default => ''no...
2005 Feb 15
1
loggin
I''ve been in and out of everything I can find, and can''t find a way to make the logger stop adding ANSI code to the log. Is there a logger.cant_see_white_on_gray method? :-) TIA! Regards, JJ
2008 Dec 05
1
ActiveRecord Oracle and nvarchar2 or nclob datatype
Hi, I ve got oracle database which exists prior to my rails app... :-( I ve got trouble when I am updating/inserting records of a table which includes nvarchar2 attributes. These have a specific maximum length. I often get an error Value too long for column when doing my inserts/ updates, but in fact that is not the case. I ve taken a look at the generated sql statements.... As far as I know
2006 Nov 07
19
DrySQL
DrySQL is a plug-in that extends ActiveRecord to provide a complete DRY solution for Object-Relational Mapping. You''ve defined columns, constraints, relationships, and keys on your DB. With DrySQL you don''t need to re-define any of these things in your Ruby code. If you have tables, keys, and columns that don''t follow the Rails naming conventions, have a complex
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
2005 Dec 05
0
bug in bubbleshare's Active Record extensions?
...by/gems/1.8/gems/rake-0.6.2/lib/rake.rb:1454:in `run'' /usr/lib/ruby/gems/1.8/gems/rake-0.6.2/bin/rake:7 /usr/bin/rake:18:in `load'' /usr/bin/rake:18 The dispatch in method_missing is sending the message to the wrong module within the plugin (it should be to SchemaStatements, not AbstractAdapter). I''m at a loss as to how to fix that, as I''m still figuring out how ActiveRecord is wired internally. Anyone know how to fix? Thanks! F -- Posted via http://www.ruby-forum.com/.
2005 Dec 15
2
Migrations on SQLServer ??
Hello all, I''ve spent a while looking for a sniff of this on the wiki or google at large.. Does migrations work for SQL Server on 1.0 ? -- ------------------------------ Joyeux Noël ------------------------------ Peter Fitzgibbons _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
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
2005 Oct 17
8
Using active record for SELECT MAX(column) FROM ...
Hi, Is there an easy way of querying an active record for a maximum column value? I need to do queries like: SELECT MAX(salary) FROM employees TIA, Jeroen
2010 Oct 30
12
Anyone successfully ran JRuby 1.5.3, Rails 3, Tomcat6
Hi, I''ve been trying to get JRuby 1.5.3 with Rails 3 to run on the Tomcat6 server with little success. Has anyone been able to do this? If so, what issues did you have to overcome to get this to work? Also, is this a combination that you would recommend for a production site, or is it all too new and untested? The latest issue I''m stuck on right now is with the mysql-connector-
2005 Mar 06
9
How to do SQL queries outside of AR
Hi Everyone, I''m trying to figure out how to do SQL queries in the Controller. I know this is not recommended, but I can''t use ActiveRecord because I am dealing with thousands of a different tables, one for each user, and I don''t think AR can be made to handle that situation. You can assign the table name; but that''s a class variable so any particular
2006 Jan 05
7
HOWTO: Combine fields from 2 two tables in 1 object
Hi all, For a dropdownlist (showing "Company - FirstName Lastname'') I want to fill an object @project_contacts with "Name" from table Companies and "Firstname" and "Lastname" from table contacts. Any idea? Regards, Gerard. -- "Who cares if it doesn''t do anything? It was made with our new Triple-Iso-Bifurcated-Krypton-Gate-MOS