Displaying 20 results from an estimated 200 matches similar to: "lost in an ActiveRecord::StatementInvalid"
2007 Mar 01
1
ActiveRecord::StatementInvalid error
When I try to run my webserver in the production environment I just
get an application error message. This is all I can find in the log:
ActiveRecord::StatementInvalid
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.1/lib/active_record/
connection_adapters/sqlite_adapter.rb:274:in `table_structure''
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/
2005 May 08
3
sqlite, views, incorrect data types?
This has been driving me crazy for a few days now. I am using sqlite3
however I have also found this to be the case with 2.8.15:
I have data types text or integer on every column of every table in
the database. Now i know sqlite doesnt care much about data types,
but I believe rails does (correct me if im wrong). On pages that
query a table, everything is perfect.
BUT when I use a view
2007 Jun 21
3
Sqlite3, in-memory db and rspec_server
Hi everyone.
I can''t get the above(subject line) combination to work. If I use a
standard sqlite3 file db for the test db, and spec_server all the
specs on my models pass. If I use an in-memory db for the test db,
script/spec w/o spec_server, they all pass. But if I use in-memory and
spec_server I get the following error:
1)
ActiveRecord::StatementInvalid in ''User should be
2011 Dec 03
1
ActiveRecord Abstract class
Hi, I was trying to create an abstract class and a subclass which
inherit that abstract class.
However, seems like I cannot instantiate the subclass too. Below is my
code:
//abstractclass2.rb
class Abstractclass2 < ActiveRecord::Base
self.abstract_class = true
end
//subclass.rb
class Subclass < Abstractclass2
end
When I test drive it in rails console, I got the following error:
2010 Jul 16
1
sqldf modify table
Hi - I am something of a newbie and am a little perplexed. When (trying to)
modify a table I issue the following commands with subsequent errors
sqldf("alter table Korea drop column code", dbname = "mydb")
error in statement: near "drop": syntax error
or
sqldf("alter table Korea rename column hyr to hyrI", dbname = "mydb")
error in statement:
2007 Jul 17
5
habtm confusion
Hello friends!
I am trying to make a database that will have a group of people set to
committees, and a person can be in multiple committees, and a committee
obviously has multiple people. The people are senators at my
university. These are my current models:
senator.rb:
--
class Senator < ActiveRecord::Base
validates_presence_of :first_name, :last_name, :floor
has_and_belongs_to_many
2006 Feb 08
1
Save only inserts null instead of actual values
Hi,
whenever I try to save my form, rails only enters null values in my
database. I''m using sqlite, I thought that sqlite might be the problem,
but the problem remains when I switched to mysql. Here is my code:
controller:
class CollectionController < ApplicationController
def new
@collection = Collection.new
end
def create
if request.get?
redirect_to :action
2007 Mar 08
3
Problem loading data from database
Hello, I get this error trying to load some data from DB. I''m using
Rails 1.2.2 on Fedora Core 6 and Sybase adapter.
This worked fine when application run under Rails 1.1.6 but now I''m
migrating to 1.2.2 and have some problems.
At browser I got:
SQL Command for table_structure for tplib_bckps failed
Message: schema_info not found. Specify owner.objectname or use
sp_help to
2005 Jul 13
0
Testing failing
So I''m trying to be a good agile programmer and write unit tests for
my objects, but I''ve got a test I just can''t keep from failing.
I have a profile object that I just added username and
hashed_password to. I used the method in the Rails book to handle
hashing the password. My code is strait out of the book. The whole
object is at the end of this email.
I want
2006 Jun 05
2
When adding a record in console, a parameter comes in as null even when I set it
In console, I am trying to create a User but the :account_id does not come
in. Console just gives me back :account_id => nil. Obviously I''m trying to
set it though. Silly console...
But, I can set the account_id column in my controller like so:
@user = User.new(params[:user])
@user.account_id = account.id
@user.save
Here''s what I give to the controller:
User.create :name
2006 Mar 30
2
Functional test confusion
I have been reading about testing in RoR for what seems like hours now
in search of the answer to what is probably a simple problem. Where is
the best place to test the second action explained below?
I have a controller (NetworkingController) with a method
(create_network_segment) that makes use of two models (NetworkSegment
and NetworkIpaddress). This particular method does two actions:
1.
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 Apr 03
7
Getters and setters problem?
Hi list,
first evening of playing with rails, so please forgive me if I ask
something stupid. ;-)
I created a User model and tried to use ActiveRecord callbacks to
convert the password to sha1 just before saving it. For some reason
postgresql gives me a error because the given password is null. To
test even further I tried to change :login too, same error happens,
:login is empty too.
I am sure
2007 Dec 07
1
CentOP 5.1 Problem with smbldap-passwd
Hi List,
Yesterday i have upgraded from 5.0 to 5.1 and now i have a problem
with smbldap-tools.
I use smbldap-tools-0.9.4-1.el5.rf from rpmforge.
Then i use smbldap-passwd <user> i get an error:
smbldap-passwd test
Changing UNIX and samba passwords for test
New password:
Retype new password:
Use of uninitialized value in string at /usr/sbin/smbldap-passwd line
277, <STDIN> line 2.
2006 Feb 15
8
Agile book - getting confusing error
Working through the beginning phase from the Agile book on
''Administration''
undefined method `hashed_password='' for #<User:0xb7911324>
...
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1498:in `method_missing''
#{RAILS_ROOT}/app/models/user.rb:12:in `before_create''
2006 Jan 16
0
[newbie] Redundant SELECTs?
Hi -- I''m getting started with Rails by rewriting a little web-app I
wrote last year in PHP. (I have a bit of prior Ruby experience, and
have been working with SQLite for about a year.)
My app is up and running, but on looking through the development.log
I noticed that Rails is making a lot of identical SELECT queries
while handling a single request. These are just the simple
2005 Apr 23
2
[Tip] Introspection to determine if a column may be null
I still want to get this into Rails for all connection adaptors, but
for now I''ve hacked my own addition on for just PostgreSQL.
The following code extends every Column object returned by
MyModel.columns to support a new #required? method, which indicates if
the column may or may not be null.
The following is a huge hack - suggestions on a cleaner way to add this
functionality
2008 Jul 01
14
rake aborted! Could not find table ...
I am getting a rake aborted error and I suspect that I am missing a
package on my system since the app works for a friend on this
computer.
Here is the terminal output of the error:
anita@anitas-computer:~/sandbox/shovell$ rake db:migrate
(in /home/anita/sandbox/shovell)
rake aborted!
Could not find table ''stories''
(See full trace by running task with --trace)
2006 Mar 13
4
Find and eager loading questions
Hi all,
I want to see if I''m not missing something with associations and eager
loading. (I''m currently using Locomotive on OS X and SQLite3.)
I have two simple tables/models, set up properly: teams has_many
:matches and matches belongs_to :teams. Matches has a match number and
a team_id field (along with several other fields) and teams has a
team_number field (again, along with
2006 Aug 07
2
NoMethod Error: Modifying Location of support modules
I''m trying to follow along with the Agile Development with Ruby on Rails
book and have encountered a problem with code having the following
syntax (partial class provided):
require "digest/sha1"
class User < ActiveRecord::Base
private
def self.hash_password(password)
Digest:SHA1.hexdigest(password)
end
end
I''m getting an error as:
undefined method