similar to: HABTM and acts_as_list

Displaying 20 results from an estimated 100 matches similar to: "HABTM and acts_as_list"

2006 Apr 17
1
Error with installing rails/gems on ubuntu-dapper
I am getting an error when trying to install rails on dapper. It looks like it partially installed something. Mainly the issue seems to be with ''gems''? I am using: ruby-1.8.4 gems 0.8.11 Is this bad? bbrown@england:~/rubygems-0.8.11$ sudo gem install rails --include-dependencies Attempting local installation of ''rails'' Local gem file not found: rails*.gem
2006 Jan 14
0
habtm with acts_as_list vs. :through
Hi, I am interested in has_and_belongs_to_many with an acts_as_list relationship where the position field is in the join table. I found the following tutorial http://wiki.rubyonrails.org/rails/pages/HowToUseActsAsListWithHasAndBelongsToMany Is there a newer way that is less complicated? What about the :through parameter that I read DHH is writing? Is that a reality yet? Thanks, Peter
2020 Jan 26
2
Vacation use different SMTP server
Thanks for idea but it won't work for me as 'internal domains' can be anything, including gmail.com (and i don't know which of them are really internal/local, this is decided by sending SMTP everytime something is sent, based on MX records). Problem is that Dovecot/Sieve is using wrong SMTP server (one used for receiving e-mails which should NEVER be used for sending [and
2020 Jan 31
2
Vacation use different SMTP server
Op 28-1-2020 om 19:20 schreef azurit at pobox.sk: > Really no more info? You could do something with the sendmail_path or submission_host settings. Regards, Stephan. > > > > > Cit?t azurit at pobox.sk: > >> Thanks for idea but it won't work for me as 'internal domains' can be >> anything, including gmail.com (and i don't know which of them are
2007 May 19
3
form question
Suppose I have the following models/migrations: class Car < ActiveRecord::Base belongs_to :manufacturer validates_presence_of :manufacturer validates_association :manufacturer end class CreateCars < ActiveRecord::Migration def self.up create_table cars do |t| t.column :name, :string t.column :manufacturer_id, :integer end end class Manufacturer <
2006 Jul 11
0
using acts_as_list storing the information in a session
Hi, I have an order model that i am storing in a session, that is not currently in the database. I am updating the page using ajax, and I do not want to store the order in the database untill it is completely filled out. I have order_items that I am adding to the order, and I have used the acts_as_list within the order_item model. My problem comes when i try and rearrange the order_items
2006 Jul 18
0
Bug in acts_as_list?
I''m using UUIDs as keys into my database (stored as CHAR(36)), and additionally have a model that is set to act as a list. In this scenario, I believe that the queries that Acts::List generate are invalid, caused by IDs being strings rather than integers. System info: Rails: 1.1.4 MySQL: 4.0.26 This is the failing query: mysql> SELECT * FROM children WHERE (parent_id =
2006 Jul 23
2
REST controller with up and down for model that acts_as_list
Hi, I have the following models class Department < ActiveRecord::Base has_many :products end class Product < ActiveRecord::Base belongs_to :department acts_as_list :scope => :department_id'' end When I look at a list of products for a particular department I have up and down buttons to re-order the products. Currently my controller is something like this class
2006 Jul 31
0
acts_as_list with single table inheritance
I have a question about where to decorate my classes with acts_as_list. I am using single table inheritance and i have a base class LookupItem. There are 5 child classes: Priority, Probability, RiskRating, Status, and RiskManagementItem. Each of these 5 items needs to act as a list. Should I use acts_as_list on each child class or should it go on the parent LookupItem class? I''m
2006 Jun 11
0
Reaching through a belongs_to for acts_as_list scope?
I''m running into a situation where I''d like to provide the list scope for an acts_as_list model from one step removed. In minimalistic form (with several other associations removed from each level). class MainEntity < AcrtiveRecord::Base has_many :containers end class Container < ActiveRecord::Base has_many :elements belongs_to :main_entity end class
2006 Jun 27
2
how to use scope with acts_as_list
i am working on a task management system for the company i work for. i just got the rails cookbook and am trying to use the section on creating a drag and drop sortable list. the tricky part is that my Task model references the User model in two different spots. i have one field for the creator of the task and another for the assignee. so in my Task model i have the following code: class
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
2006 May 24
0
acts_as_list with scope for two fields without parent/child
Hello, I''ve a model which doesn''t rely on parent/child relationship (it''s a list of news articles) Each article has a lang char(2) which identify the language of the article, and a art_type char (2) which identify the place the article must be displayed (in the shop (SH), or in the website (WE)) So, the news articles order should be scoped on lang + art_type but I
2006 May 30
2
acts_as_tree, acts_as_list and is invincible (help!)
So I have the following model class Topic < ActiveRecord::Base belongs_to :topic has_many :topics, :order => :position acts_as_tree :order => :position acts_as_list :scope => :topic_id end that I use for a site''s navigation. Everything (list, create, edit, even the drag&drop sort) works fine, except the destroy function, which the vanilla version def destroy
2006 Apr 12
1
acts_as_list problem with records coming in and out
I have the model that acts as list acts_as_list :scope => ''featured=1'' As you can see, I only need to order the records that are featured. However, from time to time I switch some featured items off and mark others as featured. When this is done, I start getting dublicate numbers on the list and ordering starts getting problem... What would be the good approach to
2006 Apr 20
0
acts_as_list not CASCADE''ing in singular n-tier model structure
[using RAILs 1.1.2] Has anyone else seen issues where multiple tiered "acts_as_list" models do not CASCADE delete correctly? For instance, I have 4 models, the first 3 in the hierarchy have the appropriate "have_many" declarations with "exclusively_dependent => true". The last the models have the appropriate "acts_as_list" with the correct scope
2006 Apr 21
0
acts_as_list with the scope on boolean field
I have a boolean field in mysql (tinyint) which I want to use as a scope restriction for acts_as_list acts_as_list :scope => ''featured = #{featured}'' however, there is a problem here as when Rails generates SQL query for this it supplements true/false for #{featured} which raises error in mysql As a workaround I created dummy attributes that return 1/0 depending on featured
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
2005 Dec 16
0
Join table with acts_as_list?
If anyone can point me in the right direction, I''d appreciate it. I thought I''d recently seen an example of a habtm relationship where the join table used an acts_as_list to keep the ordering of the relationship. Does anyone have a slick way of doing this in 1.0, or was it something in edge rails that I''m thinking of? (The new :through parameter maybe?)
2008 Jan 27
0
Using acts_as_list, acts_as_tree, and STI in one model
Check it out y''all: http://rafb.net/p/NJg5U147.html (pastie was down) I''m trying to make a tree which belongs_to another model, where you can have sections or items as children, and sections can have sections or items as well. Moreover, any siblings should be sortable. For instance: Root - Section 1 - - Item A - - Item B - Item C - Section 2 - - Item D - - Section 3 - - - Item