Displaying 20 results from an estimated 200 matches similar to: "Subclasses - help required"
2006 Jun 10
4
collection_select question
How do I specify which option should be initially selected when using
the collection_select command? I''ve tried:
collection_select(:selectionfilter, :producer_id, Producer.find(:all),
:id, :name, {:include_blank => true, :selected_value =>
@initial_selection})
However it doesn''t return the desired results (the option with the value
of @initial_selection selected).
2011 May 26
3
Kaminari rspec testing undefined method page.
Someone use kaminari for pagination?
I''m doing some tests but I don''t know why I have an undefined method page.
Here is my simple test:
describe "GET index" do
it "assigns all fire_preventions as @fire_preventions" do
FirePrevention.stub(:search) { [mock_fire_prevention] }
get :index
assigns(:fire_preventions).should
2006 Jan 16
0
belongs_to with has_and_belongs_to_many
I''m having a problem with belongs_to and has_and_belongs_to_many.
Here''s a brief summary of the models involved:
class Member < ActiveRecord::Base
set_primary_key ''member_id''
has_and_belongs_to_many :projects, :join_table => ''projects__members''
has_many :projects, :foreign_key => ''created_by''
end
class
2005 Feb 09
1
cant map foreign key in list view
Hi
I have been struggling to get a foreign key in a list map to a readable
value in a lookup table
I have a list of projects and each project has a project_manager.
Project.rb
class Project < ActiveRecord::Base
has_one :project_manager, :class_name => "Users", :foreign_key =>
"manager_id"
end
The association above sais that a project_manager is in
2006 Feb 14
6
Multiple associations to the same class
Hi,
I cannot seem to create associations like this:
class Project < ActiveRecord::Base
belongs_to :manager, :class_name => ''User'', :foreign_key => ''manager''
belongs_to :liaison, :class_name => ''User'', :foreign_key => ''liaison''
end
p = Project.new
p.manager
=> 1
trying to retrieve associated objects
2006 Jul 06
4
Oracle HR on Rails
Interesting read...apologies if it has been posted already.
http://www.oracle.com/technology/pub/articles/saternos-rails.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060706/619e650a/attachment.html
2006 Feb 10
1
Eager loading issue
I have three tables, Invoices, Projects, and Managers.
Each manager has many projects. Each project has many invoices.
When displaying a list of the invoices, I am using:
Invoice.find(:all, :include => [:project])
Since the list shows information from the project table. (For
example, a table showing Invoice Date, Project Name). However, I''d
also like to show the manager name.
2006 Jan 02
0
Best practice for registering/discovering STI subclasses?
Folks,
I''m fairly new to Rails, and I''ve Googled around for an answer to this
question with no luck...
Consider a little blog application that has uses single-table
inheritance for the handful of different content types via a Content
base class and subclasses like FooContent and BarContent. That part
all works well for me.
Now consider the view that presents actions to the
2006 Jan 09
0
Problem with publishing subclasses by AWS API specification
Hi,
I''m quite new to Rails and have a problem with the use of AWS.
The Problem is, that I have a class which provides some basic attributes
and some subclasses of this with more specific attributes. I want to
send objects of those classes through SOAP by a remote client, but if I
specify just the base class in the method signature of my API definition
the generated WSDL file will
2006 Jan 11
0
HELP!! - Problem with AWS and subclasses
Hi,
I''m quite new to Rails and have a problem with the use of AWS.
The Problem is, that I have a class which provides some basic attributes
and some subclasses of this with more specific attributes. I want to
send objects of those classes through SOAP by a remote client, but if I
specify just the base class in the method signature of my API definition
the generated WSDL file will just
2006 Jan 18
0
subclasses_of - why does it ignore subclasses within modules?
ActiveSupport provides a method Object.subclasses_of, to give the
subclasses of a given class. However, it ignores any subclass within
a module, so :
class A
end
class B < A
end
Object.subclasses_of(A) # returns [B]
module C
class D < A
end
end
Object.subclasses_of(A) # returns [B], even though C::D is also a subclass of A
class E < C::D
end
Object.subclasses_of(A) # returns
2009 Jun 19
0
ActiveRecord - Joined subclasses possible?
Hi all, I''m thinking about making the switch to RoR for one of my
projects. I''m trying to figure out if ActiveRecord can handle one of
my inheritance hierarchies before I do.
I have a more detailed question up on stackoverflow: http://snurl.com/kg89x
Is this possible? Thoughts?
2011 Jul 14
0
subclasses with inherited_resources?
I''m trying out inherited_resources and so far so good. However, one
problem I''ve run into is that it''s very difficult to customize
inherited_resource behaviour in subclasses. Looking through the
source I see it uses things like undef_method and class_attribute.
For example, if I have the following controllers:
class ItemsController
inherit_resources
actions :new,
2004 May 26
0
[LLVMdev] Changes in llvm::Instruction and subclasses
This should not affect current code but it may help people who deal with
LLVM instructions. Up till now one could create an llvm::Instruction
(and subclasses) using the following constructor:
Instruction(const Type *Ty, unsigned iType, const std::string &Name ="",
Instruction *InsertBefore = 0);
If InsertBefore was specified the instruction was added to the basic
block
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
2016 Apr 19
0
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
Right, the methods package is not attached by default when running R
with Rscript. We should probably remove that special case, as it
mostly just leads to confusion, but that won't happen immediately.
For now, the S4_extends() should probably throw an error when the
methods namespace is not loaded. And the check should be changed to
directly check whether R_MethodsNamespace has been set to
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
2016 Apr 19
0
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
Not sure why R_has_methods_attached() exists. Maybe Martin could shed
some light on that.
On Mon, Apr 18, 2016 at 11:50 PM, Kirill M?ller
<kirill.mueller at ivt.baug.ethz.ch> wrote:
> Thanks for looking into it, your approach sounds good to me. See also
> R_has_methods_attached()
>
2007 Feb 18
1
namespaces in subclasses
I have several modules that I store in rails_root/lib and that are
used by my controllers. I''m having a problem accessing AR objects
from inside a class that is a subclass. I keep getting a NameError
when trying to do something like Foo.find(), where Foo is an AR
object.
uninitialized constant
OpenTransact::Gateway::Request::CreditCardCharge::PaymentAccount
(NameError)
For some reason
2011 Oct 18
0
[LLVMdev] Question about MCExpr and subclasses
That just means the ELF writer doesn't know yet how to deal with the target-specific data. It needs taught how to map them onto relocations and such.
Do you really need to subclass MCTargetExpr? That's ordinarily only for operands that aren't representable via the normal MC stuff (for example, the ARM movw/movt relocations). You should be able represent normal symbol operands w/o
2006 Mar 01
4
STI, subclasses and callbacks
I have a STI class tree. I want to set some default values (calculated
values so I can''t set it in the database as defaults) on every created
instance regardless of what subclass is actually instantiated. So I
figured adding a after_create callback in the top class in the hierarchy
should do the trick. It seems it doesn''t get called :(
Code:
class SuperClass <
2010 Oct 20
2
new.env does not recognize parents from subclasses of "environment"
Dear Developers,
A lot has been changed in the R12.0 with respect to behavior of "environment"
subclasses. Many thanks for that.
One small irregularity, though; new.env does not allow the parent to be from S4
subclass.
> setClass("myenv", contains="environment")
[1] "myenv"
> new.env(parent=new("myenv"))
Error in new.env(parent =