similar to: More than one has_many :through association between the same 2 models

Displaying 20 results from an estimated 110 matches similar to: "More than one has_many :through association between the same 2 models"

2006 Jul 10
10
has_many :through and foreign key parameters
I just took my HABTM and turned it into a :through since my join table has another "non-joiny" attribute. I went from this: has_many_and_belongs_to :jobs, :join_table => ''tablename'', :foreign_key => ''x'', :association_foreign_key => ''y'' to this: has_many :jobs, :through =>
2006 Apr 10
3
Simple act_as template
Hello ! I posted a simple template to show how to add ''act_as_whatever'' to ActiveRecord. I think this might be useful to others as there are some trickery ruby things in this file. Here is the template : http://textsnippets.com/posts/show/384 Gaspard Bucher -- Posted via http://www.ruby-forum.com/.
2006 May 07
3
Webrick not showing sql queries any more?
Hi all, I updated rails to 1.1.2, and somehow, when I run script/server on a new rails project, I don''t see the sql queries in the console any more... It was very useful to see them live... Does any one have any idea why? Thank you very much! Nauhaie -- Posted via http://www.ruby-forum.com/.
2009 May 27
2
Object-oriented programming in R
Dear R-users, I have very recently started learning about object-oriented programming in R. I am far from being an expert in programming, although I do have an elementary C++ background. Please take a look at these lines of code. > some.data = data.frame(V1 = 1:5, V2 = 6:10) ; > p.plot = ggplot(data=some.data,aes(x=V1, y=V2)) ; > class(p.plot) ; > [1] "ggplot" My
2006 Apr 30
7
Rich text aera?
Hi all, I am trying to add an article editing interface to my future webstore, and I am wondering what to use for text formatting. I would like to avoid using HTML, and calibre-bbcode just won''t work (see my last post). Is there some kind of library for live text formatting right in the browser? I would just need bold, italics, size and ul lists... Do you know of a good solution?
2004 Jul 22
2
Files and classes in a package?
While installing my small package, I met a tricky problem. For clarity, let me explain it with the following simplified example. In ~/pkg/R/aclass.R, setClass("aclass", contains="bclass", representation(i="numeric")) In ~/pkg/R/bclass.R, setClass("bclass", representation(j="numeric")) After building a "pkg" package, the file
2006 May 22
2
using Singleton with Prototype
Hello all. I''m writing my own object using prototype and I wonder how you write and call only one instance of class. Can anyone share his idea of singleton? thanks Gregor ---------------------------------------------------- Gdy nadchodzi przełomowy moment w historii, musisz zdecydować, po czyjej stronie będziesz. "X-Men: Ostatni bastion" - w kinach od 26 maja.
2006 Jul 16
6
Apache2.2 + Mongrel: what do you think about these perfs?
Hi all, I''ve been spending quite a lot of time trying to install a decent RoR server on my dedicated server (Ubuntu 6.06 LTS), and now, everything works. However, the performances are not really what I had expected... I would like to know what you think about it. Here is my config: 2GHz VIA proc, 1Gb RAM, SATA-II HD. I have apt-got ruby 1.8.4, mysql5 and installed rails 1.1.4 by
2011 Mar 06
1
Seeking guidance in package creation when it contains s4 class
Dear all, I am having problem to create a package when this package is supposed to have some newly created s4 class. Here is my workout: > #rm(list = ls()) > setClass("aClass", sealed=T, representation(slot1 = "vector", slot2 = "character")) [1] "aClass" > fn1 <- function(x, y, z) { + x <- x[1] + y <- y[1] + z <- as.character(z[1]) +
2006 Oct 24
13
How can my boss take rails seriously with bugs like this?
The Time::next_week method is supposed to give the time of the start of the next week. But look at this, it cocks up : >> t=Time.parse "Monday October 16th 2006" => Mon Oct 16 00:00:00 BST 2006 >> t.next_week => Mon Oct 23 00:00:00 BST 2006 >> t.next_week.next_week => Tue Oct 24 00:00:00 BST 2006 >> t.next_week.next_week.next_week => Mon Oct 30
2006 Apr 22
3
freeze_gems not freezing all gems?
Hi, I am currently experimenting on rake freeze_gems and there is something I do not understand. When I freeze_gems my app, it puts Rails in the /vendor/ directory, which works. But what about all other gems I have installed (for example Unicode, sqlite support, mysql support and so on)? The aim of freezing is to be independant of the versions of the ISP, but it seems that the server still
2006 Sep 18
2
RedCloth !image! bug with filter_html
Hi all! I am trying tu set up RedCloth for user-submitted comments. And here is my problem. The :filter_html option just breaks images :-( For example, if I try in irb: string= "Some textile !agif.gif! and textile again" RedCloth.new(string, [:filter_html, :filter_styles]).to_html(:textile) I get: NoMethodError: You have a nil object when you didn''t expect it! The error
2007 Feb 22
3
List filtration
Hello R-ologists, Imagine you have a list "list" like so: >list [[1]] [1] "IPI00776145.1" "IPI00776187.1" [[2]] [1] "Something" "IPI00807764.1" "IPI00807887.1" [[3]] [1] "IPI00807764.1" [[4]] [1] "Somethingelse" What I need to achieve is a filtered list "list2" like so: >list2 [[1]] [1]
2008 Mar 14
2
Multiple should_receive(:render).with
I''m trying to specify that a particular view must render two different partials. My spec looks like: describe AClass do it do template.should_receive(:render).with(:partial => ''foo'', :locals => { ... }) ... end describe ''some conditional case'' do it do template.should_receive(:render).with(:partial =>
2003 Feb 27
4
ACL permissions with XP problem
Wondering if anyone can help... here is my setup: RedHat 7.3 with XFS (using the XFS install disk) After installation I'd downloaded 2.2.7 src rpm from redhat and rebuilt it with the --with-acl-support option in the samba.spec file then upgraded the resulting rpm files I've added the machine accounts and made root a smb user I can log in successfully(after applying the xp registry hack),
2006 Aug 17
2
How to trigger an action from script/console
Hi, I have build a conversion script from an old database to a new one (which is designed to work with ROR), and every action converts one table and takes over 5 minutes... When I trigger the actions from my browser, I finally end up with a "Failed to start properly"... So, simple question: How can I do this from the console, that is to say, trigger one of my controller''s
2006 Apr 29
3
Post to a remote page
Hi all, I am sorry if this question has already been replied here, but I did not manage to find an answer. I am looking for a way to post data to a remote web page. I don''t want to use hidden fields and a submit button, I would just like some ruby code that would post parametres to a web page and store the web page that the remote server sends back. I am not sure that I have been
2008 Sep 30
1
PKI Compliance Dovecot Server
Hello, I work for an organization that uses a Secure Dovecot server for messaging, and recently we've had to undergo some security screenings for PKI compliance (credit card industry standards). However, the screening returned to us a failure due to the following reason (attributed to our Dovecot server, which runs on port 993 and is the only "open" port on our firewall): Synopsis
2005 Aug 10
4
Options for >4GB setups
Hi, everyone I know that this has been asked to death on the list, and in the past few days I''ve been trying to see if there were other options for getting a xen host to use more than 4GB of RAM. I''ve tried xen-unstable x86_64 on Xeon EM64Ts as well as xen-unstable with the initial PAE support but neither got me too far from booting: the former hangs when using the supplied
2006 Sep 13
4
Mini_Magick Problem
I can''t for the life of me figure this out. Been banging my head on this since the weekend, and can''t see what I''m doing wrong. This code works: image.resize("640x480") image.write(path) I run this and I get the resized file just fine. This doesnt work at all: width = 200 height = 100 dimensions = "#{width}x#{height}"