Displaying 20 results from an estimated 800 matches similar to: "Primary Keys enforcement vanishes in test database"
2008 Apr 08
1
Help with primary_key_prefix_type
I put this config in environment.rb
# Use table_id instead of id for primary key.
config.active_record.primary_key_prefix_type =
:table_name_with_underscore
I have this migration:
class CreateEntities < ActiveRecord::Migration
def self.up
create_table :entities do |t|
t.string :entity_name, :null => false,
:limit => 40
t.string
2005 Jan 28
16
primary_key_prefix_type, support for non-integer primary keys
Hello!
I''m just starting out with Rails--and Ruby itself for that matter--and
have a couple of questions regarding primary_key_prefix_type and
non-integer primary keys.
I see in the ActiveRecord documentation [1] that by default the primary
key of a table "foo" is expected to be "id", though
primary_key_prefix_type this can be changed to :table_name or
2005 Aug 06
2
Problem with 0.13.1 ActiveRecordStore with PG 8.0.3.
Hi,
I put the following in my environment.rb file:
ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.update
(:database_manager => CGI::Session::ActiveRecordStore)
Runnning WEBrick via "script/server" and trying to load any page
served by a controller results in an error like the following:
#<ActiveRecord::StatementInvalid: ERROR: null value in column "id"
2006 Apr 20
5
Integrating with Legacy Databases
This seems like it must have been asked before - I really _did_ try to
find it in the archives, so my apologies if it''s already out there.
Utilizing ActiveRecord, I would like to specify a prefix for the
column names in my table. For example, in ''Recipe 16 Integrating with
Legacy Databases'' (Rails Recipes, from PragProg, by Fowler) they deal
with integration with a
2006 Feb 27
4
2 belongs_to to the same parent table
Hello!
I have 2 table: users and buddies
User: id, name, ...
Buddy: id, user_id, user_buddy_id, ...
So if you have 2 users 1,jack and 2,fred and fred is a buddy of jack,
there is a Buddy object: id=1, user_id=1, user_buddy_id=2
I can declare only one belongs_to in Buddy and one has_many in User. And
there is conflict if I had the second one (the first one is discarded)
class User
has_many
2005 Aug 08
7
Problems with ./scripts/generate scaffold
Hi all,
I''m new to rails after having used perl for most of these things, and am
trying to get my head around the generate script for a project playing
around
with.
If I do:
./scripts/generate controller Device
I get app/controllers/device_controller.rb
where I can then add:
scaffold :device
However, if I want to actually generate the scaffolding so I can make
some changes:
2006 May 02
4
How to extend rails rake tasks?
Does anyone know how to extend the buit-in rake tasks like test:unit.
I want to custom load some fixtures in a particular order.
Thanks,
Zack
2008 Jun 05
23
unit test question
In development and production, I''ve got postgresql constraints that
prevent deleting a CaseManager if there is a Client that belongs to that
CaseManager.
In unit tests...and obviously in my testing db, those restrictions don''t
get added.
Is it wrong to test for deleting dependent records in unit tests?
Craig
--~--~---------~--~----~------------~-------~--~----~
You received
2006 Apr 03
2
problems testing on 1.1 and postgresql
Hi,
I get errors doing this:
1) createdb myapp_test
2) rake db:test:clone_structure
3) rake test:units
rake aborted!
PGError: ERROR: relation "matches" already exists
I''m using the :sql schema format because there are some problems with
postgres and the :ruby schema format
config.active_record.schema_format = :sql
It seems rake test:units is trying to create the tables
2006 Apr 11
6
Oracle unit test problem in Rails 1.1.2/Ruby-OCI 0.1.14
I''ve upgraded to Rails 1.1.2, and I''m trying to push this change through
to our build server (Linux/Oracle) and we are getting some errors in the
unit tests using Oracle. Looking at the data in the tests reveals a
precision problem. Looking at the tables tells the whole story.
My development database contains this table:
SQL> describe dls_grids;
Name
2006 Jul 05
2
Serialized object behaves weird
Hi!
I got a class named EinsatzFilter which I serialized to session. Before
saving to session it works afterwards I keep getting the message:
"undefined method `to_s'' for #<Person:0x38c6ab8>". "Person" is a from
ActiveRecord::Base inherited class.
Code:
class EinsatzFilter
include ApplicationHelper
attr_reader :personen, :monat, :projekte, :kunde
2006 Aug 23
1
problems with Oracle: FK, triggers
Hi All!
Is anyone working with Oracle on Rails? What about testing? I will be
very happy if you can help me:
1) When I run rake test:unit it removes all my sequences in test
enviroment. And I get an error like "OCIError: ORA-02289: sequence does
not exist" But when I run rake db:test:clone_structure I can see all
sequences again. Where is a problem?
2) How I can take proper
2005 Aug 08
68
Pluralized Controller Names?
If I do:
script/generate controller Photo
I get a controller named photo_controller. OTOH, if I do:
script/generate scaffold Photo
I get a controller named photos_controller. (Note that the controller
name is pluralized).
I realize that I''m specifying the controller name explicitly in the
first case, but it seems
odd to me that the scaffold command generates a pluralized
2007 Aug 27
1
Xen VM vanishes after creation
Just starting and playing around with Xen on Centos 5.
I created a new VM (para-virtualized) with the Virtual Machine Manager,
installed Centos 5 minimal on it, rebooted after successful installation.
The VM console vanishes on shutdown and that's it. The VM id vanishes from
the VM Manager and there's no way to get it back. It looks like the new VM
doesn't exist. xm list shows only
2006 Feb 17
7
Create and then show
I am attempting to redirect to the show method after creating a new
object. So, for example, once a new post is created the user is
presented with the new post in a show view. The problem is I can''t get
the correct <at> post.id to send to the show method. Rails always
returns 0 for this value.
Here''s what I have so far:
class ContentController < ApplicationController
2012 Feb 16
2
Legend vanishes when placed outside the graph
Hello everyone,
i’ve got a problem with my diagram’s legend. I know i should be able to figure it out by reading the ‘plot’ and ‘legend’ reference. However nothing works so it would be kind if anyone could point me to the necessary parameters.
The problem is that i’m moving the legend using the ‘inset’-parameter so it does not overlap with the graph. However it vanishes outside the graph, so
2010 May 15
1
XML-Created domain vanishes after shutdown
Hi,
im migrating existing kvm-images into libvirt domains, by creating a
domain in virsh from a xml file. The domain starts, is working fine, but
after shutdown it is lost, and I have to recreate it.
BTW, can I reset the domain count somewhere?
Any ideas?
thx and kind regards
Alexander
virsh # version
Compiled against library: libvir 0.4.6
Using library: libvir 0.4.6
Using API: QEMU 0.4.6
2006 Dec 05
0
RE: regcontext, NoOp extension vanishes when extension reload
>
> Let me guess: The context in which you have the 2 thru n priorities is
> the same one as you're using for regcontext right?
>
> Don't do that, bad things will happen (as you've noticed).
>
> I'd have to review the code again, but I think what you're seeing is as
> a result of this.
>
> Regards,
> - Brad
>
No, not exactly, I have a
2006 Dec 05
0
Re: regcontext, NoOp extension vanishes when extension reload, WORKING
OK this was an easy one to fix. All I had to do is RTFM. Note on the wiki:
ATTENTION: Make sure you take a look at bug report 7144
Just do what Kevin said, include the regcontext in whatever static
context you have the priority 2 extension and don't make a static
regcontext in extension.conf. Let sip module do the rest. Works
great.
Thanks Guys.
JR
On 12/5/06, JR Richardson
2003 Dec 18
1
Wins registration vanishes
Has anyone seen this yet?
I am having a problem with the my WINS entry for my Samba server disappearing from the WINS
database. After this takes place I am no longer able to access my Samba server so I am forced to
restart NMBD and a new entry is placed in the WINS database. Although over time this entry will
vanish again and I have to repeat the restart process. I am aware that I can add a