Displaying 20 results from an estimated 800 matches similar to: "has_many + finder_sql & :include"
2007 May 31
0
Rails AR/SQLServer Unit Test: [6912] failed (but getting better)
"bitsweat" has given AR/SQLServer some love, but it''s still unhappy...
http://dev.rubyonrails.org/changeset/6912
------------------------------------------------------------------------
r6912 | bitsweat | 2007-05-31 10:15:56 -0700 (Thu, 31 May 2007) | 1 line
Fix an edge case with find with a list of ids, limit, and offset. Closes #8437.
2006 Jul 24
7
[PATCH] Support for DB Clusters/Replication in ActiveRecord (RFC)
Skipped content of type multipart/alternative-------------- next part --------------
Index: connection_adapters/abstract/connection_specification.rb
===================================================================
--- connection_adapters/abstract/connection_specification.rb	(revision 4617)
+++ connection_adapters/abstract/connection_specification.rb	(working copy)
@@ -1,10 +1,21 @@
 require
2007 Mar 21
1
Eager Loading with custom :finder_sql
Is there any way to do eager loading when using custom :finder_sql ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
2006 Feb 28
3
[AR] #{id} namespace visibility used in finder_sql
Dears,
[Rails 1.0.0]
I''m working with a legacy schema, and  around my 20+ models i''ve used
some AR constructs.
They are based on a finder_sql doing some dirty sql and using #{id}
from the ''pivot'' model for extracting data in other tables.
like :
class Division < ActiveRecord::Base
  set_table_name "legacy_division"
  set_primary_key
2005 Dec 27
3
Trouble combining :has_many, :finder_sql and :conditions to create a sub-search
I''m sure there''s something right under my nose that I''m missing. I
have two tables with two parallel one-to-many relationships. I wish to
use the :finder_sql parameter to essentially ''or'' the two foreign
keys.
What isn''t working for me is performing a ''sub-search''.
Let''s say the tables are "stores" and
2006 Oct 30
2
It this possible: finder_sql-like behavior for belongs_to?
Guys,
I have a need to support as has_many/belongs_to relationship on a
legacy(kind of) schema. The reason I say kind of is that the schema does
have "id" columns that are used in many associations, but this particular
has_many/belongs_to association needs to support different ones.
I''ve attached to code at the end of this email. Suffice it to say I need to
use the standard
2006 Jan 06
1
has_many with :finder_sql question
hi all,
I have a Class, Client, which has_many projects (Project class).  the
projects depend on a session_id variable, however.  So the question
is, how can I do the following:
has_many :projects,
		 :finder_sql => "SELECT p.*  FROM projects p INNER JOIN
projects_users pu ON pu.project_id = p.id WHERE pu.user_id =
#{session[:user_id]}"
The problem is that I need to filter a
2005 Dec 30
5
HABTM with finder_sql problem (Rails bug?)
I''m building an app that needs i18n support across the entire database
(i.e. localized attributes). In order to do this I''ve created a
special HABTM join table that can be associated with _any_ other
table:
create table language_strings (
	for_table	varchar(255)	not null,
	foreign_id	int		not null,
	language_id	varchar(5)	not null,
	attr_name	varchar(255)	not null,
	value		text	
2006 Jan 03
0
has_and_belongs_to_many include problem
hey,
i have users who are in groups, and i have a search form, where i can search on
group, user lastname, and user firstname.
All this is also with pagination.
these are my models
class User < ActiveRecord::Base
has_and_belongs_to_many :groups
end
class Group < ActiveRecord::Base
    has_and_belongs_to_many :users
end
in my controller i do this
THIS works (but in need pagination)
@users2
2006 Jan 17
15
legacy database and finder_sql nightmare!
This is my first rails app with a legacy database and I''m having a 
terrible time getting the models set up correctly.  I have an order 
table that has a primary field named order_number.  I have a name table 
with a primary of item_number.  These two tables are liked by the 
item_number and the order_number, but not as you might think.  If the 
order_number is 2500, then each entry in
2006 Jun 09
1
finder_sql issue with has_many :through
I have an inner join query that Action Record can''t seem to pull off 
conventionally, so I''m trying to use :finder_sql to utilize an sql query 
that works beautifully in SQL. The problem is, when I try to call the 
method, I get the following:
private method `gsub'' called for #<Array:0x267de04>
Here is my has_many code:
has_many :mod_privileges,
        
2007 Sep 06
1
finder_sql patch problem
Hello,
I have the finder_sql problem and I found this patch
http://dev.rubyonrails.org/ticket/7576; but I don''t know how to use
this patch??
I copied all the changes into the correct files and restartet the
server of my ruby on rails application, but nothing changed.
Could someone tell me please how I have to use this patch??
Thanks
Manfred
2006 Oct 19
3
Selecting datetime values from SQL Server (year < 1970)
All,
Rails 1.1.6.
Any AR find() call that generates a SELECT * type query against a table 
with a DATETIME column in SQL Server whose value occurs before 1970 will 
fail, because of the coercion of SQL Server datetime types to Time 
values in Ruby.
See sqlserver_adapter.rb line 490
(record[col] = record[col].to_time if record[col].is_a? DBI::Timestamp)
If I remove the coercion (just commenting
2009 Jun 09
3
NameError what is it?
I have the following code in app/controllers/processjobs_controller.rb
#
class ProcessJobsController <ApplicationController
  def index
    @ProcessJobs = ProcessJobs.find(:all)
  end
end
#
This is my route file ..
ActionController::Routing::Routes.draw do |map|
  map.resources :ProcessJobs
  map.connect '':controller/:action/:id''
  map.connect
2006 Mar 13
2
Connectivity to Microsoft SQL Server using ADO
Based on this page:
http://wiki.rubyonrails.com/rails/pages/HowtoConnectToMicrosoftSQLServer
using this specification
development:
  adapter: sqlserver
  database: database_name
  host: server_name
  username: user_name
  password: your_pw_here
in database.yml for your SQL Server connection doesn''t work.  Some 
debugging code reveals that only the password comes through into 
2006 Mar 31
7
problem with habtm conditions in pagination
Hello list,
I''ve had this problem for two days now. Perhaps someone here would  
care to comment on it. I''d be REALLY appreciative if that''d be the case.
Basically, it''s outlined at this paste: http://rafb.net/paste/results/ 
kXQSHZ83.html
But I''ll paste it here, too.
The main problem is in the customers/list action. The problem is with  
this line:
2006 Mar 30
6
MS SQL query strangeness for ActiveRecord in Rails
Hi,
I am currently trying to move my rubyonrails app from Linux to Windows 
server utilizing MS SQL instead of MySQL due to "business" reason. All 
my listing screen utilize a drop down list in each column to allow user 
to "filter" the listing based upon the value chosen from the drop down 
list. In the controller, I used find() method but with customized 
parameters such as
2006 Apr 17
2
has_one problem in a form
Hello all,
I have a syntax question.  How does one refer to a field brought in via a
has_one/belongs_to relationship in a form helper?  Basically, I have two
models:
class Resource < ActiveRecord::Base
  has_one :other_thing
end
class OtherThing < ActiveRecord::Base
  belongs_to :resource
end
It has the normal id-resource_id foreign key relationship.  OtherThing has
two fields, plus the
2006 Nov 04
0
ProbleM!!!!!!!!!!!!!!!!!!
Hi,
I trieed umpteen times to connect ruby on rails to MSSQL server using
the standard procedures and I always get the samw error. As I was
previously working with MYSQL I faced no problem .Now at a time critical
situation I need a solution for this...........
Open
    OLE error code:800A0E7A in ADODB.Connection
      Provider cannot be found. It may not be properly installed.
    HRESULT error
2007 Mar 14
5
aaf batch_size limits indexing on mssql to 1000 records
hi!
after wondering why i can''t find alot of records i eventually found the
problem in the sqlserver_adapters implementation of "add_limit_offset!".
the problem is when using MSSQL with the sqlserver_adapter paging will
only work when at least one column is defined in ":order".
for example i was indexing a table with 2912 records, the generated sql
for the batches