search for: 23000column

Displaying 7 results from an estimated 7 matches for "23000column".

2006 Mar 21
8
Loading the contents of a CSV file to a database
Hello Everybody, I picked up on the buzz about RoR and wanted to see what the fuss is about. So far i am very impressed but have hit a bit of a wall with a little play app i am writting. I want to iterate through a CSV file of my bank transactions and see just how much money i spend on beer and pies every month. I have successfully setup a database with a single table called transactions
2006 Jul 17
1
acts_as_tree and :include
...l children to avoid unnecessary db queries: > @gb_entry_pages, @gb_entries = > paginate :gb_entries, :per_page => 15, :order => ''created_at DESC'', :include => :children when i run that, i get the followin error: ActiveRecord::StatementInvalid (Mysql::Error: #23000Column ''created_at'' in order clause is ambiguous: SELECT gb_entries.`id` AS t0_r0, gb_entries.`name` AS t0_r1, gb_entries.`email` AS t0_r2, gb_entries.`homepage` AS t0_r3, gb_entries.`message` AS t0_r4, gb_entries.`created_at` AS t0_r5, gb_entries.`parent_id` AS t0_r6, childrens_gb_entri...
2006 May 18
1
Feed 2 tables with one Form
...redirect_to :action => ''list'' else render :action => ''new'' end My probleme is that, it creates an entry in the "stagiaires" table with no problem, but not in the "demandes" table :( here the error : Mysql::Error: #23000Column ''dr'' cannot be null: INSERT INTO demandes (`dr`, `type`, `stagiaire_id`) VALUES(NULL, '''', 13) i supposed that i did something wrong near : @stagiaire.demandes.create(params[:dr]) thks -- Posted via http://www.ruby-forum.com/.
2006 Feb 15
1
self in before_create
...ere goes: I am wondering why this works def before_create self.last_logged_in = Time.now self.created = Time.now end but this doesn''t def before_create @last_logged_in = Time.now @created = Time.now end The latter fails with the following error: Mysql::Error: #23000Column ''last_logged_in'' cannot be null:
2006 Jul 27
7
Newbie question---
I wrote a ruby script that parses a file into key-values like so: class Parser table = { } IO.foreach(''Localizable.strings'') { |line| if line =~ /^ \s* " (.*?) " \s* = \s* " (.*?) "/x table[ $1 ] = $2 end } end I want to store the key-values in different colums on my database so that when I enter a key, it gives me the corresponding value...how
2006 Dec 07
2
Problem saving parent and children using belongs_to, class_name, and foreign_key
...lt; ApplicationController def checkout_complete ... @order = PayjunctionOrder.new @order.line_items << LineItem.new(:product => product, :quantity => qty, :total_price => product.price * qty) @order.save! ... ------------------ When I try to save, I get: Mysql::Error: #23000Column ''order_id'' cannot be null: INSERT INTO line_items (`order_id`, `total_price`, `product_id`, `quantity`) VALUES(NULL, ''285.0'', 5, 1) The development.log shows the insert being done for the PayjunctionOrder, but the inserts for the children fail on this NOT NULL c...
2007 Oct 07
10
Rails to English
I am currently using the book "Agile Web Development With Rails" (2005). I am working on a fully function web application that has a shopping cart. The web page displays this, ActiveRecord::StatementInvalid in AdminController#create Mysql::Error: #23000Column ''date_available'' cannot be null: INSERT INTO products (`image_url`, `date_available`, `price`, `title`, `description`) VALUES(''http://www.google.com/pic.jpg'', NULL, ''9.99'', ''asdf'', ''asdf'') RAILS_ROOT: ./scrip...