Displaying 20 results from an estimated 6000 matches similar to: "Which postgresql adapter to use for rails core? How about production?"
2006 Mar 06
6
Executing SQL in rails, and the types of the data returned
Hi,
Every once in while I have to run SQL by hand, in my models mostly. But
I''m wondering if there is a better way of doing it than I do. And, I
have a question concerning types of the fields in the result the query
produces.
First, about the types. In a certain model, to get and return the value
of a boolean function, I have to do:
result =
2006 Dec 04
7
I need help to connect Postgres and Ruby on Rails Please.
Hello to everyone, I have a problem that is giving me a headache, and
trying to do a project in Ruby on Rails and I need to connect with a
Data Base that is en Postgres, the truth is that I didn’t think that it
was so hard to connect a DB with postgres because I was working with
Msyql and everything was easy. This are the thinks that I have install
in my computer.
1. Debian GNU/Linux, kernel
2006 Mar 17
3
Timestamps casted to nil?
Hi,
for some reason, all timestamp fields with or without time zone in my
Postgres tables seem to be casted to nil. From console:
>> me = User.find(''PS12345'')
=> #<User:0x2379788 @attributes={"mtime"=>"01.03.2006 13:26:32.737166",
"valid"=>"8", "valid_from"=>"01.03.1999 14:09:21 CET",
2006 Nov 24
7
Anyone know whats going on with PostgreSQL async_exec errors?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Anyone know what''s going on with ActiveRecord Edge and 1.2RC1 unit
tests. I get 13 failures from the "async_exec" method call. ie:
test_callback_rollback_in_save(ConcurrentTransactionTest):
ActiveRecord::StatementInvalid: NoMethodError: undefined method
`async_exec'' for #<PGconn:0xb75a8754>: SET
2006 May 11
12
Verifying Good Setup of RoR + PostgreSQL
I''ve been reading the RoR tutorials and wiki help stuff, but I''m stuck. :(
I''ve got RoR installed properly and get the "Welcome aboard! You''re
riding the rails." I have an "article" controller, "article" model, and
both an "article" and "articles" views (one is a remnant, I think, and
no longer needed) (the
2006 Jan 23
5
Undefined method error
Hi everybody,
Small problem. I get this error:
undefined method `all_categories'' for BlogCategory:Class
Code of BlogCategory class is:
class BlogCategory < ActiveRecord::Base
has_and_belongs_to_many :blog_posts
validates_presence_of :name
validates_uniqueness_of :name
# Return all categories ordered by name
def all_categories
find :all, :order =>
2006 May 19
7
AR transactions and isolation levels
I''m trying to create a sequence with no gaps in my db (contrived
example, but should work out the same as my real one), and believe
db-managed transactions are the way to go about this.
It''s my first real ''go'' at transactions, so I may be mistaken about
how things really work.
Anyway.. Consider this example code:
Class Invoice < ActiveRecord::Base
def
2006 Mar 07
4
Get rid of the "public"
Hello to all!
First I want to appologize if this topic has been already discussed but
the search does not work :)
I have RoR installed on a shared server. I also have a RoR application
installed in a subdomain. The structure is as follows:
www //this is my home WWW folder
+--- www //maps to www.mydomain.com
|
+--- webapp //maps to webapp.mydomain.com. Here is my RoR application
|
2006 Apr 25
3
rake test:units fails on Postgresql due to nil
Following the directions in:
http://www.xml.com/pub/a/2006/04/19/rest-on-rails.html?page=2
I get through the:
rake db:migrate
With the tables created properly but then when I run the:
rake test:units
I get a failure:
ActiveRecord::StatementInvalid: RuntimeError: ERROR C23502 Mnull
value in column "title" violates not-null constraint FexecMain.c
L1750
2007 Feb 28
12
Specifying that code is called in a block
Not sure if this is possible currently.
I have a section of code like this:
ActiveRecord::Base.transaction do
cow.save!
duck.save!
dog.save!
end
(Names changed to protect the innocent.)
I''d like to specify that the saves run in a transaction. I can do
ActiveRecord::Base.should_receive(:transaction).and_yield
But is there any way to specify that the code is
2007 Mar 05
3
postgres barfage revisted
First of all, I''d like to do what I''ve seen several others here do:
thank Ezra and any other contributors for producing a really great
plugin. Even though I''m having some minor problems, this is all so
approachable and easy to work with and dig into... I hate to think of
the hoops you''d need to jump through (both as creator of such a system
and as a user) to
2007 Apr 18
1
Postgres-pr interface not found
I''ve installed the postgres-pr gem, and it is found using gem list
v0.4.0.
In my active record source, inside the postgresql_adapter.rb file, I''ve
changed line 7 from:
require_library_or_gem ''postgres'' unless
self.class.const_defined?(:PGconn)
to:
require_library_or_gem ''postgres-pr'' unless
self.class.const_defined?(:PGconn)
...to try and
2005 Dec 19
2
update_attrbutes without saving?
Hello all,
Is there a method for updating all the attributes from a hash without
saving to the database? (the counterpart of update_attributes but
without saving).
What I want to do is:
person = Person.find(params[:id])
person.update_without_saving(params[:person]) #update the in-memory
object.
# Process person object
.......
person.save
I know that when you are creating a new object, you can
2006 Jan 29
2
field sets and unicode
Hello gentlemen,
I''ve forced to such unicode problem:
I have:
<%= text_field_tag ''search'', nil, :id => ''search'', :size => 10 %>
<%= observe_field ''search'',
:url => {:controller =>
2006 Mar 28
8
Rails 1.1: not-null constraint violations
Since upgrading to Rails 1.1, I now get these errors:
PGError: ERROR: null value in column "added" violates not-null
constraint
: INSERT INTO authors ("added", ...) VALUES(NULL, ...)
The ''added'' column has a default of current_timestamp, and this used to
work fine with Rails 1.0. Are we supposed to put default values in
models'' before_create or
2006 May 18
5
Overriding default DELETE behavior with logical deletes
Hello!
I am trying to figure out how to implement *logical deletes* instead of
physical deletes using ActiveRecord. Basically, in many applications
that deal with E-Commerce, you really can''t physically delete almost
anything, because records must be kept for auditing and customer service
tracking purposes.
In the past, I''ve implemented logical deletes as follows:
1.
2006 Jan 26
3
Problems with simple scaffold code
Hi all,
I had scaffold generate some code on a brand new app the trace is here:
http://rafb.net/paste/results/H87GHC68.html
Could you point me to what problem needs to be fixed please as i''ve been
banging my head against this for some time now?
The table is very simple and its called "user" with id, email, password
fields. I''ve set pluralize_table_names to false
2008 Dec 28
7
2.2.2 simple_captcha upgrade error
So thanks to Craig, i got up and running on rails 2.2.2, though now i''m
dealing with a whole new can of worms. I''ve done a good bit o searching
and haven''t found any solid leads. I''m using the simple_captcha plugin
on my site, and all is well until i call that plugin.
http://www.pastie.org/347721
ActionView::TemplateError (undefined method
2005 Aug 17
1
RODBC and sqlColumns
I have a Postgres database that I am connecting to with the Postgres
ODBC driver on Windows XP in R 2.1.0. In the database is a database
with two schemas (public and X). With RODBC (1.1-4) , I can connect to
the database and get the tables with sqlTables(db). I can query tables
in the schema with sqlQuery("SELECT * FROM X.test"). However, I can't
get the columns in table X.test
2006 Mar 09
3
Building a model from a database view
Hi,
I''m trying to use rails to build a model from a database view.
I get this output
C:\dev\v6\project>ruby script/generate scaffold Assignment
...
error Before updating scaffolding from new DB schema, try creating a
tab
le for your model (Assignment)
Is this not possible in Rails? It would be *really* helpful for my
application.
-------------- next part --------------
An