search for: t1_r1

Displaying 20 results from an estimated 27 matches for "t1_r1".

Did you mean: t1_1
2006 May 16
1
:conditions on has_one realationship
...d find any records from the table people that have an active membership in table memberships. As far as I can tell this should generate this SQL:- SELECT people.`id` AS t0_r0, people.`firstname` AS t0_r1, people.`surname` AS t0_r2, memberships.`id` AS t1_r0, memberships.`person_id` AS t1_r1, memberships.`startdate` AS t1_r3, memberships.`enddate` AS t1_r4 FROM people LEFT OUTER JOIN memberships ON memberships.person_id = people.id WHERE memberships.id is not null and memberships.enddate > now() ORDER BY enddate DESC However the SQL that is generated does not appear to be cor...
2005 Apr 27
5
Eager load mysteriously deletes records
...quot;=>"0"} [4;35mTodo Columns (0.010000) [0;37mSHOW FIELDS FROM todos [4;33mWhens Columns (0.000000) [1;37mSHOW FIELDS FROM whens [4;35mTodo Load Including Associations (0.000000) [0;37mSELECT todos.position AS t0_r6, todos.due AS t0_r7, whens.todo_id AS t1_r0, whens.id AS t1_r1, todos.repeat_id AS t0_r0, whens.category_id AS t1_r2, todos.hour AS t0_r1, todos.priority AS t0_r2, todos.id AS t0_r3, todos.description AS t0_r4, todos.kind_id AS t0_r5 FROM todos LEFT OUTER JOIN whens ON whens.todo_id = todos.id ORDER BY position ASC [4;33mCategory Load (0.000000) [1;37mSEL...
2006 Jun 25
2
how to write the codes in view?(newbie question)
...name symbol url order display etc The code of links_Controller is like below. def list @links = Genre.find(:all,:include => :link) end Below is the mysql log. SELECT genres.`id` AS t0_r0, genres.`genre_n ame` AS t0_r1, genres.`genre_order` AS t0_r2, links.`id` AS t1_r0, links.`genre_ id` AS t1_r1, links.`name` AS t1_r2, links.`symbol` AS t1_r3, links.`url` AS t1_ r4, links.`order` AS t1_r5, links.`display` AS t1_r6, links.`etc` AS t1_r7 FROM genres LEFT OUTER JOIN links ON links.genre_id = genres.id But I don''t know the way to show them in the view. How do I have to write the co...
2008 Feb 09
0
MVC interplay to query multiple models
...thin layouts/calls Rendering calls/show Call Load Including Associations (0.002511) SELECT calls."id" AS t0_r0, calls."login_id" AS t0_r1, calls."created_at" AS t0_r2, calls."comment" AS t0_r3, logins."id" AS t1_r0, logins."login" AS t1_r1, logins."employee_id" AS t1_r2 FROM calls LEFT OUTER JOIN logins ON logins.id = calls.login_id Completed in 0.08172 (12 reqs/sec) | Rendering: 0.03247 (39%) | DB: 0.00363 (4%) | 200 OK [http://localhost/calls/show/1] which certainly looks to be close to the desired output: thufir@a...
2007 Dec 12
2
possible bug in eager loading
...BY id_list.alias_0 DESC LIMIT 50 User Load Including Associations (0.026093) SELECT users."id" AS t0_r0, users."username" AS t0_r1, users."password" AS t0_r2, <lots of more fields>, user_data."id" AS t1_r0, user_data."entered_when" AS t1_r1, <lots of more fields> FROM users LEFT OUTER JOIN user_data ON user_data.user_id = users.id LEFT OUTER JOIN user_data_fields ON user_data_fields.id = user_data.field_id WHERE users.id IN (<sniffed a lots of ids>) ORDER BY username = ''someone-oHC15RC7JGTNLxjTenLetw@public.gma...
2006 Jan 09
3
Include with two references of one model of the same table
...uot; AS t1_r8, matches."awayteam_id" AS t2_r3, matches."venue_id" AS t1_r9, matches."hometeam_id" AS t2_r4, matches."matchtime_start" AS t2_r5, matches."id" AS t1_r0, matches."matchtime_stop" AS t2_r6, matches."awayteam_goals" AS t1_r1, teams_seasons."id" AS t0_r0, matches."season_id" AS t2_r7, matches."hometeam_goals" AS t1_r2, teams_seasons."team_id" AS t0_r1, matches."league_id" AS t2_r8, matches."awayteam_id" AS t1_r3, teams_seasons."season_id" AS t0_r2, ma...
2007 May 22
2
find :all :include broken on Oracle 10
...ions.doc_type_id AS t0_r2, publications.title AS t0_r3, publications.lang AS t0_r4, publications.keywords AS t0_r5, publications.cvsdir AS t0_r6, publications.publishername AS t0_r7, publications.publisherorg AS t0_r8, publications.release_state_id AS t0_r9, doc_types.id AS t1_r0, doc_types.code AS t1_r1, doc_types.en AS t1_r2, doc_types.es AS t1_r3, doc_types.sv AS t1_r4, doc_types.descr AS t1_r5, release_states.id AS t2_r0, release_states.code AS t2_r1, release_states.name AS t2_r2, release_states.descr AS t2_r3 FROM publications LEFT OUTER JOIN doc_types ON doc_types.publication_id = publicatio...
2009 Jan 04
3
Table associated problem using belongs_to
...quot; end Then I run Package.find(1, :include => :user) in Rails console. From the log, I can see the sql is: Package Load Including Associations (0.000309) SELECT `packages`.`id` AS t0_r0, `packages`.`name` AS t0_r1, `packages`.`user_name` AS t0_r2, `users`.`id` AS t1_r0, `users`.`name` AS t1_r1, `users`.`full_name` AS t1_r2 FROM `packages` LEFT OUTER JOIN `users` ON `users`.id = `packages`.user_name WHERE (`packages`.`id` = 1) But I cannot find the parameters for belongs_to to set associated_foreign_key like has_and_belongs_to_many. I don''t know how to deal with it. Please help....
2006 May 20
3
In a find, can''t you use both :include and :limit ?
...lable` AS t0_r5, employees.`address` AS t0_r6, employees.`comments` AS t0_r7, employees.`creation_date` AS t0_r9, employees.`last_update` AS t0_r10, employees.`is_featured` AS t0_r11, employees.`is_deleted` AS t0_r12, employees.`is_hidden` AS t0_r13, skills.`id` AS t1_r0, skills.`parent_id` AS t1_r1, skills.`name` AS t1_r2, skills.`desc_short` AS t1_r3 FROM employees LEFT OUTER JOIN skills_employees ON skills_employees.recipe_id = employees.id LEFT OUTER JOIN skills ON skills.id = skills_employees.skill_id WHERE (skill_id = 3) But remember, I want to use this in a Pagination scenario, and...
2006 May 23
5
AR Caching and Reflection
When I do this: term = Term.find(1, :include => :definition) term.definition.term Two SQL queries are fired, why? -- Posted via http://www.ruby-forum.com/.
2012 Aug 31
3
Feature Request: Auto-infer .includes from .where with ActiveRecord queries
In the following snippet, can''t the includes being inferred from the where clause? Order.includes(:items).where(:items => { :category => [1,2,3] }) Can''t the includes be inferred from the where clause? Order.where(:items => { :category => [1,2,3] }) Would this conflict with any existing usages of the where clause and hashes? -- You received this
2006 Jul 17
1
acts_as_tree and :include
...s ambiguous: SELECT gb_entries.`id` AS t0_r0, gb_entries.`name` AS t0_r1, gb_entries.`email` AS t0_r2, gb_entries.`homepage` AS t0_r3, gb_entries.`message` AS t0_r4, gb_entries.`created_at` AS t0_r5, gb_entries.`parent_id` AS t0_r6, childrens_gb_entries.`id` AS t1_r0, childrens_gb_entries.`name` AS t1_r1, childrens_gb_entries.`email` AS t1_r2, childrens_gb_entries.`homepage` AS t1_r3, childrens_gb_entries.`message` AS t1_r4, childrens_gb_entries.`created_at` AS t1_r5, childrens_gb_entries.`parent_id` AS t1_r6 FROM gb_entries LEFT OUTER JOIN gb_entries childrens_gb_entries ON childrens_gb_entries.p...
2006 Apr 11
2
how to order by a related class???
...ook, :order => ''title'', :per_page => 10, :include => [:author] then rails generates the following SELECT * FROM ( SELECT TOP 10 * FROM ( SELECT TOP 10 books.[id] AS t0_r0, books.[title] as t0_r1, authors.[id] as t1_r0, authors.[name] as t1_r1 FROM books LEFT OUTER JOIN authors ON books.author_id = authors.id ORDER BY name ) AS tmp1 ORDER BY name desc) AS tmp2 ORDER BY name The inner "ORDER BY NAME" can be acomplished, provided there are no ambigueties (that is, the table books hasn''t any column named "n...
2006 Apr 19
2
I need help in ActiveRecord..
I have this Product.find(:all, :include => [:brand, :category, :type], :group => "description"), but it dont group by description why? Bruno -- Posted via http://www.ruby-forum.com/.
2006 Mar 14
3
cascading eager loading patch not working in oracle
...yword: ActiveRecord::StatementInvalid: OCIError: ORA-00905: missing keyword: SELECT tim esheets.id AS t0_r0, timesheets.start_date AS t0_r1, timesheets.status AS t0_r2, timesheets.cost AS t0_r3, timesheets.charge AS t0_r4, timesheets.employee AS t0 _r5, employees.id AS t1_r0, employees.name AS t1_r1, employees.start_date AS t1_ r2, employees.cost AS t1_r3, employees.charge AS t1_r4, employees.username AS t1..... I have just installed edge rails. -- Posted via http://www.ruby-forum.com/.
2006 Feb 19
2
Another "escaping" problem
Ruby 1.8.2, edge Rails (and 1.0), Mac OS X 10.4.3. Here''s the SQL that gets generated for an eager load: SELECT events.`id` AS t1_r0, events.`user_id` AS t1_r1, addresses.`id` AS t0_r0, events.`name` AS t1_r2, addresses.`name` AS t0_r1, events.`meet_at` AS t1_r3, addresses.`phone_number` AS t0_r2, events.`created_at` AS t1_r4, addresses.`phone_service` AS t0_r3, events.`location_id` AS t1_r5, addresses.`user_id` AS t0_r4 FROM addresses [" LEFT O...
2006 Feb 22
5
Optional Include Relationship
I did some searches in the mailing list and on the web but I can''t seem to find the answer to this, but it''s pretty much a noob question. I have a Product object class Product < ActiveRecord::Base has_many :product_identifications has_one :product_identification_item_number has_one :product_identification_product_code end the product_identifications is using
2006 Apr 10
1
random | in join statement with more than one :include
...nts.`created_at` AS t0_r23, grants.`created_on` AS t0_r24, grants.`updated_at` AS t0_r25, grants.`updated_on` AS t0_r26, grants. `lock_version` AS t0_r27, grants.`created_by` AS t0_r28, grants.`updated_by` AS t0_r29, sponsor_agencies.`id` AS t1_r0, sponsor_agencies.`name` AS t1_r1, sponso r_agencies.`address` AS t1_r2, sponsor_agencies.`phone` AS t1_r3, sponsor_agenci es.`contact_name` AS t1_r4, sponsor_agencies.`created_at` AS t1_r5, sponsor_agen cies.`created_on` AS t1_r6, sponsor_agencies.`updated_at` AS t1_r7, sponsor_agen cies.`updated_on` AS t1_r...
2009 Mar 10
5
'unknow column error' when using include and associated table condition in find
..._id'' in ''field list'': SELECT `lexemes`.`id` AS t0_r0, `lexemes`.`name` AS t0_r1, `lexemes`.`ref_id` AS t0_r2, `lexemes`.`meta_id` AS t0_r3, `structures`.`id` AS t1_r0, `structures`.`ref_id` AS t1_r1, `structures`.`meta_id` AS t1_r2, FROM `lexemes` LEFT OUTER JOIN `structures` ON structures.ref_id = lexemes.id and structures.meta_id=0 WHERE (structures.id<10) For the second one ActiveRecord::StatementInvalid: Mysql::Error: Unknown column ''lexemes.ref_id'' i...
2006 Sep 01
3
find_by_sql with :include?
When you use find, you can include related objects with include so that both objects get instantiated in the results, e.g. Foo.find(:all, :include => :bar). But when you use find_by_sql, is there a way to do this? You could definitely write the find_by_sql SQL to join Foo and Bar tables: Foo.find_by_sql("SELECT foo.*, bar.* from foo, bar where foo.bar_id = bar.id") But is there a