similar to: initialising an instance variable on ActiveRecord creation

Displaying 20 results from an estimated 100 matches similar to: "initialising an instance variable on ActiveRecord creation"

2006 Mar 15
4
help with DRY violation
I''m trying to be a good rails developer and fix DRY violations as i find them. However, i''m trying to fix this one, i cant seem to get it to work. I have two tables A and B that have a one-to-one relationship. Table B belongs_to Table A. Table A has_one Table B. I''m creating instances of Table A in different places, depending on the controller. However, for each
2006 Jul 31
3
Polymorphic associations and single table inheritance
Running into an interesting problem that at first glance appears to be a bug in the AR association code. However, it''s explicitly coded this way so I''m not so sure. I have some code like this: class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end class Person < ActiveRecord::Base has_many :addresses, :as => :addressable,
2008 Nov 03
0
acts_as_rateable in rails 2.2.0
Hi all, I have a problem with acts_as_rateable in rails 2.2.0. [code=]ActionView::TemplateError (uninitialized constant <#object>::Rating) on line #10 of app/views/blah/blah.html.erb: /Library/Ruby/Gems/1.8/gems/activesupport-2.2.0/lib/active_support/dependencies.rb:102:in `const_missing'' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.0/lib/active_record/base.rb:2042:in
2008 Sep 25
1
defining polymorphic type condition
As great as Rails 2.1 is, I for the life of me cannot figure out why polymorphic associations do not support reconfiguring the type column used. For example, I have no way to do a polymorphic association using a lookup hash which maps an integer to a class name. Storing a TINYINT unsigned is waaaaay more efficient than storing a string like "SomeActiveRecordModel" over and over again.
2006 Feb 23
3
has_many reference
I am trying to do something right from Agile Web Dev with Rails book and it does not work. I must be missing something obvious. I have a one-to-many relationship: class Draft < ActiveRecord::Base has_many :endorsees end class Endorsees < ActiveRecord:: Base belongs_to :draft end >From my reading, methinks I should be able to say: d = Draft.new d.endorsees << Endorsee.new
2007 May 24
3
Annoying problem, stack error
For some reason rake spec is totally crapping out on me. I don''t know what I did to make it break, the only thing I tried new was install haml, but even after removing it there is still a stack trace. Here is what I am getting- sparta at phalanx ff $ rake spec (in /Users/sparta/Projects/work/idastudios/ff)
2017 Nov 15
2
Converting a string to variable names
Hi, Thanks for your reply. I just came up with another question about a similar but different thing: Say I have a bunch of data.frame variables named P1,P2,P3? I want to assign them row names according to symbols in the first column, and I want to do this using a for loop. How could I accomplish this? for (test_sample in c(1:10)){ +
2006 Jan 19
7
bug in has_many count?
I can submit a patch, but wanted to confirm I''m looking at this right... The docs indicate that if you specify a has_many association with :finder_sql, but no :counter_sql, it constructs the appropriate counter sql by substituting the SELECT clause. But has_many_association.rb doesn''t seem to do that -- it just passes Base#count_by_sql the finder_sql, which doesn''t
2007 May 30
2
ActionView::TemplateError
Hi, I have a strange problem that only occurs on the production server. I''ve been banging my head for hours trying to figure it out with no success. Below is a copy of the error from the production log. ActionView::TemplateError (Expected /www/rails_apps/scanlan/current/ public/../config/../app/models/image.rb to define Image) on line #6 of app/views/admin/design/_record.rhtml: 3:
2017 Oct 02
2
R and Supervised learning
Hi, I am currently find myself selecting manually amoungts several hundreds Google Alerts (GA) texts those that are indeed relevant for my research vs those which are not (despite they are triggered by some relevant seach keywords). Basically each week I get several hundreds GA email such as:
2009 Jan 07
1
problem with initialising R-Project through C#
Hi, i got a problem with initialising R-Project from C# in this i m sending what are all the code line I had been written and the error where i got sc1 = new STATCONNECTORSRVLib.StatConnector(); sc1.Init("R"); and error at SCN_E_INVALIDINTERPRETERVERSION -2147221487 0x80040011 can any one suggest how can i resolve it thanks & regards; kiran [[alternative HTML version
2010 Jun 11
0
blk_tap: Error initialising /dev/xen/blktap - No more devices
Hello, i am experiencing something weird on my Xen Dom0 Since a few days, i can no more install or reboot any vm using tap:aio driver My vms complains about no mounted disks OS: On openSUSE 11.2 (x86_64) with xen-tools-3.4.1_19718_04-2.1.x86_64 kernel-xen-base-2.6.31.8-0.1.1.x86_64 xen-libs-3.4.1_19718_04-2.1.x86_64 kernel-xen-2.6.31.8-0.1.1.x86_64
2014 Jun 13
0
[PATCH 2/2] drm/nouveau: Remove an unneeded write while initialising PGRAPH
The blob does not seem to write at that place for my NVAC, though it does for my NV96, agreeing with what is done in the if/else structure below. I guess someone forgot to remove the line when the if/else was put in place. Signed-off-by: Pierre Moreau <pierre.morrow at free.fr> --- drivers/gpu/drm/nouveau/core/engine/graph/nv50.c | 1 - 1 file changed, 1 deletion(-) diff --git
2005 Jul 20
3
Firefly 3rd party - it hangs on "Initialising" and exits with error
Hi, I spot weird behaviour of latest Firefly 3rd party on my laptop. Sometimes it comes to state that it won't start (hangs on "Initializing" ) and it again works after system restart... Didn't yet figured out how to recreate it..... Any similar experience ? Also - how can I force Firefly to make outgoing calls (also sip or iax calls) through Asterisk ? I'd like to
2005 Mar 14
1
initialising trellis device {lattice}/ postscript
Background: OS: Linux Mandrake 10.1 release: R 2.0.0 editor: GNU Emacs 21.3.2 front-end: ESS 5.2.3 --------------------------------- Colleagues I am using: trellis.device(postscript, file="../figures/name.ps") .....code to generate the trellis display here .... graphics.off() to create a postscript from a working xyplot display. The problem is that the postscript file appears to be
2005 Mar 14
0
fixed/ initialising trellis device {lattice}/ postscript
Thanks Andy out<- xyplot(....) print(out) did the trick nicely. Sam ---- Sam McClatchie, Biological oceanography South Australian Aquatic Sciences Centre PO Box 120, Henley Beach 5022 Adelaide, South Australia email <mcclatchie.sam at saugov.sa.gov.au> Telephone: (61-8) 8207 5448 FAX: (61-8) 8200 2481 Research home page <http://www.members.iinet.net.au/~s.mcclatchie/>
2006 Sep 25
1
Initialising Mersenne-Twister with one integer
Hi, It seems to me that the Mersenne-Twister PRNG can be initialised using one integer instead of 624 integers, since inside RNG.c code there's a function defined as MT_sgenrand(Int32). How do I actually set this seed within R? I've tried: > .Random.seed <- c(3, 1) > runif(1) Error in runif(1) : .Random.seed has wrong length In addition, is '3' actually the
1999 Jan 21
0
Initialising share modes failed
Dear all, we have installed Samba 2.0.0 on a Sun Sparc5 running Solaris 2.5.1. /usr/local/samba/bin/smbstatus is telling us: ERROR: Failed to initialise share modes! Can't initialise shared memory-exiting Any idea what's wrong with our system? TIA, Rainer Blaes DaimlerChrysler Aerospace AG, Bremen (Germany)
2011 Mar 07
1
Initialising UPS variables from ups.conf
Are there any plans to allow us to specify UPS variables in ups.conf, eg: [evo_s_3000] driver = usbhid-ups port = auto desc = "Eaton Evolution S 3000" vendorid = 0463 productid = ffff ups.delay.shutdown = 120 ups.delay.start = 130 The reason I ask is that I'm using FreeBSD & gmirror and need to extend the gracetime
2002 Sep 10
3
wine initialising... then nothing
I installed WPO2000 on RedHat 7.2 - it worked fine for a while. I used the updated install scripts and Mr. Torrie's CorelWine rpm. It has been working fine for a couple of weeks (and continues to do so on another machine). Now when I start the WP application, I get a window that says "Wine initializing...", then it goes away (a little too quickly, I think), and then...