similar to: find_all order question

Displaying 20 results from an estimated 2000 matches similar to: "find_all order question"

2006 Jul 07
7
Sequencing control with edit method in CRUD examples
I have been playing with the cookbook type of tutorials building a fish tournament scoring piece and am having a bit of a problem with a DB field called "points" in my "catch" table that is not input by the user but is calulated based on a "size" field that is input by the user. I have the following in my catch_controller.db def new @catch = Catch.new @fish =
2012 Dec 10
1
Marginal effects of ZINB models
Dear all, I am modeling the incidence of recreational anglers along a stretch of coastline, and with a vary large proportion of zeros (>80%) have chosen to use a zero inflated negative binomial (ZINB) distribution. I am using the same variables for both parts of the model, can anyone help me with R code to compute overall marginal effects of each variable? My model is specified as follows:
2005 Oct 24
3
bogus find_all in Rails 0.14.1
I have the following statement cl = ChatEvent.find_all("ev_type <> #{t} and chat_id = #{@params [:chat_id]} order by created_at") which produces the following error: #42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''order by created_at)'' at line 1: SELECT * FROM
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 Jan 24
4
How to filter an activerecord find_all...
I have a nice hierarchical table structure like this: divisions has_many groups groups belongs_to division has_many subgroups subgroups belongs_to group has_many units units belongs_to subgroup I have a report which is based on units, but i want to be able to filter the units by which subgroup, or which group, or which division. I also want to sort them by division.name,then group.name,
2006 Jul 09
9
undefined method stupidity
I put some code in a before_save callback in the model file to alter some fields that have dependencies in the DB. I''d like to call a method in the controller file but I continually get undefined method errors. I have specified Controller::methodname as well to no avail. What am I missing? -- Posted via http://www.ruby-forum.com/.
2006 Aug 14
1
Overide the default find_all
Hi, In my model i want to overide the default find all for sorting purposes. Is this possible or can this only be done in the control or by adding a custom method in the model. def self.find_all() @contents = Content.find(:all, :order => ''pos, position_id'') end -- Posted via http://www.ruby-forum.com/.
2006 Feb 20
5
find(:all) vs find_all
I started with Ruby on Rails in the 0.13.x period, so I''m sure I missed out on a lot of history. There''s probably some good explanation for something I''ve been wondering about, but I haven''t seen it written down anywhere. Maybe someone can clue me in. I''ve always felt that one of the uglier APIs was the ActiveRecord::find() method. I call
2006 Jul 05
10
Scalable alternative to #find_all
Is there any scalable alternative to iterating all the records of a certain model? #find_all seems to load everything into memory. With 500.000 records it will be a swap storm. Pedro.
2006 Jan 19
8
I can''t figure out how to solve this one
I am creating an application to run a fishing tournament (see http:// www.ruby-forum.com/topic/51209 for a little background) Now I am running into an issue trying to calculate a leader board. each participate can enter multiple fish but only the largest fish per a given species counts towards the overall score. My entries table looks like this:
2006 Jan 26
3
global objects?
Forgive the term global if that''s not applicable in rails (i come from a php background) I have a browse controller with a couple of different methods def method1 @properties = Property.find_all #other stuff for that method end def method2 @properties = Property.find_all #other stuff for that method end def method3 @properties = Property.find_all #other stuff for that method end I
2006 Mar 22
0
Wierd hash being returned from a .find_all call (usingmySQL)
I was following a basic todo list tutorial, and when I call a: @items = Listing.find_all render_text @items.inspect The following is displayed in my browser, and clues?... [#"Don", "category"=>"Human", "id"=>"1", "hidden"=>"0"}>, #"Cheese", "category"=>"Food",
2005 Mar 07
0
an escape from using find_all
Hi, I''ve got a form where I change and update the @cost values, I wanted to see a select tag showing all the clients names instead of inserting manually the code in the textbox... to do so I''ve used options_from_collection_for_select on another var @client (setted to find_all on the controller calling this viewer). <select name="client">
2017 Feb 02
2
AOSP buildbot fails with assert in :ScheduleDAGRRList::PickNodeToScheduleBottomUp
Hi Pengxuan, I just saw that the newly added AOSP buildbot allready builds LLVM very nicely. However, it is still red due to the following assertion: FAILED: out/target/product/angler/obj_arm/STATIC_LIBRARIES/libskia_static_intermediates/src/core/SkOpts.o /bin/bash -c "PWD=/proc/self/cwd ulimit -t 180; llvm.inst/bin/clang++ -I external/libjpeg-turbo -I external/libpng -I
2006 Feb 15
3
accepting and passing args to find
I have a method that I want to accept args like the "find" method does and I need to pass those args along to a find call. # in controller action: @projects = Project.find_allowed(session[:user], :order => "name") # start of the model method: def self.find_allowed(owner, *args) projects = self.find_all(args) ... No matter how I try to pass those args along I get
2006 Aug 14
2
finders et sous-classes
Bonjour, c''est ma premi?re question ici car d''habitude il me suffit de parcourir de tels forum pour trouver r?ponse ? mes questions. Donc cette fois, c''est du s?rieux, je n''ai pas r?ussi ? trouver la moindre ?vocation ? mon probl?me. Je vous explique. J''ai une famille de mod?les : class Attachement < ActiveRecord::Base ... end class Illustration
2007 Dec 09
3
Barchart, Pareto
Hello Well I am relatively new so some of these issues may not fall under the subject that I have used. 1. How do I do a Pareto. Following is the approach I took. My data looks like this df2_9 Reaason.for.failure Frequency 1 Phy Conn 1 2 Power failure 3 3 Server software 29 4 Server hardware 2 5 Server out of mem 32
2006 Apr 06
6
select method
The documentation states as an example: select("post", "person_id", Person.find_all.collect {|p| [ p.name, p.id ] }, { :include_blank => true }) could become: <select name="post[person_id]"> <option></option> <option value="1" selected="selected">David</option> <option
2006 Jan 19
6
One Last Question for me..
And then I should be ready to roll with my project.. I have some fine tuning of the looks to do after, but funtionality first! This is probably a rails question.. but I''m not sure where to sign up for the rails questions email group? (I guess I turned this into a 2 question email). I''ll ask here and then if someone will send me the url of where I go to sign up for the rails
2006 Mar 17
2
Temporary Model Data
I am trying to optimize some methods in my model so they don''t repeat CPU intensive algorithms every time I call the method in the same request/response cycle. Eg. ================ def invitations all_pgm_updates.find_all do |update| update.invited? end end ================ I want to do something like: ================ def invitations if @invitations.nil?