Displaying 20 results from an estimated 2000 matches similar to: "sqlite, views, incorrect data types?"
2005 Dec 17
1
lost in an ActiveRecord::StatementInvalid
I have an error I don''t know how to debug. I am adding the login
suport in Depot (the example in the RoR book) and
LoginController#add_user throws ActiveRecord::StatementInvalid in an
innocent /login/add_user GET request.
The trace goes down to a call to SQLiteAdapter#table_structure, and
the source code suggests what''s happening is that "PRAGMA
2006 Aug 08
3
Database transactions
Hello,
I have an application where I need to create two records in a database
transaction.
ie:
begin
User.transaction(user) do
User_details.transaction(user_details) do
user.save
user_details.save
end
end
end
rescue
flash[:notice] "Insert rolled back... but why..??"
end
>From reading the Agile book, I gather that once I wrap the
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:
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
2006 Feb 27
1
Functional test problem with environments variables
Hi guys,
i have been experiencing this problem once i put in some constant
declarations in /config/environments/development.rb. I declared it very
normally like this :
USER_DETAILS = {
:name => ''abc'',
:password => ''123''}
it works in the controller and when i run the application, i managed to
get the values out from the development.rb by using some
2006 Apr 16
5
Granular model validation based around controller actions?
How can I achieve granular control over the validation for different
controllers? I create users from an administration controller, but I
don''t want to fill in all their information fields, just have their name
and email address. When they accept the invitation, I want to implement
validation on the other fields.
I have looked at using :on => :update, but I would have to make the
1997 Jul 24
4
Samba and ClearCase
We're trying to use samba to let our PC's mount view extended pathnames used
by clearcase but they show up as empty. If anyone's used samba and Clear
Case (by Pure Atria) and gotten it to work I'd love to hear how.
thanks,
Bill
--
---------------------------------------------------------------------
William H. Schwartz email: whschwartz@mmm.com
System
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
2005 Nov 10
3
kannel from dag - sqlite conflict with centos 4.2
I have a CentOS 4.1 box running Dag's Wieers kannel 1.4.0-3.2.el4.rf package
which has a dependency on sqlite version 2.8.16-1.2.el4.rf also from Dag.
If I try to up2date to centos 4.2 I'm hitting a conflict whereby 4.2 wants
to install sqlite 3.2.2 - but kannel doesn't like that, reporting:
Unresolvable chain of dependencies:
kannel 1.4.0-3.2.el4.rf requires libsqlite.so.0
The new
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 Jun 27
9
FK constraints overrated?
Hello folks,
I use to think that a relational databases without foreign keys
constraints enforced strictly by the RDBMS were no good, piece of crap,
data junk.
However, I''ve also learned the hard way that FKs constraints imposes
serious difficulties when moving data around, specially between
different DBs, or for loading test data or for upgrading DBs schemas, or
for porting DBs
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
2007 Sep 27
6
Security + Rails =Joke?
Hi,
http://dev.rubyonrails.org/ticket/8453
http://dev.rubyonrails.org/ticket/8371
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-3227
I came across the above by accident. While I am subscribed to the so
called rails security list where supposed announcement of security
issues were to be posted, neither of the above problem made the list.
While I use rails a lot and like it, the above
2006 Jan 11
7
Create a relationship with 2 or more tables on 1 insert
userstable: |id|name|password|
userdetailstable: |id|col1|col2|col3|user_id|
this is my code:
[code]
def create
@user = User.new(@params[''user''])
@userdetail = Userdetail.new(@params[''userdetail''])
if @user.save and @userdetail.save
flash[:notice] = "Save succeeded..."
redirect_to :action => ''list''
2005 May 13
5
HTML sanitizer
Hello!
Does anybody know of a Ruby implementation of a HTML sanitizer that
prevents the attacks described on the xss cheatsheet?
(http://ha.ckers.org/xss.html)
I checked out the version Jamis wrote
(http://dev.rubyonrails.com/ticket/1277), but that only covers the
very basic attacks.
Anybody? Just figured I would ask before, before I reinvent the wheel..
Ciao!
Florian
2006 Jan 25
6
Displaying based on hostname/subdomain
Ive tried multiple ideas to get this to work, but keep hitting a dead
end. Has anyone done this before?
I want joe.domain.com to display www.domain.com/profile/joe
Im using lighttpd.
Routes dont have access to the URL string and therefore I cant code in
a conditional. lighttpd rewrite seems to really screw it all up. Is
there a feasible solution?
Thank you,
Joe Noon
2006 Apr 07
2
Fat Data Model vs Skinny Data Model
Ive recently been contemplating how to tackle allowing for extra
"fields" to be added to a recordset. For example, a user has an email
address, but they may also want to put their birthday, height, weight,
etc. I don''t want to constrain what is possible in this situation. I
think what I''m describing is best documented in Philip Greenspun''s
page here:
2006 Apr 22
2
Question about functional tests and log/test.log
Here''s something a bit weird:
After running functional tests, my test log contains many lines,
including many like these:
> Processing UserController#attempt_login (for 0.0.0.0 at 2006-04-22
> 02:38:08) [POST]
> Session ID:
> Parameters: {"user"=>{"password"=>"bogus",
> "email"=>"tmornini@bogus.com"},
2009 Sep 15
1
R Memory Usage Concerns
Hello all,
To start with, these measurements are on Linux with R 2.9.2 (64-bit
build) and Python 2.6 (also 64-bit).
I've been investigating R for some log file analysis that I've been
doing. I'm coming at this from the angle of a programmer whose
primarily worked in Python. As I've been playing around with R, I've
noticed that R seems to use a *lot* of memory, especially