Displaying 20 results from an estimated 6000 matches similar to: "MySQL in dev, Postgres in prod - differences in "LIKE" query"
2006 Jan 09
3
Pagination :conditions not working - MySQL v. PostgreSQL, Rails abstraction v. embedded SQL
Hi everyone,
I have this code:
@person_pages, @people = paginate :person, :per_page => 20,
:conditions => [ "username LIKE ? OR first_name LIKE ? OR
last_name LIKE ? OR preferred_name LIKE ?",
"%" + params[:q].downcase + "%",
"%" + params[:q].downcase + "%",
2006 Feb 15
10
STI Question
Hi everyone,
I have 3 types of people (for now):
Staff
Faculty
Students
To break them up into classes, but keep them in the same People table,
I''ve broken them up like so (code and ''ends'' snipped):
class Person < ActiveRecord::Base
class Employee < Person
class Staff < Employee
class Faculty < Employee
class Student < Employee
So, when I insert
2006 Apr 20
7
Rails + postgres case insensitive searches.
Hello all
I am wondering how rails handles case sensitivity in databases. If I
do a Person.find_all_by_name("tim") in mysql I would expect to get
tim, TIm, and Tim. Do I only get tim in postgres?
How do other people deal with this? Do you resort to find_by_sql for
all your postgres queries to get case insensitive results?
2006 Feb 18
2
select widget in partial, can it use :index?
I know I can use :index => collection_counter with text_fields, but do
they work with any version of select form helpers?
Thanks!
Ian
2006 May 05
3
exception_notification plugin not sending mails in development on localhost
Hi everyone,
So, I''ve got exception_notification working now, but not in
development mode on localhost. In my ApplicationController, I''ve
added:
local_addresses.clear
Shouldn''t that be enough?
Thank you!
Sean
2006 Jan 31
6
Pagination - why is it this hard?
Hi everyone,
I''m at the end of my rope on this. I can''t get pagination to work
with anything but a standard find on a model. If I try to do a search
and customize the pagination, I get lots of different variations.
My thought was to have the list action do what it does, but to pass it
a list of search conditions from the search action. So, if search
determines that we need
2006 Mar 30
3
Model.find(:all) where Model.association has more then 0 items?
Hi everyone,
I have a Department model that has_many people. How do I go about
finding all departments with more than 0 people?
Department.find(:all, :conditions => Department.people.size > 0)
That, of course, doesn''t work, but it was as close as I could come.
Thanks!
Sean
2006 Mar 15
7
O''Reilly Rails Cookbook on Rough Cuts
Subject says it all. Anybody taken a look yet?
http://www.oreilly.com/catalog/railsckbk/?CMP=ILC-GG7423313304&ATT=railsckbk
After buying the Ruby Cookbook and the other Rails book, I''m pretty
gunshy about another Rough Cuts purchase.
Sean
2006 Mar 10
5
case insensitive search
I am having trouble with a simple gallery search.
I type in a segment of the address and i only
seem to be getting results if I use the correct case.
This is in my Gallery controller:
def search
@gallery = Gallery.find(:all, :include => :property,
:conditions => "address LIKE ''%#{@params[:keywords]}%''")
end
On a different note:
I am having
2006 May 25
4
Using an external database behind a firewall
Hi everyone,
There''s a separate database I''m using to get mail group info for our
users (Sympa), and I''ve got Rails configured to pull data directly
from it via an entry in database.yml
The issue we''re having is that the database server in question is
behind an internal firewall that has idle timeouts set at 30 minutes.
If the connection isn''t used
2006 Jan 20
3
postgres db setup
All of the tutorials and the Agile book use MySQL and I''ve got that
working. I am now trying to use PostgreSQL and can''t seem to get going.
Is my problem the db setup in postgresql?
I have installed postgres-pr
The error message when I try to access http://localhost:3000/clients
when using PostgreSQL (MySQL works fine)
ActiveRecord::StatementInvalid (RuntimeError:
ERROR
2006 May 05
1
NameError when running exception_notification plugin?
Hi all,
I installed the exception_notification plugin via ''script/plugin
install'', and when configure it and try to run it, I get:
NameError
uninitialized constant ExceptionNotifiable
This error occured while loading the following files:
application.rb
exception_notifiable.rb
In my application.rb, I added this:
include ExceptionNotifiable
And in my development
2006 Apr 11
2
Passwords in SVN?
Hi everyone,
Where do you all keep your passwords for your apps? Out Subversion
repo is locked down to authorized users, and only those users can see
code in Trac. Is it safe to store passwords in there? For Rails?
For other scripts? What''s your strategy for this?
Thanks!
Sean
2006 Jan 30
4
Is this a case for STI?
Hi everyone,
We have different populations of people here at our college: Staff,
Faculty, Students, Alumni (and a host of "Other" that I''ll worry about
another day.
I originally had only Staff and Faculty loaded in under a Person model
using a Personnel controller. Now I want to add the students in, so I
thought STI might be the way to go:
class Person < AR::Base
end
2006 May 18
4
Install Glitch
Ubuntu 5.10, Ruby 1.8.3. I installed rubygems, then tried rails, and
get a tragic looking error at the end. Is this a problem? It looks
related to rdoc.
root@bonus:/usr/local/rubygems-0.8.11# gem install rails --include-dependencies
Attempting local installation of ''rails''
Local gem file not found: rails*.gem
Attempting remote installation of ''rails''
2006 Jan 24
2
SwitchTower and multiple database.yml files - how do you deal with them?
Hi everyone,
What are other people doing with regards to database.yml being in
version control? My dilema:
I set up my rails app in svn using these instructions:
http://wiki.rubyonrails.com/rails/pages/HowtoUseRailsWithSubversion
The part to note is where I ignore database.yml, allowing different
developers to keep their own database.yml without clobbering other
developers'' files.
2006 Jan 23
1
Spawner -p and --port not working?
Hi everyone,
I''m trying to set a port with spawner, and it''s not working:
ruby /var/rails/ldapadmin/current/script/process/spinner -c
/var/rails/ldapadmin/current/script/process/spawner --port=7000 -i 4
-d
spinner: invalid option: --port=7000
Same with -p:
ruby /var/rails/ldapadmin/current/script/process/spinner -c
/var/rails/ldapadmin/current/script/process/spawner -p 7000
2006 Jan 30
1
AR load script only loading every other item?
Wow, this one is weird. I''ve got a file with data I want to import,
one item per line. When I run this code, only the first, third,
fifth, etc items get saved:
require ''../app/models/entitlement''
#### Add entitlements
f = File.open("../tmp/entitlements.csv")
f.each do |line|
id, code, description = line.chomp.split(''|'')
entitlement =
2005 Dec 23
3
Intergrating delicious?
Whats the best way of intergrating del.icio.us into a RoR app?
--
Posted via http://www.ruby-forum.com/.
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