similar to: ActiveRecord query using association

Displaying 15 results from an estimated 15 matches similar to: "ActiveRecord query using association"

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?
2004 Jul 31
1
failure running an at job from a root preexec
Hi folks, I'm having a problem queuing an 'at' job from a root preexec. I have a shell script which queries LDAP for per-user quota information and sets the local filesystem quotas accordingly. This runs, and runs fine, out of the root preexec on our users home share. But we bin running a server with broken quotas for a while, and had to turn quotas off. We're ready to try
2008 Jul 08
3
undefined method `name' ...........
Hi Community.... I''m new in this game, so this might be a easy question, but I have done my google, without result, so I will try this.... I''m learning ROR, and I''m using Patrick Lens ''Ruby on Rails'' book. (This is written for ror 1.x - and I''m using NetBeans 6.1 - ror 2.x - this might be the problem...) But... I have made this
2002 Jul 22
1
Printer Migration hackery
Hokay. It appears that enumdrivers / getdriver in rpcclient is broken, and won't be fixed soon. I'd fix it meself, but hey, I'm too busy clearing skyscrapers in a single bound and moving faster than a speeding bullet. Or maybe I looked at the cvs once and got REALLY scared. Unfortunately, I can't wait, so I've come up with a nasty hack to help us with querying samba for the
2006 Aug 17
2
validates_associated bug?
i seem to be experiencing a bug where rails tells me that my organization object''s associated credit card is invalid (activerecord validation-wise invalid), when i know it to be valid. this happens only if i tell the organization to validate_associated :credit_card. i know the associated credit card is valid, because a) that credit_card object itself throws no validation errors, and b)
2007 Feb 13
1
observe_field and select box
Hi everyone, I am a newbee in RoR and i could use some help. I have a select box populated by: <select name = "test_company" id = "test_company"> <option selected value=test.company.to_s>Create New </option> <%= options_for_select Company.find(:all, :conditions => ["name =?", test.company], :order => "id asc").collect{|c|
2006 Jul 31
2
updating records in a many-to-many relationship
Im trying to establish relationships in a many to many table. When I create a user, I do this to insert the different relationships between the user and sports: c.sports<<Sport.find_all_by_name(params[:sports]) where c is the user. The problem is, when I edit this user, and lets say he adds a sport, I can''t use this because I get an error saying that some records already
2006 Sep 09
1
options_from_collection_for_select
I''ve looked at the API on this but can''t quite see what I''m missing from my call <select id="pay[pay_id] name="pay[pay_id]"> <%= options_from_collection_for_select( Pay.find_all_by_name, "id", "name") %> #<- line 5 </select> is returning - Showing app/views/kr/index.rhtml where line #5 raised: wrong number
2006 Jul 29
1
creating and storing records in Ruby
I''ve read through my RoR books and I can''t seem to find the solution. This is a pretty basic, easy, and practical application for RoR. If you guys know of any resources on the net to answer these questions let me know. Question 1: Basically, I have a many-to-many relationship that I want to add records to. I use something like this to add records in the A_B table:
2006 Oct 23
10
text_field_with_auto_complete
Hi,all I''ve used text_field_with_auto_complete for a while but still haven''t figured out how to store the value that I selected from the suggested options. any hints? Thanks! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2008 May 22
9
Retrieving Mutliple Records using find_by_*
I was hoping that AR''s find_by_* magic methods would help me retrieve multiple items somewhat like the following: names_to_find = [''Larry'', ''Moe'', ''Curly''] found_people = Person.find_by_name(names_to_find) Is there a way to accomplish this using find_by_* (or even find(:all) using some sort of conditions) or must I resort to SQL
2002 Jul 20
0
rpcclient -c enumdrivers 3 segfaults. HELP
I'm so nearly there.... We are trying to set up a Domain with W2K workstations and samba servers, backended with openldap. We are setting the samba servers up to kickstart (in the redhat stylee), and so we want to install the printers and drivers from LDAP. Now we're letting samba pull the printers from printcap, and setting up the drivers using APW, as this seems the cleanest way. But
2006 May 25
0
uninitialized constant
I have tried to create and use my own Exception class, AmbigouosPlaceException. I can''t seem to use my exception though, as I get the following FRUSTRATING error... ----- Error ----- uninitialized constant AmbiguousPlaceException C:/app/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/dependencies.rb:89:in `const_missing''
2007 Sep 17
8
DISTINCT?
This should be easy, but I''m stumped... class X < ActiveRecord::Base belongs_to :y end class Y < ActiveRecord::Base has_many :x end The y table has a column names. The x table has a column value. I want the list of values in x for the name "Location" in y. Yes, there are many repetitions. I can probably hack together an SQL statement to do this without too much
2006 Aug 12
0
issues with relationships and multiple objects on one form
Hello, 1. I have a form that edits a User and a Person at the same time. The controller is for the User. Everything works fine, except the fields that are populated by the Person fields lose state when validation fails. Do I use params to populate the user? I have tried a bunch of combinations with no luck. 2. The same users table has an integer column called