Displaying 20 results from an estimated 1000 matches similar to: "Need for multiple acts_as_list"
2006 Feb 22
9
acts_as_habtm_list plugin
I''d like to announce acts_as_habtm_list plugin for rails.
acts_as_habtm_list is a Ruby on Rails plugin, that can manage ordered
lists through a join-table. It is providing almost the same Api as
acts_as_list. The position column has to be defined in the join table.
You can find additional information at:
http://www.inlet-media.de/acts_as_habtm_list/
Install it executing this command
2017 Nov 18
2
family
Hi all,
I am reading a huge data set(12M rows) that contains family information,
Offspring, Parent1 and Parent2
Parent1 and parent2 should be in the first column as an offspring
before their offspring information. Their parent information (parent1
and parent2) should be set to zero, if unknown. Also the first
column should be unique.
Here is my sample data set and desired output.
fam
2011 Feb 18
3
recoding a data in different way: please help
Dear R users
The following question looks simple but I have spend alot of time to solve
it. I would highly appeciate your help.
I have following dataset from family dataset :
Here we have individuals and their two parents and their marker scores
(marker1, marker2,....and so on). 0 means that their parent information not
available.
Individual Parent1 Parent2 mark1 mark2
1 0 0
2006 May 18
3
Model Madness: habtm vs through
This has me scratching my head:
a Person has many Things
a Person has many Collections
a Collection has many Things
...Things in a Collection are ordered
...Things in a Collection can be related to (created by) any User
...a collection has additional attributes, such as a name etc
I am confused about habtm in rails (especially when using
acts_as_habtm_list) vs. going the :through route.
2007 Aug 09
7
Integrating polymorphic models into controllers views? how?
I''m having trouble trying to get this to work.
How the heck do you get a polymorphic controller to work? Especially
integrating it with a view?
Let''s say that we have shows, and episodes, then comments.
A show has many episodes, an episode has many comments.
the route is /shows/1/episodes/1/
Now to add a comment to that episode, how would I do it? Let''s say
that the
2011 Sep 07
4
rspec testing inheritance
Hello,
Is there any way to test model inheritance in spec?
something like..
it { ChildModel.should < ParentModel }
thanks.
2007 Aug 15
3
ActsAsList specs
Hi,
How are people specifying models which act_as_list?
I''m thinking that it would be possible to check that acts_as_list
instance methods have been added to a class using something like this:
describe Page, "acts_as_list" do
it "should act as a list" do
Page.ancestors.should be_include(ActiveRecord::Acts::List::InstanceMethods)
end
it "should use
2007 Mar 01
9
Active Record proposal/discussion for improvement
Hello,
I have started in "Ruby on Rails: Talk" a discussion about my problems
with current ActiveRecord implementation. Please take a look here:
http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/d40b754fc5872a99/47cff815df123b8a?lnk=gst&rnum=2
Regards
Oliver Paulus
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are
2006 Jan 15
2
acts_as_tree & acts_as_list for a single model?
Hi,
If I have a db table
categories
- id
- name
- parent_id
- position
is it alright to have the Category model act_as_tree and for each
level act_as_list?
class Category < ActiveRecord::Base
acts_as_tree :order => :position
acts_as_list :scope => :parent_id
end
Thanks,
Peter
2009 Jan 04
3
undefined local variable or method `acts_as_list'
So I seem to be having an issue with trying to install acts_as_list in
rails 2.2.2?
I have downloaded the files from: http://github.com/rails/acts_as_list/tree/master
I have put the files in the vendor/plugins folder the files are as
follows:
vendor/plugins/acts_as_list/init.rb
vendor/plugins/acts_as_list/lib/active_record/acts/list.rb
vendor/plugins/acts_as_list/test/list_test.rb
2006 Mar 22
7
What is difference between render & redirect methods?
Hi,
Thest are two methods:-
1) redirect_to :action => ''list''
2) render :action => ''list''
what is difference between these two methods??????
Thanks.
Prash
--
Posted via http://www.ruby-forum.com/.
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
2006 Apr 03
3
Read Only Error Since 1.1?
Since I upgraded to 1.1, I am getting ''ActiveRecord::ReadOnlyRecord''
exceptions when trying to save a specific record.
I read up on ActiveRecord::Base.readonly? but I don''t think the condition
there (objects pulled in from a certain JOIN type) applies.
Here''s my code that is throwing the exception:
@company = session[:company]
@company.bytes_used =
2006 Mar 21
13
Double and single quote usage in AWDWR
Hello everyone!
I''ve noticed, that the book uses double quotes almost everywhere. It is like
<%= javascript_include_tag "prototype" %>
I''ve checked the "programming ruby, 2ed" book and found that double
quotes are most suited when escape sequences and substitutions are
required. Isn''t it more semantically correct to write this code like
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
2010 May 31
2
has_many and has_and_belongs_to conflit
Hi,
I have 2 models: User and Article.
I have this relationship:
* User has many articles (and Article belongs to user)
* User has and belongs to many articles (and Article habtm users)
But this is tricky because of: current_user.articles ...this can return
articles thanks to *has_many* and *has_and_belongs_to* relations. So
there''s a collision.
How can I ask articles thanks
2007 Jan 25
1
has_and_belongs_to won't delete records
Hi,
I have a has_and_belongs_to relationship between 2 objects, order and
product. I''m getting a foreign key violation when trying to delete
Order. Is there a special way of deleting orders without deleting
products? ("has_many" has :dependant => :delete_all.... does
"has_and_belongs_to" have something similar)
Trying:
Order.delete_all
Getting:
Mysql::Error:
2006 Mar 27
3
act_as_paranoid and model references
I''m using act_as_paranoid plugin for most of my models. One of the
reasons was that I didn''t want to break references between objects
after I "deleted" an object. One of the cases was to know which user
modified something even after I deleted the user.
My problem now is that I cannot access the user after it was deleted
if I use the :has_and_belongs_to :user
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
2006 May 15
0
acts_as_list, move_higher, odd indexing behaviour?
Hi,
[reposting to list, posting via google groups apparently didn''t work]
I''m trying to use acts_as_list for the first time.
Can anyone confirm the odd behaviour reported here?
http://blog.nominet.org.uk/tech/Web/2006/03/06/Using_acts_as_list_in_...
i.e. element access and move_higher require an odd indexing scheme to
work.
I''m personally finding that I