similar to: HABTM -VS- belongs_to/has_many, for self-referential joins

Displaying 20 results from an estimated 300 matches similar to: "HABTM -VS- belongs_to/has_many, for self-referential joins"

2002 Dec 23
1
Strange axis labels?
Moi! I'm trying to add a rather long label to a y-axis, and it's so long that it won't fit into one line. However, things get strange when I try and split it over 2 lines. The problem seems to be the plus/minus symbol, which means I have to use expression(). I'm using R1.6.1 on Windoze 2000. As an example: thing1 <- expression(paste("log odds of survival probability (
2006 May 02
4
recommended setup of Mongrel_cluster + SSL for multiple apps?
I''d like to use Mongrel_cluster with SSL on a green-field application (it can be configured however is best - initially, "ease of setup" is important, but then soon after will be scaling and response time). I''ve read a lot of emails on this topic, and checked out the Mongrel pages, etc, but I''m left with this question of what is recommended: For a
2006 May 02
2
Autotest doesn''t work on WinXP?
When I try to run autotest (zenspider) (which looks VERY cool), I get this error: (run from within a Rails app directory) C:\ruby_home\analysis>autotest -rails # Testing updated files + c:/ruby/bin/ruby -Ilib:test -e ''["test/unit/user_test.rb", "test/unit/role_test.rb"].each { |f| load f }'' | unit_diff -u ''c:'' is not recognized
2006 Mar 02
3
Modifying "Find" to always add a condition?
I''d like to always add a condition to any version of "find" (e.g. Thing.find(), Thing.find_by_name(), Thing.find_by_whatever) so that in addition to whatever conditions are set, an additional condition is set :conditions=>"user_id=#{current_user.id}" I''d like to make sure that a user only sees/edits/creates entries in the database that have the user_id
2006 May 25
5
Is there a way to abstract the updating of other parts of the page after an Ajax request without putting using the standard view file?
Hey all, I''d like to abstract the process of updating different portions of the page after an Ajax request has taken place. Rather than simply putting the extra view logic in the standard rjs template, it seems to give better separation if there is a split between the core view logic (ie, inserting a row in a table), and updating any associated portions of the page. Is this possible? I
2006 Jan 06
2
Re: Some advice on DB modeling
I have more or less the same problem. I''m trying to build a system where users can enter their friends. But the solutions seems not to work for me. I used same sql: CREATE TABLE `friends` ( `user_id` int(11) NOT NULL default ''0'', `friend_id` int(11) NOT NULL default ''0'', KEY `user_id` (`user_id`), KEY `friend_id` (`friend_id`),
2006 Jan 30
4
Warning message when returning multiple items
In my function I am trying to return multiple computed items (separated by commas). The function does what I need, but I get a warning message that multi-argument returns are deprecated. Is this a warning I should heed, or is there a more elegant and warning free way of achieving the same end? Thanks --------------------------------- [[alternative HTML version deleted]]
2007 Nov 12
15
If form changed ask if you really want to exit page...
First things first: Hi all! I''ve been sucked into prototype and script.aculo.us develpment thanks (because of?) the Symfony PHP framework... I''d like to implement a feature on some admin pages, but I can''t seem to find the right search term to google it; I want to ask the user to confirm exit of a page, if she has changed anything on the forms displayed on it. I have
2006 Jun 03
2
Parent listing children.
My database is set up as Categories > Things associated by category_id and has_many and belongs_to. How would I go about listing all the categories and under each Category is it''s children? Is there an easy rails way to do this - preferably without using acts as tree? Any help is appreciated - thanks! -- Posted via http://www.ruby-forum.com/.
2015 Mar 31
2
emailing plain text to exchange/outlook
I know this isn't CentOS-specific, but it is probably a common problem - does anyone have a solution? If you mail something that is plain text from linux a recipient using outlook, it will remove line breaks more or less randomly. There is a way to tell outook to put them back as you read each message, but most people just think I sent it wrong. Is there something you can do to make a
2006 May 24
0
processing emails to extract HTML content? (is RubyMail or TMail right?)
I need to extract the main body from an HTML email - or - strip all of the email related stuff out of an email leaving just the HTML code that is in the body (ideally, so that it could be saved as an HTML page that is ready to show in a browser). Has anyone had success doing something like this? I''ve found RubyMail and TMail that purport to help with this, but was wondering if anyone had
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
2006 Apr 18
6
Linking one model to another
I have a User model and a Thing model. I want to link users with things, so I have a migration that creates a permissions table with user_id and thing_id. The migration works fine and gives me three columns, I assume I need the permission''s ID so that I can delete it in future. Three questions come to mind though, which I have given thought but got nowhere. 1) Does the
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
2013 Oct 17
1
Can't restore from GPFS snapshots, disk_free error
Hello, We're trying to set up a GPFS system with Samba running on top with CTDB managing it. I have snapshots set up to be accessible in every directory as the invisible directory .snap The snapshots are in the following format: /usr/lpp/mmfs/bin/mmcrsnapshot 1MB `TZ=GMT date + at GMT-%Y.%m.%d-%H.%M.%S` ?and look like this from the UNIX level:
2006 Mar 21
0
is "Task" a reserved class name in Edge Rails? (it clashes with Rake''s Task)
Ok, so I''ll bet that lots of people would naturally have a DB table called "Tasks" and a model called Task, and this works fine in Rails 1.0. BUT, using Edge Rails things turn strange when you start visiting your Task pages because it thinks that you''re trying to use Rake (which also has a Task class). Is there any way around this? -Greg Greg Edwards CTO,
2006 Feb 11
1
Retaining multiple select values from action to action?
Suppose I have a multiple select form on an initial page called things[], and two target actions. The initial page submits to target action 1, and target view 1 submits to target action 2. When I submit the form on the initial page, I can access that set of values in target action 1 and turn it into an array of objects by doing something like this (assuming that the option values are object ids,
2002 Dec 11
2
ordering x's and y's
Hello ALL: How do I get R to list all possible orderings of 2 x's and 3 y's? It should look like this (which rows appear first is unimportant): x x y y y x y x y y x y y x y x y y y x y x x y y y x y x y y x y y x y y x x y y y x y x y y y x x Thanks, ANDREW
2006 Mar 29
4
:through alternate
I''d like to use :through to create a web of associations like: class Thing < ActiveRecord::Base has_many :child_things, :through => :thing_thing has_many :parent_things, :through => :thing_thing, :some_other_option? end class ThingThing < ActiveRecord::Base belongs_to :thing belongs_to :child_thing, :class_name => ''Thing'', :foreign_key =>
2006 Aug 12
1
has and belongs to many different?
Is there such a thing? I am thinking of an application that has something like this: 1. person has many things - there is a ''persons'' table 2. the things he has are stored in a table that is something like this person_id, thing_table_name, thing_id For example, it may map to person1, books, 23 #Person 1 owns book 23 person1, books, 25 #Person 1 owns book 25