similar to: Mixing stored procedure call with RoR db calls in the same function gives errors

Displaying 20 results from an estimated 1000 matches similar to: "Mixing stored procedure call with RoR db calls in the same function gives errors"

2006 Jun 23
1
''Series'' Pluralization
Howdy, I have a model I called ''content_series''. I created it and noticed that Rails called it ''Sery'', so I added ''series'' to the uncountable thing in the config, like this: Inflector.inflections do |inflect| # inflect.plural /^(ox)$/i, ''\1en'' # inflect.singular /^(ox)en/i, ''\1'' #
2006 Oct 17
0
TypeError (can't convert Bignum into Hash):
This error has been driving me nuts. It happens with no regularity or pattern and causes a 500 App error. Refreshing will always display as normal (http 200) The back trace always starts with TypeError (can''t convert Bignum into Hash): /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/mysql_adapter.rb:342:in `update''
2011 Jan 15
0
NoMethodError: undefined method `more_results' for #<Mysql>
I am trying to create rake task to import data from my old php application.But I can not connect to mysql database properly, when I run Old::User.all on rails console ,I get this error : NoMethodError: undefined method `more_results'' for #<Mysql> from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.3/lib/active_record/connection_adapters/mysql_adapter.rb:623:in
2006 Mar 25
0
[Sentry]-before_validation(model) not working for crypted-attribute?
I am still trying to get sentry working to encrypt a couple of attributes in the model. One of them is a password field and the other ssn#. I have crypted_password and crypted_ssn in the db. In addition, I also have validates_uniqueness_of :ssn Here is the problem... I get the error MysqlError: Unknown column ''ssn'' in ''where clause'': SELECT * FROM students
2006 Jan 04
0
Mysql::Error: MySQL server has gone away
Hello, Does anyone see the following error? Is it possible that it has something to do with the connection maintained by active record timing out? /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract_adapter.rb:88:in `log'': Mysql::Error: MySQL server has gone away: SELECT * FROM toys WHERE (toys.id = 28) LIMIT 1
2007 Oct 08
1
How to get database adapter type programmatically in rails?
Hi,all I am developing a Rails application supporting both Mysql and Oracle. I have to use Native SQL statements some place. While we know the SQL grammar is quite different for Mysql and Oracle, so I have to get database adapter type programmatically in my codes to process different native SQL statements. I haven''t found any document for this situation. After some research, I have found
2004 Dec 17
0
Invalid Statements using FastCGI w/ WinXP
Hi all, Now that I have FastCGI set up and running on my Rails app, I''ve run into some strange behavior. I keep getting errors when trying to hit the DB: ActiveRecord::StatementInvalid in Reports#software_rev Invalid argument: SELECT * FROM versioned_components C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.1.0/lib/active_record/conn ection_adapters/abstract_adapter.rb:339:in
2005 Aug 30
1
ActiveRecord::StatementInvalid error after app has been running for a while
Hi, I''m having a bit of a problem with a rails app and I wonder if anyone can help. It seems to run fine for a while, but if it''s left running too long (left running as a fastcgi or webrick process that is) it starts failing with an "ActiveRecord::StatementInvalid" error (i''ve included the full error from the log file below). I''m seeing this on both
2006 Mar 21
2
Migration ~ Create
In one of my migration files I have the following: =========== def self.up User.create :name => ''John Kopanas'', :email => ''john@kopanas.com'', :password => ''test'' end =========== When I run it I get the following error: =========== undefined method `create'' for
2007 Mar 25
1
Can't use models in migrations
Hi there, This always used to work for me... but not now. I want to blame Rails 1.2 but I''m sure its not. I can''t use AR models in my migrations. 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
2005 Dec 30
1
Problems with Testing (Depot) demo app in Agile Rails book
I''ve encountered a perplexing problem whilst following along the demo app in the "Agile Web Development with Rails" book. Any help would be greatly appreciated. Here is a brief time line of my tale of woe:- 0. Been programming (business apps) and designing/building DBs for two decades - but new to both Ruby and Rails (so I apologise in advance if I''ve made some
2007 Oct 07
0
Rails AR/Oracle Unit Test: [7769] failed (getting worse)
"bitsweat" has kicked AR/Oracle while it was down... http://dev.rubyonrails.org/changeset/7769 ------------------------------------------------------------------------ r7769 | bitsweat | 2007-10-06 22:29:37 -0700 (Sat, 06 Oct 2007) | 1 line MySQL: speedup date/time parsing. ------------------------------------------------------------------------ U
2009 Apr 11
6
Inserting data from 1 table to another by using find_by_sql
Hi All, I am inserting data from one table to another by using following method @data=RoyaltyReportFiles.find_by_sql("insert into royalty_reports (artist_name, album_name) select artist_name, album_name from temp_royalty_reports where id=328417") it saves the data into royalty_reports table but it gives following error and application crashes. i am using rails 1.2.5 You have a nil
2010 Nov 09
2
Undefined method
I am very new to ROR. (Ruby 1.8.7, rails 2.1.1, rack 0.8.7, mysql 5.1.41) I has my_app/lib/migration_helpers.rb file: module MigrationHelpers def self.foreign_key(from_table, from_column, to_table) constraint_name = "fk_#{from_table}_#{to_table}" execute %{alter table #{from_table} add constraint #{constraint_name} foreign key (#{from_column})
2017 Dec 07
2
parallel computing with foreach()
I have used foreach() for parallel computing but in the current problem, it is not working. Given the volume and type of the data involved in the analysis, I will try to give below the complete code without reproducible example. In short, each R environment will draw a set of separate files, perform the analysis and dump in separate folders. splist <- c("juoc", "juos",
2011 Jul 14
0
ruby-1.8.7 + mysql-5.1.58 = Mysql::Error: #08S01Bad handshake
The issue: ruby-1.8.7 (compiled from src, not rpm) can''t connect to mysql-5.1.58: "Mysql::Error: #08S01Bad handshake" Environment: Linux Fedora Core 12 (or 14, does not matter) remote database server (different host) mysql-5.1.58 Ruby 1.8.7: wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p352.tar.gz tar -xzvf ruby-1.8.7-p352.tar.gz cd ruby-1.8.7-p352 ./configure
2017 Dec 07
0
parallel computing with foreach()
Your code generates an error that has nothing to do with dopar. I have no idea what your function stack is supposed to do; you may be inadvertently calling utils::stack which would produce this kind of error: > stack(1:25, RAT = FALSE) Error in data.frame(values = unlist(unname(x)), ind, stringsAsFactors = FALSE) : arguments imply differing number of rows: 25, 0 HTH, Peter On Wed, Dec 6,
2006 Jun 30
0
find_by_sql not quoting properly (in acts_as_taggable plugin)
I have run into a very strange problem discovered through the use of the acts_as_taggable plugin, but related to quoting/sanitizing the interpolated list in a find_by_sql. Apologies for the length, but I wanted to be complete. ;-) The method from acts_as_taggable.rb is: def find_tagged_with(list) find_by_sql(["SELECT #{table_name}.* FROM #{table_name}, tags,
2008 Apr 04
0
Can''t get backgroundrb to work with rails plugin ''batched_sql_fu''
Trying to use backgroundrb to process and insert a large list of bulk records, but when I try to use it with the batched_sql_fu plugin installed in vendor/plugins, 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
2007 Jan 21
6
rake db:migrate "undefined method `default'" error
Hi all, Just 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