search for: mysqladapter

Displaying 20 results from an estimated 31 matches for "mysqladapter".

Did you mean: mysql_adapter
2006 Aug 19
7
Impossible to get stable?
I have concluded that it is impossible to get this background process stable. I am out of ideas and could really use some help. Here is what I have: 50 workers, just running an infinite loop that constantly calls save! on a model. Keep in mind this is just for testing purposes. I catch all exceptions and put them in the log. I am tried setting allow_concurrency to true and false. Neither
2008 Aug 28
2
1 or true in TINYINT(1) column?
Hello, there is a table that has a column TINYINT(1) called status. Through mysql console I see its value as 1 (when is true) but if I do this in Rails console: Mytable.status => true give me "true" rather "1". How could I change 1 to true using some method? Or true to 1? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are
2006 Mar 21
2
Migration ~ Create
...reate :name => ''John Kopanas'', :email => ''john@kopanas.com'', :password => ''test'' end =========== When I run it I get the following error: =========== undefined method `create'' for #<ActiveRecord::ConnectionAdapters::MysqlAdapter:0x2345c1c> =========== When I copy the line and paste it in console it works perfectly. Even using the longer method of =========== user = User.new user.name user.save =========== Does not work in the migration. Tells me method name does not exist. It exists. Anyone have any insight a...
2007 Mar 25
1
Can't use models in migrations
...igrations. To make sure its not just my dodgy code I tried to do the same with a well known plugin.. acts_as_versioned. A migration such as the one below (taken from acts_as_versioned) is giving the error undefined method `create_versioned_table'' for #<ActiveRecord::ConnectionAdapters::MysqlAdapter:0xb74a1d44> What the hell is that about? create_versioned_table is a definition of Post.. not bloody SqlAdapter whatever. Ideas? Thanks -henry # class AddVersions < ActiveRecord::Migration # def self.up # # create_versioned_table takes the same options...
2008 Feb 05
0
How do I override a method that's only invoked from a rake task
I want to override structure_dump in the MysqlAdapter class. (It doesn''t dump some stuff I need for my implementation and I''m extending it to do that.) I know how to override methods in application code. MysqlAdapter#structure_dump is called from the rake task db:structure:dump, and I can''t figure out where to put the overr...
2008 Mar 20
0
Mixing stored procedure call with RoR db calls in the same function gives errors
Folks, I am using ruby 1.8.5 with rails 1.2.3 and have made changes to mysql_adapter.rb based on recommendations made here http://wiki.rubyonrails.org/rails/pages/StoredProceduresInMySql to be able to use stored procs in my code. I have changed this call in mysql_adapter.rb ConnectionAdapters::MysqlAdapter.new(mysql, logger, [host, username, password, database, port, socket], config) to ConnectionAdapters::MysqlAdapter.new(mysql, logger, [host, username, password, database, port, socket, 65536 + 131072], config) as recommended. However I use connection.select_all("call spName(params)") t...
2007 Oct 08
1
How to get database adapter type programmatically in rails?
...tuation. After some research, I have found a way to do so like following: if ActiveRecord::Base::connection.is_a? (ActiveRecord::ConnectionAdapters::OracleAdapter) {Process native Oracle SQL statements} else if ActiveRecord::Base::connection.is_a? (ActiveRecord::ConnectionAdapters::MysqlAdapter) {Process natvie Mysql SQL statements} end After test, it works. But I am wondering if this is the best way to achieve my goal, or is there any other smarter way? Thanks in advance! Regards, Liming --~--~---------~--~----~------------~-------~--~----~ You received this message becau...
2005 Oct 03
3
Boolean quoting, postgresql
http://dev.rubyonrails.org/ticket/1117 I''ve attached a patch to ticket 1117 which fixes it so that booleans are escaped as booleans, not integers. Specifically, this situation will now work find_all(["send_date=? and sent=?", Date.today, false]) Which matches peoples expectations, but it causes some problems with the postgresql unit tests. Specifically, the use of
2010 Nov 09
2
Undefined method
...:airports end end When I rake db:migration it got this error: -- create_table(:airports, {:options=>"ENGINE=InnoDB"}) -> 0.0156s -- foreign_key(:airports, :country_id, :countries) rake aborted! undefined method `foreign_key'' for #<ActiveRecord::ConnectionAdapters::MysqlAdapter:0x5cf4d50> What did I miss? Thank you -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public....
2006 Apr 20
5
How to find the last SQL statement executed in ActiveRecord
Is there a method for retrieving the last SQL statement executed by ActiveRecord? I realize I can open the log file, but I''m looking for a programmatic way. -- Posted via http://www.ruby-forum.com/.
2006 Feb 01
3
Getting database config info
Hi folks. I have a very small problem which is probably very simple. But I''ve scoured the api and the rails book with no luck. I''m trying to get information about the database definition out of active record. When I go into console and say ActiveRecord::Base.connection I get a MysqlAdapter object, with an instance variable called @config that''s a hash containing all the information I need. However I can''t get at the config variable. I can think of two solutions, neither of which is entirely satisfactory. Either extend the definition of MysqlAdapter to include an acc...
2006 Apr 04
9
Does ActiveRecord have support for "Boolean" columns?
Hey all -- I''ve been using enumerable char(1)''s with ''y'' and ''n'' values for my Boolean columns in Rails, but it strikes me there should be a better way. How do you setup columns that represent true/false-ness in your schemas on Rails? Wondering what kind of standard approaches there are other than me writing something like class MyEntity
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 =
2009 Nov 17
8
rspec-rails gem double quoting (My)SQL?
Hi all, This seems like a plugin conflict (I haven''t yet had success replicating this in a new project), but short version is: when I have "rspec-rails" in my environment.rb plugin config, table names are double quoted in mysql queries generated by my standard finders. rspec-rails commented out: SELECT * FROM `users` WHERE (`users`.`id` = ''159564615'')
2006 Mar 29
2
Rake Migrations for Rails 1.1
...** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:migrate == Realtorex: migrating ======================================================= -- create() rake aborted! undefined method `create'' for #<ActiveRecord::ConnectionAdapters::MysqlAdapter:0x3472828> d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:271:in `send'' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:271:in `method_missing'' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_r...
2005 Mar 03
7
Another question about the tutorial
Hello After upgrading to ruby 1.8.2, finally got rails to install properly. Now, following the tutorial, I found a couple of things: First, apparently rails tries to establish local mysql connections using "/tmp/mysql.sock" which mandrake does not use. In mandrake 10.1, this file is located at "/var/lib/mysql/mysql.sock". The solution is to create a simlink
2006 Apr 27
0
How to use prepare statement?
I need to run a large number of row into my database. In order to get the fast speed, I would like to use prepared statements. But I can not get the mysql connection handle in ActiveRecord, because the MysqlAdapter doesn''t permit to access the Mysql connection handle. So how can I get the connection handle or construct a new connection by using the same configure information? Thanks! -- Posted via http://www.ruby-forum.com/.
2008 Apr 04
0
Can''t get backgroundrb to work with rails plugin ''batched_sql_fu''
...lugins, I get the following error: ---SNIP--- /Users/jdonalds/Sites/3dial_ads/config/../vendor/plugins/ batched_sql_fu/lib/batched_sql_fu/active_record.rb:22:in `alias_insert_sql_to_batched_version!'': undefined method `insert_sql'' for class `ActiveRecord::ConnectionAdapters::MysqlAdapter'' (NameError) from /Users/jdonalds/Sites/3dial_ads/config/../vendor/plugins/ batched_sql_fu/lib/batched_sql_fu/active_record.rb:8:in `insert_by_batch'' from /Users/jdonalds/Sites/3dial_ads/lib/workers/ process_list_worker.rb:249:in `process_leads'' from /Users/jdonald...
2007 Jan 21
6
rake db:migrate "undefined method `default'" error
...t starting with Rails and working through the early chapters of the Pragmatic Programmers Agile Development with Rails book (2nd addition). When doing a "rake db:migrate" to add a column to a table I get this: undefined method `default'' for #<ActiveRecord::ConnectionAdapters::MysqlAdapter:0xb7517ec8> Any ideas? thanks, David PS: Here''s the full output with the trace parameter: dkarnows@star:/share/David/radrails/workspace/depot$ rake db:migrate --trace (in /share/David/radrails/workspace/depot) ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** E...
2006 Jan 26
9
Problem with schema_db_import on Site5?
Hello, I am trying to put my rails app on a host .So I presume the method to do this is to first do rake db_schema_dump and then copy it to the host and do rake db_schema_import. I use mySQL Ver 14.7 Distrib 4.1.14, for pc-linux-gnu (i686) using readline 4.3 ** Invoke db_schema_import (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db_schema_import rake