Displaying 12 results from an estimated 12 matches similar to: "can I use acts_as_list with a has_many :through association"
2007 Nov 14
1
has_many_polymorphs and acts_as_list ?
First, BRAVO for this wonderful plugin: has_many_polymorphs ! Now my
problem:
4 models : Collection, Page, Fragment, Belonging (which is the join
table):
1 class Collection <
ActiveRecord::Base
2 has_many_polymorphs :elements,
3 :through => :belongings,
4 :from => [:pages, :fragments, :collections],
5 :as => :collector,
6 :parent_order =>
2006 Apr 01
3
acts_as_list with scope : position update problem?
Hello,
I''ve tried to set up a class with acts_as_list with a scope argument
that restricts a list to records with the same foreign key.
For example :
database :
CREATE TABLE `families` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '''',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
INSERT INTO
2010 Dec 23
6
Difference between rake test:units and individually running ruby -I test test/unit/something_test.rb ?
Here''s my issue: running ruby -I test test/unit/something_test.rb for
each of my unit tests works perfectly.
However, running rake test:units brings errors in all of them - some
object becomes nil for some reason.
Why might this be happening?
Specifics: the object that is successfully not nil when I run the unit
tests one-by-one but becomes nil when I do rake test:units is defined
like
2005 Jul 07
2
0.13 ajax sortable lists and acts_as_list
I''m trying to figure out a good way to get acts_as_list and the new
sortable lists to play nicely together, but they don''t seem like
they''re designed to mesh well. The ajax sortable lists post a
complete ordered list of ids back to the server after every change,
but acts_as_list is designed to deal with diff-like changes, rather
than reordering the whole list from
2006 Jan 01
7
[ ANN ] Hieraki2
Happy new year! Hieraki 2.0.0 is released.
You can download Hieraki2 from rubyforge.org as tgz or zip
(http://rubyforge.org/projects/hieraki).
Hieraki2 has a new wiki engine that ships with more than a dozen new
features:
* everything-is-a-wiki-page (TM)
* all pages are under version control
* access control list
* stay in full control of the tree structure by cut and pasting
2006 Mar 23
1
handle multiple lists: move an item from one list to another
How do I manage multiple lists?
This is what I need. Sometimes an item needs to be moved from one list
to another.
class Item < ActiveRecord::Base
belongs_to :group
acts_as_list :scope => :group
end
class Group < ActiveRecord::Base
has_many :items, :order => "position"
end
Now, sometimes, I may need to change an item from one group to another.
But when I do that,
2005 Jul 12
2
save order from drag and drop
only just found the script.aculo.us site. brilliant. much respect.
wondered if anyone can point me in the right direction on this drag and drop
list re-ordering type thing, i''ve read through what I can but to be honest
it''s gone right over my head! How do I get the new order that has been
established via dragging list elements around and store them in a database.
I figured an
2007 Jul 12
1
acts as list -- adding or moving new item to new location
right now i''m adding an item to my ''list'' but i''m unsure how to move
it to a certain spot in the list. specifically i want to put it at the
bottom of the list. i assumed that if i did something like
parent.children << new_child
then the ''position'' field in the child table would be given some
sensible default by rails but instead
2006 Apr 30
4
acts_as_ordered_tree
I need an ordered (sortable tree) and I just was thinking if somehting
like this is possible:
class Item< ActiveRecord::Base
acts_as_tree :order => "position"
acts_as_list :scope => ''parent_id = #{self.id}''
end
For my understanding mixing of two acts_as should be p?ssible, at least
in this case, right?
Unfortunatly the :scope is not working, I am not
2007 Feb 19
0
Invalid SQL generated with PostgreSQL 8.2.3
Hey,
Using Ruby 1.8.5, postgres-pr-0.4.0, activerecord-1.15.2, Rails 1.2.2
and PostgreSQL 8.2.3. I''m following the O''Reilly book "Ruby on
Rails", so you can tell I know precious little of what I''m doing ;-)
Well, I''ve created some models, and was working through examples, and
executed the following from a console:
>> show = Slideshow.find 1
2006 May 22
13
How is this possible?
When run from the console, the following code works, when run through
the WEBrick server I get a "You have a nil object where you didn''t
expect it!"
class Competition < ActiveRecord::Base
has_many :comp_dates, :order=>:position
def initial_date
comp_dates.first
end
def display_dates
i_d = initial_date
if i_d.nil?
return "unknown"
2002 Dec 29
0
Slow performance
I have been fighting this problem for months now. My performance under Samba
and XP has ben umbearable. The scenario is running Samba 2.2.7a under SuSE
8.0 as a PDC. The XP machine logs onto Samba and the roaming profiles are
downloaded then stops for 15 minutes or so. The network is verified 100Meg
full-duplex, FTP transfers between the machines are robust and so no
problems in connectivity. Any