Displaying 20 results from an estimated 100000 matches similar to: "Sessions and associations"
2006 Mar 24
2
Change to has_many :through associations
Hi everyone. I''ve made a default change to has_many :through
associations that I felt was important to make before they''re
released. This is after some tickets and confusion I''ve seen
regarding has_many :through.
class Connection < ActiveRecord::Base
belongs_to :user
belongs_to :channel
end
class Channel < ActiveRecord::Base
has_many :connections
2006 Mar 10
0
Session management changed in EdgeRails?
Hi,
I''ve been developing an application in Rails 1.0 and finally made the
switch to Edge for has_many :through and polymorphism. I''m currently
storing the authenticated user object (User model) in the session. This
has worked well up until upgrading to EdgeRails. What I do is set @user
= session[:user] in my controllers and then access the various @user
associations such as
2006 Feb 05
1
3-dimensional table
Hi,
Last week my class conducted an experiment by putting out clay
caterpillars to look at the effects of urbanization, color, and location
on caterpillar predation. There were two sites (urban, rural), three
colors (green, yellow, red) and two locations at each site (edge,
interior). The entire data set is below. I've checked out the MASS
book, Dalgaard's book, and the R-help archives
2005 Jul 26
6
eager associations and limit/offset
Hi,
currently the eager association loading via ":include" does not work
when a has-many or habtm association is combined with offset/limit
(which is required for paginations). This is because in these cases, the
result set will contain more than one row per object, but limit/offset
works on row numbers.
I''ve developed a patch that makes this work by using 2 SQL statements
2011 Apr 07
0
accepts_nested_attributes_for, validations, :inverse_of option on associations, and IdentityMap
This feels more like a question to ask the core list, forgive me if I trespass.
I''ve been trying to help one of my cow orkers get through a sticky
problem. He''s got a fairly complex nested form to update a model and
its children. He''s started adding some validations, and we''ve
encountered a number of issues:
First he had a validation on one of the child
2007 Oct 01
1
Pagination should be in the official plugin repository
Now that Rails has gone on a diet and components have been moved out
of core and into plugins, it seems that Classic Pagination should
also be in the official Rails plugin repository.
Currently, it''s at svn://errtheblog.com/svn/plugins/classic_pagination.
It seems inconsistent that, unlike acts_as_list, acts_as_tree, etc.,
pagination should reside at a separate location. This
2006 Jan 31
4
Rails bug? Conditions on associations ignored by eager loading
I''m looking for someone to confirm the following as a bug in Rails
1.0 before I post it to Trac.
If I use eager loading on an association that has conditions defined,
the conditions are ignored.
The following example illustrates the problem. I have two tables:
create_table "blogs", :force => true do |t|
t.column "name", :string
end
create_table
2008 Apr 21
2
Eager Loading Polymorphic Associations
Hi,
I''m searching for a method of eager loading polymorphic associations under
activerecord 2.0.2. After some initial google-fu I came up with a link to
an enhancement that''s been added to edge:
http://dev.rubyonrails.org/ticket/8119
Anyone have any idea how long that might take to work its way into a general
release? I''m early in development now so I can afford to
2006 Jan 06
6
HABTM problem not saving all associations
Hello all,
I have an Order object that has and belongs to many Products and has
and belongs to many Loan Types. This is so I can select multiples of
each in my order entry screen via checkbox groups.
I''m having some trouble with saving multiple HABTM associations for a
single model object; only the first HABTM association declared in the
model will save during the initial @order.save
2008 Apr 23
2
Bug in eager loading and polymorphic associations?
Hi friends, i''m usgin the edge version because i need eager loading on
polymorphic associations support, but i see this:
Message.find(:first, :include => :owner) #This generate this query:
SQL (0.000072) SET SQL_AUTO_IS_NULL=0
Message Load (0.000389) SELECT * FROM `messages`
User Load (0.001070) SELECT * FROM `users` WHERE (users.id IN
(1,2))
And this Message.find(:first,
2006 Mar 13
0
Problems with association named :task
I have an object that belongs_to :task, and calling that object''s task
method returns the task it belongs to in the unit tests. One place in a
controller, though, it gives me the error:
undefined method `find'' for Rake::Task:Class
./script/../config/../vendor/rails/activerecord/lib/active_record/associations/belongs_to_association.rb:44:in
`find_target''
2007 May 22
3
can I use acts_as_list with a has_many :through association
I''d like to be able to use a has_many :through association and treat
the associations as a list but I''m getting this error when I try an
use an acts_as_list method:
NoMethodError: undefined method `move_to_bottom''
I''m using edge rails r6786.
Here are my domain rules:
Activities are things students can do.
Units consists of a sequenced list of
2006 Apr 21
0
Caching of collections/references on session?
I''m using the user engine and therefore have a current_user User object
on my sessions. User has a collection called ''properties'' and I am
accessing the Property objects via the current_user session variable and
also directly with Property.find. The problem I have is that rails seems
to be caching the properties collection over requests (I can see the
collection
2006 Feb 09
2
Polymorphic Associations
If anybody on edge familiar with this could help, that would be "great" :)
I have different types of things I want to be "reviewable". So, instead of
having a slew of HABTM... this new Polymorphic Associations schtick seemed
like the best solution. I have everything setup as I thought it should be
(so I think)... but it doesn''t appear to be working correctly. Here
2009 Mar 13
1
Problem saving nested attributes for has_many associations (Rails 2.3 RC2 and Edge)
I''ve tested this on both 2.3 RC2 and Edge. This pastie contains
model, helper and view: http://pastie.org/415742
When I save a vocabulary - its terms don''t save. I''m fairly sure it
worked in RC1. Would appreciate any insight.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on
2007 Jul 04
3
Testing Rails Associations
Hi,
I''m very new to rspec, so if this is not the right forum please let me know.
I''m starting to spec my models first in an existing rails app, porting from
a mix of Test::Unit, and simply_bdd amongst others.
I''m at the point where I want to test that certain associations are
present. What I''m not sure of is should I test the association or the
method and
2013 Feb 06
0
inverse_of breaks for unsaved child associations during save of parent
I''m willing to write a patch for this issue:
https://github.com/rails/rails/issues/8893
But want to confirm that the new behavior makes sense before I make the
effort.
Essentially if you have an unsaved parent and child, and the parent''s
association to the child has an inverse_of declared on it. When the parent
gets saved, it updates the foreign key on the child, and this
1999 Mar 21
0
USENIX Annual Conference, June 6-11, Monterey, Calif
You'll get the why as well as the how-to in advanced systems and software
at this renown conference for system administrators, developers, and
researchers-
24th Annual USENIX TECHNICAL CONFERENCE
June 6-11, 1999
Monterey, California
Includes FREENIX track devoted to open source software
-----------------------------------------------------------------
Review the program and register
2006 Jun 14
3
Prevent duplicate HABTM associations
Hi,
I am trying to restrict duplicate has_and_belongs_to_many associations.
I tried to find support for a association validation for duplicates but
couldn''t find anything.
I understand I could use :uniq=>true on the model association but this
would only prevent it from displaying duplicates, I want to stop
duplicate associations being inserted in the first place.
I have a vague
2007 Aug 17
1
Cookie Sessions in Merb?
I like the cookie sessions that Rails edge has - they make sense,
they''re fast, easy.
For those that don''t know: the default session mechanism is to give
developers a Hash called session. To store this object between
requests it Marshals the session object and sends the object itself
(now as a bitstream) back to clients to store in their cookie file. To
prevent users from