Displaying 17 results from an estimated 17 matches for "dandant".
Did you mean:
dandante
2006 May 08
8
enforcing special behavior of child rows in HABTM
Hi,
I have a scenario where a doctor can have one or more specialties.
For each doctor, one and only one of her specialties can be designated
as primary.
So I have tables called doctors, specialties, and doctors_specialties,
the last of which has a boolean is_primary column.
The doctor model class specifies that:
has_and_belongs_to_many :specialties
I want to enforce, at the lowest possible
2006 Feb 15
5
dispatch.cgi error affecting specific browsers
I have a rails app that is accessed through Apache 2 (just using cgi
now; will add fastcgi later when everything is working).
The app works fine with some os/browser combos at my work site:
windows/IE
Mac/safari
Mac/firefox
Linux/firefox
But it fails on windows/firefox and my colleague''s (at a different site)
mac/safari (we are running the same os version and version of safari)
The
2006 Feb 15
5
strange behavior with has_many and size
...>
It still shows 1.
This is using Ruby 1.8.2 and locomotive on Mac Os X 10.4.4 with
PostgreSQL 7.4.
I hesitate to post more details of the tables or the has_many
relationship because it is proprietary stuff, but if anyone wants to
email me off-list I can provide more info.
Thanks
Dan
dan at dandante dot calm without the l
--
Posted via http://www.ruby-forum.com/.
2005 Dec 17
10
need some tips for applying patches
I am working with a legacy database that does not always follow the
conventions for table names, primary key and foreign key column names,
and join table names.
This is no problem in my application code because Rails allows me to
override the defaults. However it is making unit testing next to
impossible because fixtures will still try and insert data into the
wrong tables.
Changing the
2005 Dec 16
12
validates_presence_of not working
Hi,
I''m new to ruby and rails. I just created a simple update page and the
update works fine if all form fields are filled in. However there is one
field that should never be allowed to be blank. So I put this in my
model:
class Topic < ActiveRecord::Base
validates_presence_of :dr_title
validates_length_of :dr_title, :minimum => 1
So, when I submit the form with a blank
2006 May 22
2
selectively disabling parameter logging in controllers
By default, Rails logs all parameters passed to a controller method.
As far as I can tell, this happens in both development and production
modes.
I have a form that collects some sensitive data. I don''t want that data
sent to the log, at least not in production mode. Of course, I''d still
like to log everything else. Is there a way to accomplish this?
--
Posted via
2006 Mar 17
1
graceful session expiry?
According to the Rails book, the session object has an attribute called
:session_expires, but they don''t encourage its use. Currently I handle
session expiry by using a cron job to delete session files that have not
been modified in the last X minutes (it is a design/security requirement
for this project that sessions expire after a finite period of
inactivity).
However, this is a
2006 Mar 29
0
active record bug?
I have some code that generates the following log entries (annotated
with #).
The code takes place inside a transaction.
A record is inserted. Then I get the of the newly inserted record, then
I explicitly
select that record (this is just to illustrate the problem). Then
another insert is attempted
and fails because of a constraint that requires one of the values
entered to be an existing
2006 Feb 14
2
nulls changing to blanks
Hi,
I have forms that are used to update rows in a table. There are some
columns that allow nulls in the table.
Say that column X is allowed to be null. The text box for column X shows
up with nothing in it because it is null. When I hit submit on the
update page, the value of that column is changed from null to blank (the
empty string, or ''''). This might sound trivial, but
2006 Feb 24
0
preloading children of child rows
I am working on a rails app to serve as the admin app for an existing
java webapp. For this reason, I am constrained by the current database
structure, which does not by any means conform to the ideal rails
defaults.
Anyway, I have the following models:
class Provider...
belongs_to: login
class Login...
has_and_belongs_to_many :demographics
class Demograpics...
...
Everyone has a
2006 Jan 03
0
habtm and insert_sql
Briefly, I want to create an :insert_sql attribute for
a has_and_belongs_to_many relationship, and then add items to that
relationship using push_with_attributes. Is that possible?
Less briefly:
I have a legacy postgresql database where one of the join tables has an
ID column, so I had to set up the association with a custom :finder_sql
attribute, as follows:
class Topic <
2005 Dec 18
1
problems with text_field_with_autocomplete
I''m trying to set up a search field with autocomplete. I have verified
that the server is called when I type a letter in the box, and that the
handler creates the correct instance variable. However, I never see the
partial that is supposed to be rendered.
Here are the relevant files. I included their paths/names in case I am
missing some nuance of the naming conventions.
2005 Dec 28
2
where is WEBrick (daemon mode) output? not in log/server.log
I am running WEBrick in daemon mode (with the -d option). Where is the
server output that would ordinarily be on my console if I ran without
the -d option?
APP_ROOT/log/server.log is empty and not being appended to, though it is
owned by the same user WEBrick is running as and has write permissions.
The only files in APP_ROOT/log are:
development.log
production.log
server.log
test.log
Where
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 =
2006 Mar 10
4
problem when looping through habtm children in a view
I have this code in a view:
<% for topic in @topics %>
<%= topic.id %> <%= topic.dr_title %><br/>
<ul>
<% for doc in topic.child_documents %>
<%= doc.dr_title %><br/>
<% doc = nil %>
<% end %>
</ul>
<% end %>
Though the topic titles and IDs display correctly,
2006 Jan 19
4
hash fixture access broken in functional test
I have a functional test class that uses the "topics" fixture. I
verified that the fixture is loaded into the database by doing this:
assert_equal 2, Topic.find_all.size
So I should have an instance variable called @topics and instance
variables for each of the rows in the fixture, in this case, @first and
@another. But all those variables are nil inside my test method.
Is that
2006 Mar 29
2
inserts now set unset columns to null
Hi,
I upgraded to Ruby 1.8.4 and whatever the latest Rails is as of March 29
2006.
I am using PostgreSQL 7.4.
With the earlier version of rails, I had insert queries that looked like
this:
Topic Create (0.001189) INSERT INTO topics ("inlibrary",
"irx_display_title", "irx_title", "title", "creation_stamp",
"last_update_stamp",