Displaying 20 results from an estimated 1000 matches similar to: "Manipulating collections"
2006 Feb 17
4
Table with Constants
I would like to have a table with some constants to use them later on
for a drop down menu. How can this be done?
My table looks like
Table with constants
------------------------
id | key | value | type
------------------------
1 | M | Male | sex
....
I know it can be done like this
<% select ''object'', ''method'', Constants.find(:all, :select =>
2008 Feb 14
3
CONFIG_PREEMPT_RT=y possible in Dom0 kernel?
HI,
Is it possible to specify CONFIG_PREEMPT_RT=y in the Dom0 kernel? It seems
that it is forbidden as it is not a menu option in make menuconfig and gets
removed if I manually add it to the .config.
I want to run a sound server on Dom0 and am having problems with xruns at
present, so need to be able to run a preemptive kernel.
Thanks,
Chris
_______________________________________________
2006 Apr 24
4
Joined search returns NIL ids
I have two models: assets and makes. Make has many assets and an asset
belongs to one make.
I am calling this part of my asset controller from a search form with
the parameters "search" (search term) and "field" (database field
heading) which then renders a partial with the search results on it.
########################################################
if
2006 Jun 14
3
Attributes for a model which are excluded from DB?
If I want to do this but not save to the database, how can I go about
it?
things.each do |thing|
changed = someotherqueryresult
thing.update_attribute :testattrib, changed
end
Essentially I want to create a collection called things with some extra
attributes that are not saved into the database, as they are just used
for sorting in a view and should not be saved (in fact saving them
wastes
2006 Mar 03
7
Meta Programming Help
I have the following two methods:
def ProductFile::find_images(mode, prod_id)
# convert to symbol in case it is not (most commonly it may be a String)
mode = mode.to_sym
case mode
when :all, :first
ProductFile::find(mode, :conditions => ["product_id = ? AND
file_type LIKE ?", prod_id, "image%"])
end
end
def ProductFile::find_documents(mode,
2006 Jul 18
6
RJS - Insert at top of table?
Quick question regarding RJS and inserting to the top of a table. Here''s
the view I''m working with:
<table id="links-list">
<tr>
<th>Display title</th>
<th>URL</th>
<th>Description</th>
<th>Category</th>
</tr>
<% for link in @links %>
<tr id="link-<%= h link.id
2005 Mar 04
2
Bluetooth phone as SIP handset?
Even better you can set your firefly softphone to auto answer so that
you don't even need to be near the pc to answer.
Cheers,
Dean
-----Original Message-----
From: asterisk-users-bounces@lists.digium.com
[mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Linn Boyd
Sent: Friday, March 04, 2005 2:12 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re:
2006 Jun 07
10
habtm "AND" find conditions
I have two tables and a join table for them
e.g. books, authors in a many to many relationship (habtm) and a join
table books_authors.
I can successfully search for a book that has
"author.id = 2 OR author.id = 4"
but I am unable to search for
"author.id = 2 AND author.id = 4"
This is because the result of all the joins only has one author.id
column so no single row has
2005 Mar 03
4
Getting phpconfig to work?
No, I have apache 1.3.33 and mod_ssl 2.8.22 installed. Do I need to have
apache2-mod_php installed?
Rgds,
Julius.
> DO you have apache2-mod_php installed ?
>
> Which distro are you using ?
>
>> -----Original Message-----
>> From: asterisk-users-bounces@lists.digium.com
>> [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of
>> Julius Kidubuka
>>
2005 Feb 20
10
HELP NEEDED! - Asterisk GUI
Hello,
I am trying to setup an Asterisk GUI with the help of astman(please visit
http://astman.sourceforge.net/am-user-guide.html).
I have installed astman and currently assessing my GUI using;
http://ipaddress-of-asteriskbox/cgi-perl/am-main.pl
I am trying to get the menu options in my GUI to work but to no avail.
Currently my parameters are set to;
Asterisk Install Directory:
2006 Jun 30
2
how to HABTM with STI ??
Hello all
This is my first post so excuse the basic question. (and any repeats I just
got an email saying this post was too big so I have re-submitted a smaller
version)
I was following the thread on
http://lists.rubyonrails.org/pipermail/rails/2006-May/038988.html regarding
the STI on HABTM for RoR.
I have a very similar problem and was hoping for some help.
I have the
2007 Jan 05
4
How To Spec Controllers with Finders
Given this code (which renders rjs), I''m faced with the fixture-
driven way of spec-ing or mocking. How the heck to you mock this so
the code at line (2) and (4) work right? I''m still struggling with
mocks but it seems like this can be done. Forgive the naivety of this
question.
1. def change_quantity
2. @line_item = LineItem.find_by_id(params[:id])
3. unless
2013 Sep 14
4
[LLVMdev] Heads up: Pass Manager changes will be starting shortly
I just wanted to give everyone a head up. I'm starting work on the pass
manager based on numerous list discussions and some IRC discussions.
The first steps will be marking the existing code as "legacy" and clearing
a path to build new facilities here. From there I'll start building the new
facilities without enabling them.
Some explicit legacy support goals:
1) I'm going
2006 Jul 19
0
Clearing dependent collections
I have a user model that owns messages :
class User < ActiveRecord::Base
has_many :messages , :dependent => :nullify
end
I''m using nullify so that when the user is deleted, the messages
continue to exist - they''re just marked as being ownerless.
However, calling user.messages.clear actually deletes all his
messages, which I was a little surprised at. I would
2001 Mar 03
1
Mounting folders with spaces in their names
I still have not been able to mount a folder called New Stuff in smbfs. I have tried:
mount -t smbfs -o username=tridge,password=foobar //MP3/New Stuff
mount -t smbfs -o username=tridge,password=foobar //MP3/New_Stuff
mount -t smbfs -o username=tridge,password=foobar //MP3/new_stuff
Nothing seems to work. The computer is called MP3 and the folder I want to open is called New Stuff. Its right
2009 Jun 15
1
enourmous amount of disc writes
Hi List,
on my mailserver (exim4, dovecot 1.0.0, postgresql, ubuntu dapper, about
500 users) I record an enourmous amount of disc writes (up to 18000
blocks written each second) in the time where most of users are active.
This IO activity causes wait-states on the disc interface (RAID5) and
finally slows down my mailmachine. Is there a explanation for these disc
writes respectively is there a
2006 Jan 02
3
Altering the accessor of an association collection
I want to be able to do something like this (for example):
class Person < ActiveRecord::Base
has_many :friends
def friends(living_in = :uk)
# filter based on parameters here
end
end
Is there any way I can redefine the accessor for an association whilst
still being able to get the values? Basically, I''m looking for an
equivilent of read_attribute() for associations.
--
2006 May 02
9
Updating only one field
At present, I use an update like this to set the user''s last login time:
authenticated_user.update_attribute(:last_login, Time.now)
However, this calls the following, updating all fields:
UPDATE users SET `last_login` = ''2006-05-02 13:27:41'', `hashed_password`
= ....
Is there any way I can tell ActionRecord to only update the one field?
I don''t really want
2008 Feb 08
4
x-post : find_or_initialize_by ActiveRecord bug? Ignores :conditions
Hello, I posted this on the rails talk group but received no
response. Perhaps someone on this list could weigh in on whether this
is expected/desired behavior or a bug that I should file and develop
failing tests for
(I doubt I have the active record method_missing fu to actually patch
it).
Test Scenario:
I would like to find or initialize a new user and base the find on the
users email
2005 Mar 03
0
RE: Getting phpconfig to work?
Hi,
When I do click on the phpconfig.php link from
http://ip-of-machine/phpconfig/, it returns a page with the actual
contents of that file (phpconfig.php) and doesn't load the page. See some
of the output below;
<?PHP
/**
*
* Asterisk configuration file interface script
*
*
*
*
*
* phpconfig:,v 1.0 2003/07/03 17:19:37
* Authors: Dave Packham <dave.packham@utah.edu>
*