similar to: has_and_belongs_to_many include problem

Displaying 20 results from an estimated 200 matches similar to: "has_and_belongs_to_many include problem"

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 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 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
2005 Dec 15
3
How to delete a record
hey, i my database i have users and groups, each user can get in different groups my db structure: table groups: id, name, basegroup, firm_id table users: id, firstname, lastname, email table groups_users: group_id, user_id my relation is a many to many: class Group < ActiveRecord::Base has_and_belongs_to_many :users end class User < ActiveRecord::Base has_and_belongs_to_many
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
2005 Dec 14
0
how to get these records in has_and_belongs_to_many relation
hey, i my database i have users and groups, each user can get in different groups my db structure: table groups: id, name, basegroup, firm_id table users: id, firstname, lastname, email table groups_users: group_id, users_id my relation is a many to many: class Group < ActiveRecord::Base has_and_belongs_to_many :users end class User < ActiveRecord::Base has_and_belongs_to_many
2006 Aug 09
0
Bug in ActiveRecord 1.14.4 and select_limited_ids_list method using mysql?!?!
All - I just upgraded to rails 1.1.5 (per the announcement) which also updated active record to 1.14.4 (was 1.14.2). I know have a problem... Author has many Articles... @authors = Author.find(:all, :limit => 10, :offset => 0 :include => [:articles], :conditions => ["hide =
2006 Aug 09
0
Bug in ActiveRecord 1.14.4 and select_limited_ids_list() ???
All - I just upgraded to rails 1.1.5 (per the announcement) which also updated active record to 1.14.4 (was 1.14.2). I know have a problem... Author has many Articles... @authors = Author.find(:all, :limit => 10, :offset => 0 :include => [:articles], :conditions => ["hide = ?",
2006 Feb 12
6
habtm doesn''t save old IDs
I''m sure I''m not getting something. I have Users, and I have Groups. Each User has_and_belongs_to_many :groups and each Group has_and_belongs_to_many :users. When I add a user, I want to apply a bunch of groups (like tags) to the user (manually, without acts_as_taggable). Here''s User#create: @user = User.new(params[:user]) @user.groups =
2006 Mar 16
1
Rails SQL generation (Firebird adapter) - can someone explain ...
I see some possible issues with the SQL that is being generated by the firebird adapter. Every SQL is being generated on the fly by concatenating strings. Can someone please explain why the SQL is being generated the way it is? I cannot use this in real life for a couple of reasons: 1. This introduces a security hole because a user, accidentally or deliberately, could potentially submit a
2006 Sep 05
0
rake craziness with Migrate as a dependency
Hi everyone, For one of our projects we have a need to deploy and maintain a demo. As a result I''ve attempted to setup a set of rake tasks for the job. My goal is have one rake task called "deploy_demo" which purges the database, migrates to the current schema, and loads the db from a set of fixture files in a specified location. I''ve written two new tasks the perform
2006 Jan 10
1
sql server & linux: left join problem
I''ve got a left join problem of some sort connecting from linux FreeTDS/ODBC to SQL Server. It''s similar to the false post I had earlier, but this is a real problem. Here''s my code: def find_recipes_for_workorder @recipe_pages, @recipes = paginate_with_sort :recipes, :per_page => 10, \ :joins => ''left join workorder on
2006 Jan 27
5
Newbie:Adding a new Table-Strange Error
Hi Everybody, I am a newbie in this list so please forgive me if this is a lengthy message. Currently I am working on a project at my work place that includes viewing some oracle tables(I do not have control over to rewrite the tables) and searching the tables based on a given criteria with Rails. Up untill now everything was working great. The database consists of a lot of tables but I was
2006 Jul 23
0
[PATCH] (+tests) with_scope :order doesn''t work with included associations
(I''ve had this patch lying around for a couple of weeks, waiting for Trac to come back up. noradio''s already had a look at it on IRC. What''s the best way to submit patches while Trac is down?) with_scope doesn''t support :order in the presence of :include. For example: {{{ # We''re testing the interaction between :order, :include, and
2006 Jul 31
0
Patch for #3438: Eager loading doesn''t respect :order of associations
Hello all, I still have a patch for #3438 (eager loading doesn''t respect association orders); it passes all unit tests, and has additional unit tests with full coverage. The patch is attached. == The Bug == Author.find(1).posts != Author.find(1, :include => [:posts]).posts if Author has_many :posts, :order => anything. This means that either one must avoid eager loading or
2006 May 05
0
Missing documentation for find_in_collection? Trying to drill down in a 4 level has_many association fails
I''ve been reading up in ActiveRecord::Associations and playing around with my app via the console and found some interesting methods via the code completion of IRB, but I have no idea how to use them and can only find one hint in the API http://api.rubyonrails.com/classes/ActiveRecord/Associations/ ClassMethods.html It mentions here in the has many associations that if you use the
2006 Jan 30
9
error when adding a new table to the existing application
Deniz wrote: > Hi Everybody, > I am a newbie in this list so please forgive me if this is a lengthy > message. > Currently I am working on a project at my work place that includes > viewing some oracle tables(I do not have control over to rewrite the > tables) and searching the tables based on a given criteria with Rails. > Up untill now everything was working great. The
2006 Jun 29
1
search action/ in different groups
Hi all, thanks in advance for those who''ll take the time to help out... i have a list of users who are connected with a habtam relashinship to a set of groups (joint table of groups_users) and now am trying to implement a search operation that will go through all of the records of the users and output user results according to what group was chosen at the searchbar, and the text
2006 Jul 02
2
searchbar help!
Hi all, i am after hours unfold of trying to implement a searchbar in a table with a habtam relashinship, but alas ! with no success... i was hoping some kind gentle mind can help me through these diffucult times; i have now reached the point where out of sheer annoyance, i cannot see myself getting anywhere nearer to the target, and was hopefully hoping one of you out there could help me
2007 Nov 24
12
orphan habtm rows
HI, i use models User and Groups connected with many to many association, so i have users table, groups and groups_users. lets say i create one user and one group. next i add a group to user. so now my table groups_users has one entry i.e. group_id | user_id _________|________ 1 | 1 ok, when i delete both my group and user, above entry is not deleted, thus leaving alone without