Displaying 20 results from an estimated 1000 matches similar to: "Altering the accessor of an association collection"
2006 Jan 02
2
link_to : add title tag ?
How :
<a href="/show/all">All</a>
Could become :
<a href="/show/all" title="Show All" >All</a>
This is possible with the standdard link_to function ?
2006 Feb 20
0
Override automatic accessor for reference field in model
When a column in a database table is actual data, rather than an fkey to
another table, I can override the automatic accessor by just doing the
following:
def field_name
# do something here
read_attribute(field_name)
end
This does not seem to work for me if the field is an fkey, say user_id,
linking to another table. I''ve made this work by aliasing the accessor
like this:
alias
2008 Nov 25
2
creating a new vecotr in a for loop
I have consulted the intro and nabble but have not found an answer to what
should be a simple question, here goes:
I am doing a crosscheck of a data frame and pulling out a single value based
on an inputted value ie based on x i will select y, or if x =2 then my code
returns 7.
x y
1 4
2 7
3 10
4 2
My code currently iterates through for as many times as the length of the x
2009 Aug 10
1
Call AR belongs_to association accessor ID method on object assignment
Hi,
Haven''t been able to find this raised before but I''m sure it must have
been. When assigning an object to a belongs_to association I would
like it to call the *association*_id= method instead of directly
updating the attributes array. This is because I want to modify the
behaviour when assigning a particular object without writing separate
methods for whether it''s
2008 Nov 19
3
Overwriting / Decorating ActiveRecord association accessor
Hi,
I am trying to overwrite the accessor of a has_many association.
Basically my class looks like this:
class Person
has_many :emails
has_one :link, :class_name => ''PersonProxy''
def emails_with_link
link.emails + emails_without_link
end
alias_method_chain :emails, :link
end
Now that works fine if I only access the collection like
>>
2006 Aug 20
0
Re: Problem with overriding rails accessor methods
On 8/20/06, Paul Corcoran <prcorcoran-Wuw85uim5zDR7s880joybQ@public.gmane.org> wrote:
>
>
> Hello all,
>
> I just encountered something that is not what I would expect. I
> overrode an accessor method in my model class and within this method I
> did a "super" call which failed. Of couse my real method would be doing
> more but here is the basic code that
2006 Apr 13
4
equivilent to PHP''s nl2br?
Hey all, this is a pretty simple question but I can''t seem to find
anything on the wikki or google... Is there a Ruby/Rails equivilent to
PHP''s nl2br function?
--
Posted via http://www.ruby-forum.com/.
2006 Jan 29
11
HTML Output plugin
I have written a very small Rails plugin which makes it spit HTML back
at you instead of XHTML. Find details here:
http://dev.turnipspatch.com/trac/wiki/HTMLOutput
Hope it''s useful to someone!
Jon
--
Posted via http://www.ruby-forum.com/.
2010 Nov 17
2
Reference classes: accessor functions via 'getRefClass(...)$accessors(...)'
Hi there,
I''d like to choose between an "static" and "dynamic" access of a reference
class field, say ''a''.
myObj <- getRefClass("Blabla")$new()
Static: myObj$a
Dynamic: myObj$a.get() where the function retrieves the data
from a database (or some other location), stores it to a buffer and
2005 Sep 02
0
altering revert effect based on if dropped on given droppable?
Hi All
Does any one know how to specify a different reverteffect on a
draggable if its successfully dropped on a given droppable?
What I need to do is when an image is dragged onto a droppable image I
want the drop image to be replaced with the drag image, the drag image
to fade out and then reappear where it was at the start of the drag, as
opposed to the draggable scrolling across the page
2006 Feb 07
1
Altering the starting URL for webrick
Hi all,
With webrick (i.e. "ruby script/server") is there a way to alter the starting
URL? In other words, instead of "http://foo.bar.com", I''d like it to start at
"http://foo.bar.com/myapp"?
And, still be on port 3000?
If it''s not possible, that''s fine. Just thought I''d ask.
Thanks,
Dan
2005 Mar 01
2
altering legend with plot(density(..))
I'm having a hard time modifying the legend that is emitted by default
when calling plot(density(...)) and then legend(). I've looked at the
docs and I'm not sure what I'm doing wrong, if anything. Any advice
appreciated.
Thanks,
Brian
2005 Nov 01
0
altering a model for multiple tests
I have a model "Collection" which has a constant PATH.
When in development or production mode, I want PATH == "data/images".
When in test mode, I want PATH == "data/test/images".
Here is my partial solution: The Collection class defines PATH so that
it points the default (non-test) location. In my test file
"collection_test.rb", I overrid that assignment
2009 Mar 17
1
WinXP altering user...
I have a set of PCs running WinXP and an Ubuntu Machine running Samba 3.0.28a.
I am trying to achieve that each user that sits @ a PC be able to loging with their credentials
and have their homes directory without login-logoff of each user at the station via the WinXP
loging-logout screen.
Any ideas??
C.
2007 Oct 21
0
Altering Window Decoration
This may seem rather obvious, but how do I alter the window
decorations, such as making the titlebar opaque, and changing it's
colour? In CCSM -> Window Decoration -> Command I have set emerald, as
I use KDE (on Ubuntu). The CCSM- > Window Decoration screen does not
have an option for changing titlebar opacity or colour. The Emerald
Theme Manager doesn't seem to be able to change
2009 Aug 02
0
[LLVMdev] code-altering Passes for llc
On Aug 2, 2009, at 7:09 AM, Artjom Kochtchi wrote:
>
> Greetinigs,
>
> I am extending llc to include runtime checks for calls (in X86). So
> a call
> 'call target' is altered to look like this:
>
> [some check]
> jne error_function
> call target
>
> I've done this by implementing a MachineFunctionPass that is
> instantiated
> and added
2009 Aug 03
0
[LLVMdev] code-altering Passes for llc
Does the error function *have* to be auto-generated in your pass?
Perhaps the original code should use invokes, and your pass insert the
error check with a jne to the "unwind" block.
On Mon, Aug 3, 2009 at 5:18 AM, Artjom
Kochtchi<artjom.kochtchi at googlemail.com> wrote:
>
>
> Dan Gohman-2 wrote:
>>
>> You don't need a ModulePass to modify a CFG. A
2009 Aug 06
0
[LLVMdev] code-altering Passes for llc
On Aug 6, 2009, at 5:45 AM, Artjom Kochtchi wrote:
> So I was searching for a possibility to include an additional
> (Machine)BasicBlock (or rather a MachineFunction?) somewhere in the
> program
> that contains the program termination and that I can jump to on check
> failure. Can't I do that during a Pass in llc?
If you just have a magic block of instructions you want to
2017 Feb 07
0
package load altering RNG state
Hi,
On 2017-02-07 13:12, Benjamin Tyner wrote:
> Hello
>
> When loading a package, I'm wondering if it's frowned upon for the
> package to alter the state of the random number generator? I guess not,
> since the parallel package does it?
Surprisingly it is not frowned upon, but it *is* a nuisance. I brought
it up a couple of years ago
2009 Jun 15
1
altering a global variable
I'm working on a program that loads several large data files. I'm
using ddply (plyr is really awesome) but I want to minimize the amount
of times a large data file is read in. One solution is to keep track
of which data file is open with a global variable and then change the
currently open data file globally as needed. However, I'm unclear on
how to alter a global variable