similar to: [AR] #{id} namespace visibility used in finder_sql

Displaying 20 results from an estimated 300 matches similar to: "[AR] #{id} namespace visibility used in finder_sql"

2004 May 10
3
sqlSave with underscores in table fieldname
Hi group, I try to write a frame to a table (RODBC). I use colnames(temp6) <- c("ind_id","ser_id","period_id","year","calc","mean") sqlSave(channel, temp6, tablename = "series_indices_test",append= TRUE, rownames=FALSE, verbose = FALSE, test = FALSE, nastring = -999999, fast = FALSE) This is giving me an error: Error in
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 Aug 15
2
has_many + finder_sql & :include
Hello, In a model I have: has_many :things, :finder_sql => '' select * from other_things '' + '' where id = #{id} '' When I do MyClass.find(:all, :include => :things) I get a weird error: from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract_adapter.rb:120:in
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 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 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
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 Jan 19
7
bug in has_many count?
I can submit a patch, but wanted to confirm I''m looking at this right... The docs indicate that if you specify a has_many association with :finder_sql, but no :counter_sql, it constructs the appropriate counter sql by substituting the SELECT clause. But has_many_association.rb doesn''t seem to do that -- it just passes Base#count_by_sql the finder_sql, which doesn''t
2005 Dec 27
0
How do I combine :finder_sql and :conditions to perform a sub-search on a custom has_many relationship?
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 Aug 13
1
Is :finder_sql using #{id} broken?
Hi All, It seems that :finder_sql in a HABTM association only interprets a single quoted #{id} the first time through a query. I see examples of this being used in a few places (though with has_many) and I don''t really see how to use :finder_sql without a #{id}. Am I missing something or is this just broken? -- Paul Haddad (paul.haddad@gmail.com paul@pth.com)
2006 Jul 24
1
has_many + finder_sql
from the api I got: <pre> has_many :subscribers, :class_name => "Person", :finder_sql => ''SELECT DISTINCT people.* '' + ''FROM people p, post_subscriptions ps '' + ''WHERE ps.post_id = #{id} AND ps.person_id = p.id '' + ''ORDER BY p.first_name'' </pre> I would like to pass in the
2010 Jan 25
0
has_many, :finder_sql, setting attributes
Hi all, My question is somewhat complicated, but bear with me. My project has a number of models: User, Program, and Team. Users belong to multiple Programs. Programs have multiple teams, but Teams belong to one program. For each Program a User belongs to, he can belong to multiple Teams. (Think of this in an athletic context where users are athletes, programs are universities). So my
2006 Feb 13
0
has_many finder_sql #{id} single/double quotes voodoo
I never would have figured this out in many moons: has_many :subscribers, :class_name => "Person", :finder_sql => ''SELECT DISTINCT people.* '' + ''FROM people p, post_subscriptions ps '' + ''WHERE ps.post_id = #{id} AND ps.person_id = p.id '' + ''ORDER BY p.first_name'' Variable
2011 Sep 27
0
has_many with :finder_sql returns [nil]?
Is it supposed to do that? I find it very confusing. AR 3.0.10 class Unit has_many :units, :finder_sql => proc { "SELECT * FROM `#{table_name}` WHERE `location_id`=#{id} AND `location_type`=#{Location::UNIT}" } end Both should return []. However... >> Unit.first.units.find([1000000]) [2011-09-27 10:05:11|main|debug] Unit Load (4.0ms) SELECT `units`.* FROM `units`
2006 Dec 02
0
has_and_belongs_to_many and finder_sql options
Hello everybody, I''ve been hit by the bug described at http://dev.rubyonrails.org/ticket/1732 Is there any reason why the patch is still not included in trunk ? The patch seem simple enough. Regards, -- Damien Merenne http://blog.cosinux.org/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups
2014 Mar 13
4
logwatch named logs
ever since implementing the no-recursion-on-outside queries fix on one of my name servers, my logwatch emails have been 10-20MB/day, filled with crud like... client 10.191.192.212 query (cache) 'm.777.liyuanxi.com/A/IN' denied: 1 Time(s) client 10.192.34.96 query (cache) 'dyjwntl.www.0411gogo.com/A/IN' denied: 1 Time(s) client 10.192.43.105 query (cache)
2006 Mar 10
4
problem when looping through habtm children in a view
I have this code in a view: <% for topic in @topics %> <%= topic.id %> <%= topic.dr_title %><br/> <ul> <% for doc in topic.child_documents %> <%= doc.dr_title %><br/> <% doc = nil %> <% end %> </ul> <% end %> Though the topic titles and IDs display correctly,