Displaying 20 results from an estimated 20 matches for "lugovoi".
2006 Mar 05
6
Which postgresql adapter to use for rails core? How about production?
I wanted to fix some things up in the trunk, so I set up the databases
and ran the unit tests. A bunch fail for postgres, and even more
error out. I know of two postgresql adapters: postgres-pr and
ruby-postgres. Strangely, they each fail different tests. So if I
want to fix things up, which one should I be using? For that matter,
which adapter should I be using for production? Finding out
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
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 =>
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 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 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 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
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 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
2005 Dec 22
3
foreign_key setting ignored
I''m having a spot of bother creating a ''has_many'' relationship between
two legacy database tables. The relationship is ''company'' table has many
linked records in the ''contact'' table. Iv''e used ''generate scaffold'' on
these tables and everything is fine. I then decided to define the
relationship in the
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 Feb 19
2
possible rails -> postgresql bug
Hi I have a problem accessing an array field in a Postgresql database.
Here is the table definition.
View "neil.flashing_codes"
Column | Type | Modifiers
-------------+-----------------------+-----------
code | character varying(10) |
description | text |
folds | integer[] |
View definition:
SELECT
2006 Jan 24
9
ActionMailer: Mail isn''t delivered
Hi all
I used the search for this, but I got an Application Error, so sorry for
the newbie question.
I have tried to send an e-mail using ActionMailer. I have to following
config (environment.rb):
ActionMailer::Base.server_settings = {
:address => "mail.psyguide.org",
:port => 25,
:domain => "mail.psyguide.org",
#:authentication => :login,
#:user_name
2006 Mar 16
3
inserted_at seems buggy in production mode?
Hi,
I''ve got a table with an inserted_at column. When I insert a record it
automatically injects the current date/time, all is well.
Then when I insert a second record, it uses the exact same timestamp
that is used in the first record.
This behavior only seems to occur in production mode. When I restart the
server, the problem goes away but then immidetatly occurs again on the
2006 Mar 09
4
sort-weirdness - active record issue?
I''m selecting data into a controller and sorting it. The code (in the
controller) looks like this:
def index
@assignments = []
tasks = Task.find(:all, :conditions => ["person_id = ? and
actual_end_date is null", session[:user].id.to_s ])
issues = Issue.find(:all, :conditions => ["person_id = ? and status
<>
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 08
12
best way to combine results from two tables
I want to combine a selection of data from two tables and display it as
list. Note that this isn''t a join.
i''m looking for something like this:
Table 1: Sheep
Name, Age, Farmer, etc. (sheep specific columns)
Table 2: Cows:
Name, Age, Farmer, etc. (cow specific columns)
For my display I nneed something like this:
Farmer Jone''s Livestock:
TYPE NAME AGE
Cow
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