similar to: acts_as_list with the scope on boolean field

Displaying 20 results from an estimated 10000 matches similar to: "acts_as_list with the scope on boolean field"

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 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 Jan 09
3
tinyint(1) and boolean
So i had a boolean attribute in my model which gets interpreted to tinyint(1) in mysql by rails migrations. Now tinyint(1) accepts a range in mysql and i want to change my boolean attribute to an attribute which can accept 3 values(0,1,2). I made the change to the view and when i post the form selecting the selecting the value ''2'', it still gets saved as a ''0''.
2006 May 26
6
Help needed with acts_as_list
Hi ! There must be something I don''t understand clearly in acts_as_list I have a list of gallery entries (images + text), model is GalleryEntry. I have a field in_exhibition (boolean) I want the list to be sorted with a scope on in_exhibition : from 1 to N for every record having in_exhibition = false and 1 to N for every record having in_exhibition = true When I use acts_as_list
2009 Mar 23
2
rails boolean and mysql tinyint(1) question?
this may seem silly but i just noticed that if in mysql the column which is a tinyint(1) happens 2 or greater, by a chance of glitch or corruption in the database(i did it manually ofcourse but i am speaking hypothetically), rails would see it as false. but i find that really wrong seeing how in mysql it sees any non-zeroes as true. i really think if it does happen to be any number other than 1
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
2007 Mar 28
1
acts_as_list nested scope
Here''s what I''m trying to do: class Model < AR::Base acts_as_list :scope => [:key_one_id, :key_two_id, :key_three_id] end with the idea being that there are these three references from this table (one of them being optional) that define the list. I don''t think acts as nested set works in this situation because I''m still just dealing with a single list
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
2005 Nov 25
2
acts_as_list with 2 fields in the scope
Hi Railers, I''ve got a Categories table. I want it to act as a list within the scope of the parent_id AND the site_id. Categories table : id label site_id parent_id So, in my Category class, I have : acts_as_list :scope => ''site_id = #{site_id} AND parent_id = # {parent_id}'' The problem is that when I try to move_up a Category with a parent_id that is null,
2006 May 21
3
acts_as_list scope and polymorphic association.
this is my model: class Person < ActiveRecord::Base has_many :phones, :as => :callable, :order => :position end class Phone < ActiveRecord::Base belongs_to :callable, :polymorphic => true acts_as_list :scope => :callable_id end how can i add the callable_type to the scope. how can i say the scope is the {:callable_id,:callable_type} couple? is it even possible? thanks
2007 Apr 29
1
acts_as_list with :scope - how do I move items to a different list?
Hi, I have in my simplistic app: class Album has_many :pics, :order => :position end class Pic belongs_to :album acts_as_list :scope => ::album end It all works fine when creating a new pic from the forms. But, when trying to move a pic between albums, the album changes Ok, but no matter what I do the position attribute stays the same and the list navigation is broken. So far,
2011 Oct 10
1
To query two SQL tables for user verification over LMTP, should I use (a) two separate lookups? or (b) just one lookup with a boolean query?
Hey all I've been running a Dovecot 1X server for awhile. Most of the config was pretty simple using flat files. I'm switching to Dovecot 2X now, and want to switch to using SQL for lookups so I can share info with the Postfix front end. For starters I setup two SIMPLE SQL tables -- a 'users' table and a 'aliases' table, where each user can have many aliases. I want to
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
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
2009 Jan 05
3
Plugin not found: ["acts_as_list"]
I am trying to install acts_as_list in a rails 2.2.2 project but when I try the following: ruby script/plugin install acts_as_list I get: Plugin not found: ["acts_as_list"] I had to download the acts_as_list plugin from the github because it isn''t included in Rails 2.2.2. The files are in my vendor/plugins/acts_as_list folder so I have: lib/active_record/acts/list.rb
2009 May 09
0
acts_as_list not working despite being installed
I just installed a newer version of Ubuntu and so with it, rails 2.3.2. Now I can''t get acts_as_list working. I get the error: undefined method `acts_as_list'' for Child(Table doesn''t exist):Class But I have already run > ruby script/plugin install acts_as_list + ./README + ./init.rb + ./lib/active_record/acts/list.rb + ./test/list_test.rb I started a new program
2007 Jan 25
1
acts_as_tree with acts_as_list
Hello all, I''m having trouble using acts_as_list with acts_as_tree to order the "children". I''ve found a few old posts on the web that seem to indicate that this once worked. class Whatever < ActiveRecord::Base acts_as_tree :order => :position acts_as_list :scope => :parent_id Although the ''position'' field is being populated, it appears
2006 Feb 05
0
Enum patch for Rails
Hello! I''ve modified ActiveRecord a bit to support enum columns. This is tested only with MySQL, and maybe needs some changes for other adapters (if they use another syntax or quoting style). I believe this patch should be tested well, so I haven''t (yet) tried to post it to the official Trac. It is also not solid-as-a-rock when it comes to quoting ENUM values. After
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
2009 Feb 12
0
acts_as_list sort by multiple items
I have a Person model and I''m using acts_as_list so I can have drag/drop positioning of people. The only thing is, I want to be able to differentiate between male and female, ie. sort males separately from females. It seems completely useless to have two separate models since all the other attributes of a person are the same (name, address etc) Does acts_as_list allow ordering by, say,