similar to: Set default order for find(:all) in a model

Displaying 20 results from an estimated 1000 matches similar to: "Set default order for find(:all) in a model"

2006 Jan 24
4
Laszlo on Rails, Flash GUI
Ruby Forum Search did not work, and I did not find any postings about http://laszlo-plugin.rubyforge.org/. OpenLaszlo is a framework handling the GUI part, or the V in MVC. See http://www.laszlosystems.com/lps/laszlo-in-ten-minutes/ for info about Laszlo itself. My question is, does anybody have experience with this framework, especially combined with Rails? Or, could I get some of the best
2005 Nov 22
11
Building a conditions clause (for find) of multiple optional params?
I want to be able to find items according to various params - category_id, member_id, type_id, rating, etc. What I have now is something like: if(@params[''category_id'']) @items=Item.find(:all, :conditions=>["category_id=?", @params[''category_id'']) elsif(@params[''category_id''] and @params[''member_id''])
2006 Mar 13
7
Problem with params
I''ve got a User model, which holds the following (excerpt): def try_to_authenticate User.authenticate(self.username, self.password) end .. private def self.hash_password(password) Digest::SHA1.hexdigest(password) end def self.authenticate(username, password) @user = User.find(:all, :conditions => ["username = ? AND password = ?",
2006 May 04
9
Help: wrong number of arguments (0 for 1)
Is it my environment? Is something wrong, cause I thought this should just work? I have a simple table and I created a model and a controller: ruby script/generate controller Restaurant ruby script/generate model Restaurant I edited the controller to this: class RestaurantController < ApplicationController scaffold :Restaurant end I run it and: http://0.0.0.0:3000/Restaurant works fine,
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
2007 Jan 10
3
Rails 1.2.0 RC2 has 4125 duplicate lines
I have been evaluating the excellent and super fast Similarity Analyser by Red Hill Consulting to generate a dupplicated lines reports from Rails 1.2.0 RC2 source code (excluding the tests). On the 10th of January 2007, Rails 1.2.0 RC2 has 4125 duplicate lines in 793 blocks in 231 files * actionmailer has 584 duplicate lines in 107 blocks in 20 files * actionpack has 718 duplicate lines
2005 Nov 16
1
Rails app exception "can't activate active support"
I have gotten several rails apps running under Apache. However today when I tried to run them I get exceptions like this in the http error_log: sh-2.05b$ tail /var/log/httpd/error_log /usr/lib/ruby/site_ruby/1.8/rubygems.rb:144:in `activate'': can''t activate active support (= 1.1.1), already activated activesupport-1.2.3] (Gem::Exception) from
2007 Jan 05
5
php rpm centos4.4
Hi i need to install php when i download and install the cacti it say that and i can not find any pure php rpm but it is an php-excel and so on, what php should i use ? the yum command do noit find any php to update since i have php installed than it complains that it needs php-pear and i am in the same situation and i have several to choose among ..., php-ldap is missing ... Matthias Nilsson
2007 Mar 16
3
Unhidden predict methods
Hi, I've noted that not all `predict' methods are hidden in the namespace: > methods("predict") [1] predict.ar* predict.Arima* [3] predict.arima0* predict.glm [5] predict.HoltWinters* predict.lm [7] predict.loess* predict.mlm [9] predict.nls* predict.poly [11] predict.ppr* predict.prcomp* [13]
2003 Jun 19
2
Grouping binary data
Dear all, I'm analyzing a binary outcome using glm() with a binomial distribution and a logit link, and have now reached the point where I'd like to do some model checking. Since my data are in binary form I'd like to collapse over the cross-classification of the factors before the model checking. Are there any nice and simple ways doing this? If so, how? If not, I'd be
2008 Apr 04
7
User-specific sshd_config?
Hi. I wonder if it would be possible to implement support for a user-specific sshd_config. The primary reason is that I would like the ability to specify that I'm only allowed to login with a key pair, even though the system-wide sshd configuration still allows passwords for other users. Of course, a user-specific sshd_config file should not be able to break the security policy of the
2004 Sep 03
6
seq
Hi everyone, I've tried the below on R 1.9.1 and the 2004-08-30 builds of R 1.9.1 Patched and R 2.0.0 on Windows 2000, and the results are consistent. > seq(0.5, 0, by = -0.1) [1] 0.5 0.4 0.3 0.2 0.1 0.0 > seq(0.7, 0, by = -0.1) [1] 7.000000e-01 6.000000e-01 5.000000e-01 4.000000e-01 3.000000e-01 2.000000e-01 1.000000e-01 -1.110223e-16 Is this really the intended behaviour?
2006 Aug 13
1
establish_connection method
I''m digging into rails source code. But I''ve got a problem in undestading actionrecord::base source code which is connection_specification.rb. In the body of establish_connection method, def self.establish_connection(spec = nil) case spec when nil raise AdapterNotSpecified unless defined? RAILS_ENV establish_connection(RAILS_ENV)
2000 Jan 27
2
Many Unix accounts to one samba account
Hi Folks. I have set up a samba server on a machine running Linux 6.1 and it works perfectly. But i have a problem : Approx. 200 teachers are going to register the students absence, and I don't want them to have one password each. ( You know teachers and passwords ).. :-) I thought I could change the Samba password once per month and deliver it to the teachers by e-mail. But I dont want
2006 May 18
1
validates_uniqueness_of
I used validates_uniqueness_of it is case insensitive, it takes only admin not Admin. So please help me out how to put validates_uniqueness_of as case sensitive Thanks in Advance Surekha.Matte -- Posted via http://www.ruby-forum.com/.
2013 Feb 27
2
rc.d/sysctl fails to parse sysctl.conf
Hello, I tried to get my sound working, and long story short: rc.d/sysctl parses sysctl.conf wrongly if there are sysctls of the form mib=val1=val2 which is what you need for sound. For reference I needed/wanted dev.hdaa.4.nid25_config=as=1,seq=15 dev.hdaa.4.nid31_config=as=1 I believe the following patch would address the incorrect parsing: --- /etc/rc.d/sysctl.old 2013-02-27
2006 Nov 10
8
PeriodicalUpdater and popups.
Hi, I don''t know what might cause this, but maybe you do. If I put the code below in a html-file and open it in a popup. I get an error on row 129 in the latest prototype.js bundled with 1.6.5. popup.html: <script type="text/javascript" src="/inc/api/prototype.js"></script> <script type="text/javascript"> Event.observe(window,
2006 Oct 06
13
Need some help with latest win32-mmap
Hi all, I''ve got the latest win32-mmap code checked into CVS. Unfortunately, it seems that I''m not able to open an existing mapping and retrieve set data. Below is a simple example that seems like it ought to work but doesn''t. Any ideas? # map1.rb require ''win32/mmap'' include Win32 mmap = MMap.new(:name => ''alpha'', :size
2014 Sep 05
2
Opus decoding performance on ARM devices
Hi, Thank you for your response. I pulled yesterday to commit da97db1ca1f92592af3534c9a2596da0e9a009ca, added a bunch of more defines to my compile options, and assembled & linked in armopts.s,celt_pitch_xcorr_arm.s. Performance jumped up from about 4.8 Mb/s to 5.3 Mb/s on the same device, so it is improvement. Not sure what other tweaks there would be to try, but if it could match the
2013 Feb 03
1
Ports and WITH_LIBCPLUSPLUS
Hello, I wanted to try the new c++ stuff, ie clang-3.2, libc++ and libcxxrt, so I used poudriere to build a jail setup for that ( WITH_LIBCPLUSPLUS=yes in src.conf, CXXFLAGS+=-stdlib=libc++ and libsupc++.so.1 libcxxrt.so.1 in libmap.conf ), and started to build my normal set of packages ( see desktop.list ). Please note that I also have WITH_NEW_XORG=yes and WITH_KMS=yes, as well as using the