similar to: ''Implicit'' subselection of data in find?

Displaying 20 results from an estimated 1000 matches similar to: "''Implicit'' subselection of data in find?"

2010 Dec 20
4
Subselection by URL
Hey guys, I''m quite new in RoR, so please excuse me when I may ask weird questions. I am working on a database frontend. The layout looks mostly like a has_many bs b has_many cs c has_many ds and so on. Now I want to do some selection. Maybe I want to see all ds belonging to a specific b. I would like to do it like: http://my.host/bs/1/ds When I click around there (add new ds, show a d
2010 Feb 20
1
Contingency Table - output to odfWeave not working for matrix
Hi guys I'm hoping someone can help me with this. It should be easy but it seems to get stuck for no obvious reason! I am trying to set a report up in odfWeave so that we can re-run the same analysis at 3 time points as the data matures and provide an 'instant' report. To simplify the situation we have two pieces of data: site_id (numerical value 1-9) and reaction (categorical Y or
2010 Jan 20
0
putting labels back on a matrix.
I did not post this question to the ecology list, even though it is about an analysis using Vegan, since my question is based more on basic data manipulation in R. I think this is a fairly simple question but for the life of me I cannot find a reference for in the archives. I have an analysis using a matrix in which I needed to strip the ID variable off the input data to run the analysis. Now I
2008 Nov 14
1
[LLVMdev] vmkit, jvm, newbie bytecode translation + jit question
Greetings, I am searching for an alternative to sun's java implementation - one that is not under gpl.. I've been reading the vmkit code for JNI.. And I notice that it is not completely filled out yet... That's fine though, I see there is filled in function like most of the non implemented functions.. Couple of questions: Is the entire llvm required for java/cli vmkit to run?
2006 Jul 29
0
Accessing vars within helpers in Markaby
I''ve been trying to figure out how to do this: select_tag ''site_id'', @helpers.options_from_collection_for_select(Site.find(:all, :order=>''name''), ''id'', ''name'', @site_id) The select_tag gets output fine, but the default value isn''t set. @site_id is set in the controller (@site_id = cookies[:site_id]). In
2006 Nov 01
17
So how can I rewrite my app without using with_scope?
So, I hear that with_scope is going to be deprecated. Which is a bit of a shame, given the stuff I''ve been writing recently. I have a CMS with multiple clients. A ''client'' is essentially a company, with multiple users. Content on the site belongs to a client - content could be messages, images, schedules, etc etc. People belonging to one client should not be able
2005 Nov 25
2
acts_as_list with 2 fields in the scope
Hi Railers, I''ve got a Categories table. I want it to act as a list within the scope of the parent_id AND the site_id. Categories table : id label site_id parent_id So, in my Category class, I have : acts_as_list :scope => ''site_id = #{site_id} AND parent_id = # {parent_id}'' The problem is that when I try to move_up a Category with a parent_id that is null,
2008 Oct 16
1
merge/combine data
Hi, I have the following data imported from a csv file user_id site_id name 1 1 11 februari 2 1 11 redbook 3 1 11 tips 7 3 6 sleep 8 3 6 monitoring 9 3 6 alarm Which I would like to merge/combine into user_id site_id name 1 1 11 februari,
2006 Jul 14
5
Acts_As_Taggable Plugin multiple controllers.
I have Acts_As_Taggable Plugin working. I have a HR controller and a sales controller. I have a document in hr tagged whitepaper and a differnent document in sales tagged whitepaper when I am in hr I see the hr document tagged with whitepaper and not the sale document (what I want). but if I click on the tag whitepaper I return two documents, hr and sales. I just want to return the hr document
2008 Oct 31
0
Get an object other than primary key ID
Hello, i want to retrieve and object from a table other than primary key ID. eg: @sites.each do |@site| @site_id = @site.id @tower = Tower.find(:all, :conditions => ["site_id =?", @site_id]) Tower Belongs to Site. so Site_id is a reference in tower object. there will be only one Tower object for Site Object. Should we give relation as has_obne in
2007 Oct 18
9
with_scope issue
I have the following code: class User < ActiveRecord::Base has_many :requests do def find_active(options = {}) with_scope :find => { :conditions => ["requests.active = ?", true] } do find(:all, options) end end end end Executing user.requests.find_active results in the following SQL: SELECT * FROM requests WHERE (( requests.user_id = 10 ) AND (
2006 Apr 19
4
Weird Problem - probably a noob mistake
I was up late last night trying to find the cause of this, but I''m stumped. I have this relatively simple controller to load up a bio. It''s basicly id, name, desc, type (I use STI). class BioController < ApplicationController layout ''layouts/singlepanel'' def index @bio = Bio.find(:all, :conditions => [''site_id = ?'',
2006 Apr 01
1
STI with_scope on parent - bug or feature?
Hi, It seems that setting a with_scope on the parent class doesn''t do anything MyClass.with_scope(:find=>{:conditions=> ["somecol = ?", ''val'']}) do @ext_pages, @ext_rows = paginate :my_extended_class, { :per_page => 13 } end # this doesn''t generate WHERE somecol=''val'' In order for scope to work you have to call
2015 Jul 11
2
C coding tips please / Localisation
Hi Folks, Well, it has only been more than 6 weeks and still no response to my "No localisation for rsync?" topic. :( So far, I have determined that there are at least 4 files that need translations for rsync. They are the following. main.c flist.c log.c progress.c For my initial test I only made the following modifications. main.c ------ I added the following line ... #include
2007 Aug 21
3
Eager Loading
is there a way to always eagerly load an associated object so that you don''t have to put :include into every finder? class Product <ActiveRecord::Base belongs_to :user #always load user when product is loaded end Product.find(1).user.login #1 query since user was loaded with the product, same as if i used :include but I don''t want to have to specify it everywhere.
2006 Sep 08
1
has_many relationship extensions and scoping rules
Hi all ! Is this supposed to work ? class Email < ActiveRecord::Base has_many :to, :class_name => 'Recipient', :conditions => "recipients.source = 'to'" do def create!(*args) with_scope(:create => {:source => 'to'}) do super end end def build(*args) with_scope(:create => {:source => 'to'}) do
2006 Nov 21
2
Accessing scopes
If with_scope has been called previously, how do I access the find conditions dynamically? I am asking because I am using a find_by_sql call (which clobbers the with_scope). How can I access the method scoping so that I can read it and incorporate it into my query manually? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google
2005 Jul 12
4
Calculation of group summaries
I know R has a steep learning curve, but from where I stand the slope looks like a sheer cliff. I'm pawing through the available docs and have come across examples which come close to what I want but are proving difficult for me to modify for my use. Calculating simple group means is fairly straight forward: data(PlantGrowth) attach(PlantGrowth) stack(mean(unstack(PlantGrowth)))
2006 Oct 27
1
has_many with nullable foreign_key?
Is there a way to use has_many and have it operate like such? select * from pages where site_id = #{id} or site_id is null I know there''s finder_sql, but then I''ll lose the find_in_collection goodness. Thanks, Joe -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the
2017 Jun 12
0
plotting gamm results in lattice
Hi Maria If you have problems just start with a small model with predictions and then plot with xyplot the same applies to xyplot Try library(gamm4) spring <- dget(file = "G:/1/example.txt") str(spring) 'data.frame': 11744 obs. of 11 variables: $ WATERBODY_ID : Factor w/ 1994 levels "GB102021072830",..: 1 1 2 2 2 3 3 3 4 4 ... $ SITE_ID