Displaying 20 results from an estimated 10000 matches similar to: "index columns in postgres"
2012 Jun 27
2
Select Helper Array of Array + Filter
Noob alert!
Hi, I am having trouble figuring out how to filter a select helper. The
following shows all of the rows in the table but I would like to filter
the collection from the list_name column (:list_name => "Project
Status"):
@project_status = Valuelist.all.collect {|s| [s.list_value,s.id]}
Thanks in advance, James
--
Posted via http://www.ruby-forum.com/.
--
You received
2006 Mar 27
5
Fixtures, Postgres & Constraints
Anyone have any tips for handling postgres constraints when using
fixtures to load the database, other than to sort out the proper
insertion orders or leaving the constraints out? I''d prefer not to do
the former since I''d rather use my app to generate my fixture data
(using a dump_fixtures task) and I''d prefer not to do the latter
because leaving out constraints till the
2006 Jun 16
0
trying to pick up a little speed...
I have a ''find'' screen where I am populating some select lists in the
controller (perhaps some of this should be moved to the model).
I am still using this in development mode so I am not getting benefit of
locked models and caching anyway but in...
def find
@personnel = Personnel.find(:all)
@main_office = Facility.new(:name => "Main Office")
@float =
2006 Aug 18
7
Linux - Rails - PostgreSQL partitioning
I am getting some larger hard drives and will migrate my intranet
application onto the new hard drives. I am using CentOS 4. The current
setup uses one small boot volume (ext2) and the rest is partitioned into
one big LVM.
Does it make sense to partition /var/lib/pgsql separately? (thinking
mostly in terms of performance)
Craig
2006 Apr 15
8
Migrations - adding a new table and automatically creating records
I want to create table called roles and then populate it with some new
records...This doesn''t work. Is there something I''m missing?
Craig
class AddRightsAndRolesTables < ActiveRecord::Migration
def self.up
create_table :roles do |t|
t.column "name", :string
end
Role.reset_column_information
Role.new :name => "Users Admin"
2006 May 17
5
text_field_with_auto_complete (newbie question)
I have the text_field_with_auto_complete woking on my user DB using
last_name. so looking for ''ivanoff'' works great, but I can''t find
''john''. Plus I like to have ''last_name, first_name'' show up in the
dropdown.
what I can''t figure out is how to concat first_name and last_name to
make a name and use that to look it.
working
2006 Jun 24
2
date madness
I have a column called ''time_in'' and it is actually a timestamp so it
has a date and a time.
I created a method in my model called time_in_date which is simply
time_in.strftime("%m/%d/%Y")
I can''t do an sql find on a column that doesn''t exist so how do I find
for a specific date?
Craig
2006 Mar 26
17
activeldap
Obviously I am missing something and I don''t know what it is...
I am following the instructions at
http://rubyforge.org/docman/view.php/381/114/activeldap_rb.html
and also here...
http://wiki.rubyonrails.org/rails/pages/HowtoAuthenticateViaLdap
my model looks exactly like this...
class LdapUser < ActiveRecord::Base
ldap_mapping :dnattr => ''uid'', :prefix
2006 Feb 07
7
select list error - following Agile guide
I would swear that I am tracking exactly the method used in Agile
book...
TypeError in Placements#edit
Showing app/views/placements/_form.rhtml where line #33 raised:
wrong argument type String (expected Module)
Extracted source (around line #33):
30: <tr>
31: <td><label for "type">Type</label></br><%=
32: options = [["Select
2006 Feb 21
8
Validations continued
I simply can''t figure this out. I have been reading and re-reading Agile
book and wiki.rubyonrails.org - all sorts of validation methods and
still, it doesn''t work.
Controller code
def create
@client = Client.new(params[:client])
if @client.save!
flash[:notice] = ''Client was successfully created.''
redirect_to :action =>
2006 Jan 25
7
join fields for list views
I am sitting with the Agile book on my desk and scratching my head at
the discussion on aggregation - perhaps that isn''t what I need.
I have a db called clients.
fields include - first_name middle_initial last_name
I want to combine them all into one name element in a list view. I can
add/edit the fields separately but in the list view, I only want the one
combo field.
Is there a
2006 Apr 05
11
session error in rails 1.1
I keep getting this error in rails 1.1, does anybody know what it means? My
site will be working fine, i do some more development, get a parse error,
and then all of a sudden the page 404''s with the following error
Session contains objects whose class definition isn''t available
Remember to require the classes for all objects kept in the session.
(Original exception:
2006 Mar 10
6
boolean select problem
I want to use select form elements to choose between boolean options. How
can I have it default to true and still display the persisted value (either
true or false) when editing an existing object? I guess booleans default to
false by default so its not obvious how to recognize when it''s a real
''false'' that the user set or default false because the value was null.
2006 May 29
5
Find last
This seems rather ugly. I am thinking that this needs to be in the model
but I am looking to obtain the date for a tb test...
>> @tb = Innoculation.find(:all,
:conditions => ["personnel_id = 1 AND innoc_type = ''TB''"],
:order => ''innoc_date DESC'')
=> [#<Innoculation:0xb77ed234 @attributes={"id"=>"1",
2006 Jun 04
3
link_to tool tips
I think they are called tool tips...
I have view code that looks like this...
<%= link_to ''I'', :action => ''edit_innoculations'', :id => personnel %>
Is there an option (I don''t see it in api) to have tool tips for a
link_to ?
Craig
2006 Mar 11
4
Unable to add computer to domain
I have an OpenLDAP backend, Samba knows how to talk to it, my Samba users
are stored in LDAP and file shares work fine authenticating to the LDAP
server.
I tried executing smbldap-useradd -w server02 on the command-line and got
the following error:
failed to perform search; Can't contact LDAP server at
/usr/lib/perl5/vendor_perl/5.8.7/smbldap_tools.pm line 362, <DATA> line 283.
Error
2006 Feb 28
7
multi-page printing moving on
I have some nice forms done using stylesheets. I currently have them
displaying on screen and the user could simply just print.
This works when there is only one form (facility) to be viewed/printed.
I have created the looping code necessary to print for all facilities
but that doesn''t work for me because each page uses stylesheets with
<div> that do absolute positioning and thus
2006 Feb 08
7
DRY methodology
because I am a grasshopper...
Now that I can sort my ''list''...is there a logical way of not repeating
myself to having essentially the same list view with multiple sorts?
i.e.
def list_cl
# ordered by clients last name
@placement_pages, @placements = paginate(
:placements,
:include => [:client],
:order_by =>
2006 Feb 18
3
Samba LDAP PDC BDC quit working
We have had a Samba LDAP-PDC-BDC system setup for close to 3 months with
about 60 computers in the domain. Earlier we had a power outage and
about 30 computers no longer were able to log into the domain or
authenticate. Some were NT Workstations and some were W2k. But not all
NT or W2K workstations were affected.
If we went to network neighborhood we would see the error message
"
2006 Feb 03
4
contoller code mysteries
In my controller...this code works
def list2
first_name = params[:client][:first_name]
@myclients = Client.find(:all, :conditions =>
["first_name = :first_name", {:first_name => first_name}])
end
this code doesn''t...
def list2
first_name = params[:client][:first_name]
if first_name
searchstring = ''["first_name =