Displaying 20 results from an estimated 3000 matches similar to: "Scalable alternative to #find_all"
2006 Jan 11
2
How to execute an SQL statement in rails?
Hello,
This is probably a silly question but looking at
"api.rubyonrails.org", I can''t seem to figure out which method I
should be using ... I want to execute an sql statement, like "truncate
table BLAH" from within one of my rails app ... What''s the "right" way
to do this?
Thanks,
/B
--
Bruno Mattarollo <bruno.mattarollo@gmail.com>
2006 Jul 22
5
Prototype error. replace content inside a <TR> in IE
Does anyone know of a fix for the issue with prototype and replacing
table rows in IE?
render :update do |page|
page.replace "row_#{params[:id]}", :partial =>
''wireless_request/wrequest'', :locals => {:wrequest => @wrequest}
end
This ends up making IE throw an "rjs error [object error]"
Searching around I found a couple of posts about
2006 Nov 21
14
Starting from scratch
I have the following models:
===
class Person < ActiveRecord::Base
has_many :person_organisations, :dependent => true
has_many :organisations, :through => :person_organisations
has_many :person_categories, :dependent => true
has_many :categories, :through => :person_categories
end
class Category < ActiveRecord::Base
has_many :person_categories, :dependent => true
2010 Feb 20
2
Problems accessing a file share using kerberos
Hi,
I'm trying to access a file share on what I believe is a netapp server
using kerberos authentication. I've done a kinit and gotten
credentials and then ran:
$ smbclient -U pedrocr //gsb-filer2/pedrocr -k -d10
This actually increased the number of credentials klist shows so looks
good in that regard. Howeever, I got the error:
"""
SPNEGO login failed:
2006 Aug 11
6
Running some code right before the app is available to users
I do some indexing using acts_as_ferret in a rails app. I need to do
some preloading of the index''s sort fields so that the first request
that sorts doesn''t take 5 minutes to complete. I tried sticking my
preload code in config/environment.rb and that worked but it gets ran
in rake migrations, tests, etc, when it''s not really needed. Is there
anything specific to
2007 Feb 25
3
Acts _As_Ferret - How to confirm Indexing is complete?
Hello I have a couple of questions, Hope someone here can help answer
them.
I am using acts_as_ferret on a model Item with around 10 million rows.
I use Item.rebuild_index at the ruby console to build the index. It
seems to run for at least 48 hours when building.
My questions are:
1) How do you know when the indexing is over and complete?
2) How can you confirm that ALL records in the table
2012 Feb 22
3
Automatic configuration of direct routes behind NAT
Hi,
I've followed the guide at:
http://blogs.operationaldynamics.com/andrew/software/research/using-tinc-vpn
and have a working tinc VPN. Here's my topology:
- CentralNode has a fixed public IP address that everyone connects to
- Leaf1 and Leaf2 may have different IP addresses depending on where
they are, and usually those will be behind NAT (think, two laptops
going around and you get
2006 Apr 27
1
Ferret crashing Ruby
I''ve gotten several problems with C ferret crashing ruby. Here''s the
stack trace of my latest case:
#0 0x00000050 in ?? ()
#1 0xb74028ab in iw_close (iw=0x8685a40) at index_rw.c:947
#2 0xb7414359 in index_destroy (self=0x829ebc0) at ind.c:89
#3 0xb73f00bc in frt_ind_free (p=0x829ebc0) at r_search.c:1564
#4 0xb7f04dca in rb_gc_call_finalizer_at_exit ()
from
2006 Jul 13
10
Problem with flashes staying on between pages
I have a login page that redirects to itself if the login is
incorrect. The browser does:
get login
post login, with wrong username and password
redirect back to login
When the post action redirects back to login it sets a flash telling
the user it failed. So far so good. The problem is that if I get
another page after that, the flash is still there. It only disapears
on the second.
2006 Jun 23
10
Don''t un-admin the last administrator
I have a User class with a field called admin which is a boolean that
determines if the user is or is not an administrator. I want to make it
impossible for the last administrator for an account to be removed from
the system.
I need to protect against this both when deleting a user and when
editing a user as you can revoke a user''s administrator privileges via a
form.
User
2006 Jun 19
6
SQL Search Qustion
I am working on writing a search method where a user can type a string
of words and I return all the objects that have fields that match all of
the words in one or a combination of fields.
Person
first_name
last_name
Pet
name
Person has_many :pets
I want to write some SQL so that if I search for "Tony AAAA" I will get
all the people who have Tony and AAA either in their
2006 Jun 26
8
[Semi OT] BlindDown and a floated div
I am using the drop shadow technique described at
http://www.1976design.com/blog/archive/2003/11/14/shadows/ to give
several of my divs drop shadows. That part works fine.
What doesn''t work so well is when I try to BlindDown a div in Firefox
and it ends up ignoring the content below it and just overlapping it.
In IE this problem does not occur. In Firefox the overlapping does
2006 Apr 22
6
nOOb question: How to use find_all with form input data
Hello,
I''m having a problem utilizing the find_all method with a value from a
form. I keep getting the following error:
Mysql::Error: #42S22Unknown column ''category_id11'' in ''where clause'':
SELECT * FROM items WHERE (category_id11)
The controller seems to be getting the correct data, but my key and
value seem to be mashed together(it''s
2006 Jul 12
1
When to use Mutex::synchronize?
I have a simple question when to the synchronize method in the Mutex
class.
Now that backgroundrb has allow_concurrency = true there is no need
to synchronize database calls in threads.
The question I have is lets say I have a simple method in my worker
as follows:
def some_method
SomeModel.find_all each do |obj|
obj.some_count += 1
obj.save!
end
end
It accesses the database, but
2006 Aug 18
3
RJS templates for DOM manipulation
I want to do some DOM manipulation with JavaScript. Specifically I
want to implement zoom in/out in a picture by changing it''s
width/height attributes. Is it possible to do this using RJS or should
I write javascript by hand?
All the examples of RJS I''ve seen write the javascript in the result
of an AJAX remote call. Where are the docs for RJS? All I''ve seen are
blog
2007 May 22
4
Process safe log files with multiple mongrels
I have a rails application that runs on multiple mongrels and I would
like to make the log files non-interlacing. Are there any logging
modifications/other loggers out there that I could use to create
process safe logging?
Thank you,
Matt Margolis
2014 Dec 28
5
Current state of Tinc 1.1?
On Mon, Dec 22, 2014 at 9:30 PM, Guus Sliepen <guus at tinc-vpn.org> wrote:
> Although the cryptography is now separated from the rest of the logic in
> tinc, it is not really replaceable, since only OpenSSL is supported.
> However, there is also a new protocol in tinc 1.1, which uses Ed25519
> and ChaCha-Poly1305. The code for those algorithms is included in tinc,
> so the
2006 Aug 25
7
disabling automatic indexing in acts_as_ferret
I''d like to be able to enable/disable the automatic indexing of
documents acts_as_ferret does. Something like MyModel.disable_indexing
MyModel.enable_indexing would be perfect. I need this because I do some
indexing that requires visiting the parents of the model objects and my
import method imports the children first, so the information isn''t there
yet. I''d like to
2006 Jul 31
1
Running setup code after boot
I''d like to run some caching code for my acts_as_ferret model after
booting but before starting to receive requests. I tried sticking it
into config/environments/production.rb but at that point it still
doesn''t have a logger and plugins are not included yet.
Anyone have any ideas on how do to this?
Thanks,
Pedro.
2006 Apr 07
3
List of all Models
Anyone know a pretty way to get a list of all Models?
That is, a list of all classes which inherit from ActiveRecord:Base
I can''t seem to figure it out!
The best I''ve got is to list the /app/models directory... but, that is
*dirty*.
-hampton.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: