Displaying 20 results from an estimated 2000 matches similar to: "PostgreSQL ActiveRecord default localized date assigned in test env"
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 Jan 09
3
Include with two references of one model of the same table
Hey guys,
I just came across this oddity, not sure what to make of it yet, but
I think it might be incorrect behavior. When doing a @inst.find(:all,
:include => ["hometeam", "awayteam"] ...) hometeam and awayteam are two
references from a belongs_to that is of the same model and of the same
table. I will get a pgerror stating that "matches", which is
2006 Mar 02
1
PostgreSQL function in an insert statement
Hi there,
I wont insert a picture in a PostgrSQL-DB via the function lo_import.
Therfore I modify the value of an ''oid'' column.
@measurepoint = Measurepoint.new(params[:measurepoint])
@measurepoint.measurepoint_background = "lo_import(''#{@params[''measurepoint''][''measurepoint_background'']'')"
@measurepoint.save
The
2006 Feb 09
1
migration with PostgreSQL - function nextval does not exist
This might be a problem with postgresql, but I''m not sure. In a
migration I have renamed a table so I wanted to rename a sequencer as
well. It looks like:
execute "ALTER TABLE global_vacations_id_seq RENAME TO vacations_id_seq;"
execute "ALTER TABLE vacations ALTER COLUMN id SET DEFAULT
nextval(''vacations_id_seq''::regclass);"
But the process of
2006 Jun 15
8
postgresql sequence and migrations
I have a specific need to ''fixate'' my ''roles'' table sequence when
migrating.
at migration #4, I have 28 records in my roles tables and I can manually
reset the roles_id_seq but it stands to reason that since I am doing
everything else in the migration, I might as well reset the sequence
there too.
so I tried this in my migration file...
execute
2006 Apr 18
6
Postgresql and ActiveRecords problems
Hi all. I have a problem with postgresql PK columns and ActiveRecord.
The error is: PGError: ERROR: null value in column "item_id" violates
not-null.
Ok, it''s wrong to insert NULL into PK columns, but rails doing it. How
to fix? So sad..
2006 Jul 01
0
activerecord generating wrong syntax with postgresql
I''m using activerecord outside of rails and find_first generates sql
that postgresql doesnt'' like. This is rails 1.1.4, with everything up
to date via "gem update".
This is the command line:
ruby -rrubygems seca -c ../etc/seca.cnf cert --export 1 --format
pkcs12 --key root.key >root.pfx
This is the error:
(PGError: ERROR: argument of WHERE must be type
2006 Feb 23
1
PostgreSQL CASCADE not copied to test db
When the unit test harness creates a test database from the
development database, the ON DELETE CASCADE constraints I have on my
foreign keys are not copied into the test database. (I can tell by
looking at db/development_structure.sql.)
That means the fixtures can''t load/unload from the test database
properly. In other words, all my tests fail with the same error
message:
2009 Apr 27
0
Encoding Problem / mod_rails / passenger / Postgresql 8.3
Hi,
when I use mod_rails/passenger with apache2 on linux instead of
webbrick for our application, then it stops working with certain
browsers like the ie, and konqueror but still works with firefox.
I get the following error message:
ActionView::TemplateError (PGError: ERROR: invalid byte sequence for
encoding "UTF8": 0xad
HINT: This error can also happen if the byte sequence does
2011 Sep 12
0
Migrate column from text to binary (PostgreSQL)
Hello,
So I''ve realized one of the columns in a table has to be binary
instead of text. However, a straightforward
change_column :my_table, :my_column, :binary
fails under PostgreSQL (9.x series) The error message being:
PGError: ERROR: column "my_column" cannot be cast to type bytea
: ALTER TABLE "my_table" ALTER COLUMN "my_column" TYPE bytea
Now
2007 Feb 19
0
Invalid SQL generated with PostgreSQL 8.2.3
Hey,
Using Ruby 1.8.5, postgres-pr-0.4.0, activerecord-1.15.2, Rails 1.2.2
and PostgreSQL 8.2.3. I''m following the O''Reilly book "Ruby on
Rails", so you can tell I know precious little of what I''m doing ;-)
Well, I''ve created some models, and was working through examples, and
executed the following from a console:
>> show = Slideshow.find 1
2007 Aug 23
6
Saving ActiveRecord in PostgreSQL without id
I have a small table that is used to temporarily queue requests, as such
it does not have an id field (or any other primary key), because it
doesn''t make sense to have one.
When I created an ActiveRecord class and tried to save it, I get:
ActiveRecord::StatementInvalid: PGError: ERROR: relation
"temp_requests_id_seq" does not exist
It keeps looking for the id to auto
2005 Dec 22
2
nonstandard postgresql sequence names
I''m working with a legacy postgresql database where the names of tables,
columns, etc., do not usually follow Rails conventions.
I''ve been able to work around it for the most part, but I ran into this:
I have the following test:
require File.dirname(__FILE__) + ''/../test_helper''
class SponsorTest < Test::Unit::TestCase
self.use_transactional_fixtures =
2008 Nov 04
9
RSpec and PostgreSQL not playing nicely together
Here is a very simple spec:
--
require File.expand_path(File.dirname(__FILE__) + ''/../spec_helper'')
describe Product, "The Product model" do
describe "When a new blank product object gets created" do
before(:each) do
@product = Product.new
end
it "should not be valid" do
@product.should_not be_valid
2005 Mar 07
3
exclude an attribute from save
Hi,
I''ve used .save to save the attributes, but on my table there is an
autoincrementing id (not the primary key) that doesn''t need to be
inserted... but save try to INSERT it anyway... is there a way to
avoid save from acting this way or to whisper him to be more polite
this time? ;)
Thanks,
Enrico
--
"The only thing necessary for the triumph of evil
is for good men to do
2008 Jan 16
0
[CruiseControl] RubyOnRails build 8649 failed
The build failed.
CHANGES
-------
Revision 8649 committed by gbuesing on 2008-01-16 20:07:10
Introducing DateTime #utc, #utc? and #utc_offset, for duck-typing compatibility with Time. Closes #10002
M /trunk/activesupport/CHANGELOG
M /trunk/activesupport/lib/active_support/core_ext/date_time/calculations.rb
M /trunk/activesupport/test/core_ext/date_time_ext_test.rb
TEST FAILURES AND
2011 Sep 18
9
Rails 3 and postgresql
I have a simple project created around a very, very simple database: one
main table packs with just three rows
Column | Type |
Modifiers
--------+-----------------------------+----------------------------------------------------
id | integer | not null default
nextval(''packs_id_seq''::regclass)
nombre | character
2006 May 28
1
ActiveRecord: FK constraints problem
Hi all.
I have has_and_belongs_to_many association between models: Section and
Content.
class Section < ActiveRecord::Base
acts_as_tree
has_and_belongs_to_many :contents
belongs_to :default_content, :class_name => ''Content'', :foreign_key =>
''default_content_id'', :dependent => :nullify
end
class Content < ActiveRecord::Base
belongs_to
2006 May 04
5
create databases with rake
hi,
is there a way to create the database (say development and or
production) specified in database.yml with rake?
thanks,
Enrico
--
"The only thing necessary for the triumph of evil
is for good men to do nothing"
Edmund Burke
2004 Aug 06
2
[Re: icecast2 ??]
Behold, gtgbr@gmx.net hath decreed:
>
> Well, I think saying that Xiph.org doesn't care about its users at all
> is too harsh. On the other hand, there's some truth in this, and I
> highly appreciate it. If you want to stick to MP3, Icecast1 is for you -
> nobody forces you to use it (or not), and you're also free to use
> something else. Xiph.org, i.e. Jack