search for: m000860

Displaying 8 results from an estimated 8 matches for "m000860".

Did you mean: 000860
2006 Jul 07
1
Listing Mysql Results
how can i make the first item the newest? (date DESC) -- Posted via http://www.ruby-forum.com/.
2006 May 09
1
select specified fields from a record
ok, here is my question, how can i select only one or two, three.. etc fields from a sentence, for example, i only want to know the id, name from de User model User.find(:first, :condiions => ["id = ?", @id]) how can i specify what fields i want?? -- Posted via http://www.ruby-forum.com/.
2006 May 19
1
Passing id arrays to sql
Is there a way to pass an id array to find()? -- Posted via http://www.ruby-forum.com/.
2006 Apr 19
3
newbie question : select distinct in model
Hi guys, I''m new so be gentle :-) How do I put the following into a method inside a model.... select distinct(pairing_id), description from pairings_stories, pairings where pairing_id = pairings.id order by description I basically want to have a @pairlist = Pairing.UniqueBookList line in a controller. Just not sure how to wire up this method in the model. And do I use
2006 Jul 18
5
a best way to write this.
I have a form, with 3 fields, then in my controller I get the paramters to run a query but I don''t want to filter with paramters if they are nil or blank... I''m doing this @condition = '''' if(params.....) @condition = @condition + " myparamter = " + params[..... if(params.....) @condition = @condition + " myparamter = " +
2006 Apr 10
5
ActiveRecord: Behavior not doumented
Hello everbody, doing a #find(:first,an_id) with Rails 1.1.0 I expected that find returns the record which id mathches the given parameter an_id or nil if it couldn''t be found. This behaviour is documented on api.rubyonrails.org. But the find returns the first available object and not nil if an_id is not in the db. Is the doc on rubyonrails.org out of sync? Greetings, -- Daniel
2006 Apr 16
11
Best way to sort categories w/ pager
Ahoy, I made this pager, " def list @item_pages = Paginator.new self, Item.count, 10, @params[''page''] @items = Item.find :all, :conditions => "category_id = #{params[:condition]}", :limit => @item_pages.items_per_page, :offset => @item_pages.current.offset @categories = Category.find_all
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/.