Displaying 8 results from an estimated 8 matches for "my_foo".
2006 Apr 04
1
Manipulating has_many :through associations
...bars
has_many :bars, :through => :foo_bars
class bar
has_many :foo_bars
has_many :foos, :through => :foo_bars
class foo_bars
belongs_to :foo
belongs_to :bar
If I have an instance of foo and an instance of bar, how do I add the
association between the two of them?
my_foo.bars << my_bar
or (inversely),
my_bar.foos << my_foo
or do I somehow need to manipulate the join model explicitly?
Thanks,
Brad
--
Bradley Mazurek
2006 Apr 11
4
Managing "application scope" data - best practices
All,
I have some data that I need to be able to see across the application.
For J2EE people out there, I need something that I want to have
available in the "application scope" of my app.
What is the best way to handle this?
I''m trying to access a class variable that I created in my controller
from my view (to no avail).
Create a class variable in my helper class and use
2012 Nov 27
0
[LLVMdev] libclang issue: CXCursor_FunctionTemplate does it work?
Hi,
I'm a happy user of libclang.so
I got in trouble trying to get info from templated function such as
/* File: t.cc */
template <class T1,class T2>
void my_foo(T1 a,T2 b)
{
}
I only got CXCursor_FunctionDecl cursor instead of CXCursor_FunctionTemplate
and I don't getting CXCursor_TemplateTypeParameter.
And argument type is Unexposed.
I using 3.1 version with few patches.
Maybe there is patch to handle this, but sorry I didn't found it.
2010 Apr 27
2
Resolving functions using R's namespace mechanism can double runtime
It appears that the runtime for an R script can more than double if a few
references to a function foo() are replaced by more explict references
of the form pkgname::foo().
The more explicit references are of course required when two
loaded packages define the same function.
I can understand why use of this mechanism is not free in an
interpreted environment like R, but the cost seems rather
2007 Jun 22
0
Using through with habtm
...).
Let''s say Bar has_many Bazs (how the heck do you pluralize Baz?).
It would be nice to be able to say that Foo has_many Bazs through =>
Bar, but this does not seem to work.
Am I right, or should it be possible to do this?
The best I have been able to do is this:
bazs = []
my_foo.bars.each do |b|
bazs += b.bazs
end
bazs.uniq!
That''s not TOO messy, but not as clean as foo.bazs.
If I am right about foo.bazs not being possible, is there a better/
cleaner workaround than the one I am using?
--~--~---------~--~----~------------~-------~--~----~
You rec...
2006 Aug 11
6
Newbie Question -- Override String functionality
Hello,
I would like to add functionality to the String class....where do I do
this?
Do I create a new model (if so, what do I call it?) and put something
like:
class String
def my_new_string_method
blah blah
end
end
Thanks for any pointers.
--
Posted via http://www.ruby-forum.com/.
2009 Mar 04
0
[LLVMdev] Adding Intrinsics for custom processor (frotend, problem)
...n types for your macros, and
> gcc/builtin-attrs.def lists the attributes, though I've only ever
> used ATTR_NOTHROW_LIST.
>
> a) Use the macro you defined earlier to generate your builtins, in
> our example case it is
>
> DEF_MY_BUILTIN (BUILT_IN_MY_FOO, "my_foo", \
> BT_FN_PTR_PTRPTR_PTR, ATTR_NOTHROW_LIST)
>
> This is straightforward, the first parameter is an ID for your
> builtin within gcc -- it just needs to be unique. The second is
> the "name" of your builtin, which will be pre...
2009 Mar 03
4
[LLVMdev] Adding Intrinsics for custom processor (frotend problem)
As mentioned in an earlier mail, I am working on an LLVM backend for a
custom processor based on MIPS.
My problem is how to extend LLVM to support some esoteric/non-standard
feature of the underlying hardware.
I saw in the "Extending LLVM" document, that the easiest / most common
way to do this was using an intrinsic function,
and examples of the technique abound (all SSE for