Displaying 20 results from an estimated 27 matches for "base_classes".
Did you mean:
base_class
2011 Apr 05
1
Why does AR use base_class for polymorphic relationship "type"
I have a couple models that inherit from a base class that then
inherits from AR.
When they are used in a polymorphic relationship the "type" is always
the base class.
Just curious if anyone has a reason why it doesn''t use the *actual*
class rather then the base_class. I have patched AR to use the actual
class if !base_class.table_exists? but it adds another query each time
2006 Mar 20
3
help: acts_as_versioned setup error "undefined local variable or method ''base_class''"
Hi All,
Rails newbie here trying to set up acts_as_versioned according to Chapter 14
in the Rails Recipies book. I''ve taken the following steps (nearly
verbatim) as mentioned by the book:
- created the target model "Post"
- added the "acts_as_versioned" label to the model file
- generated a migration file
- added the table creation code and the command
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,
2007 Nov 20
2
Plugin: create instance methods dynamically in ClassMethods?
Hi all
I have the following plugin code:
module IncenseCrud
def self.included(base_class)
base_class.extend(ClassMethods)
end
module ClassMethods
def performs_incense_crud
def index
list
return render(:action => ''list'')
end
end
end
end
In init.rb I have the following:
require File.dirname(__FILE__) +
2006 Mar 28
12
cached-model broken with Rails 1.1
It looks like cached-model is broken again under rails 1.1. Can anyone
confirm? Note that the exception below indicates it''s trying to treat
CachedModel as the class name of the model, rather than using the proper
class name (which is Entry in this case, and the table called entries).
This is a model using Single Table Inheritance and acts_as_tree, and
worked just fine under 1.0 and
2011 May 23
0
Fallback for partial_paths on rendering process
Hi, I have an application that uses single table inheritance.
Very simple stuff:
class Place < ActiveRecord::Base
class City < Place
lets say I have a City on the @place
whenever I try using the
render @place
I will get an error, saying the templace cities/city doesn''t exist
but I do have a places/place template.
Is the any nice way to add this fallback for the base_class
2011 Oct 06
4
[LLVMdev] TableGen and Greenspun
greened at obbligato.org (David A. Greene) writes:
> The problem I solved via multidefs was this: how does one write a set of
> Pat<> patterns in a generic way?
>
> For example, I want to be able to do this:
>
> defm MOVH :
> vs1x_fps_binary_vv_node_rmonly<
> 0x16, "movh", undef, 0,
> // rr
> [(undef)],
>
2006 Jul 15
2
FieldQuery not returning anything
Hey ..
The QueryParser RDoc page explains to me on how to search for a specific
value in a specific field. This is not working the way i thought it
should be, what am i doing wrong? Here''s an example ..
I''m storing model data in the index like this:
doc << Field.new( "object_id", object.id, Field::Store::YES)
doc << Field.new( "type",
2011 Oct 06
1
[LLVMdev] TableGen For Loops
greened at obbligato.org (David A. Greene) writes:
> So here's why I think the for loop proposal can't be a preprocessing
> phase. Down in the guts of this I fundamentally need to be able to do
> this:
>
> multiclass blah<list<int> Values> {
> for v = Values {
> def DEF#v : base_class<v>;
> }
> }
>
> Will that work? Is the for
2007 Jun 04
1
acts_as_rateable in Beast
I''m trying to implement acts_as_rateable to my Beast installation to
give users the option to rate posts (like reddit). I chose
acts_as_rateable as it supposedly easily allows reddit-type voting but
I''m having some problems setting it up and the documentation seems
outdated.
(http://www.juixe.com/techknow/index.php/2006/07/05/acts-as-rateable-plugin/)
So far, I''ve
2006 Dec 28
2
STI, controllers and views
Hello,
I have set up that uses single table inheritance. I have a number of
model subclasses following the example in AWDWR that uses Manager <
Employee < Person.
First question. Do I need to create controller classes for each? I
don''t think I do because a single controller should be able to shunt the
data between the models and the views.
Second question. Say I have a view
2016 Mar 26
2
DW_TAG_member extends beyond the bounds error on Linux
...anager *) tm = 0x00007fd133cfb570
I suspect each one may be different root cause. I was able to capture one
callstack of a small repro:
Breakpoint 1, DWARFASTParserClang::ParseChildMembers (this=0x8c4520,
sc=..., parent_die=..., class_clang_type=...,
class_language=lldb::eLanguageTypeUnknown,
base_classes=..., member_accessibilities=..., member_function_dies=...,
delayed_properties=...,
default_accessibility=@0x7ffdf3888cac: lldb::eAccessPublic,
is_a_class=@0x7ffdf3888cab: false, layout_info=...)
at
/home/engshare/third-party2/lldb/3.8.0.rc3/src/llvm/tools/lldb/source/Plugins/SymbolFile/DWAR...
2016 Mar 27
0
DW_TAG_member extends beyond the bounds error on Linux
...> I suspect each one may be different root cause. I was able to capture one
> callstack of a small repro:
>
> Breakpoint 1, DWARFASTParserClang::ParseChildMembers (this=0x8c4520,
> sc=..., parent_die=..., class_clang_type=...,
> class_language=lldb::eLanguageTypeUnknown,
> base_classes=..., member_accessibilities=...,
> member_function_dies=..., delayed_properties=...,
> default_accessibility=@0x7ffdf3888cac: lldb::eAccessPublic,
> is_a_class=@0x7ffdf3888cab: false, layout_info=...)
> at
> /home/engshare/third-party2/lldb/3.8.0.rc3/src/llvm/tools/lldb/sourc...
2016 Mar 27
1
DW_TAG_member extends beyond the bounds error on Linux
...may be different root cause. I was able to capture one
>> callstack of a small repro:
>>
>> Breakpoint 1, DWARFASTParserClang::ParseChildMembers (this=0x8c4520,
>> sc=..., parent_die=..., class_clang_type=...,
>> class_language=lldb::eLanguageTypeUnknown,
>> base_classes=..., member_accessibilities=...,
>> member_function_dies=..., delayed_properties=...,
>> default_accessibility=@0x7ffdf3888cac: lldb::eAccessPublic,
>> is_a_class=@0x7ffdf3888cab: false, layout_info=...)
>> at
>> /home/engshare/third-party2/lldb/3.8.0.rc3/src/l...
2011 Oct 06
0
[LLVMdev] TableGen For Loops
On Oct 6, 2011, at 10:25 AM, David A. Greene wrote:
> greened at obbligato.org (David A. Greene) writes:
>
>> So here's why I think the for loop proposal can't be a preprocessing
>> phase. Down in the guts of this I fundamentally need to be able to do
>> this:
>>
>> multiclass blah<list<int> Values> {
>> for v = Values {
>>
2008 Apr 11
1
polymorphic associations wrong when used with inherited class?
Consider the following:
class Event
belongs_to :event_object, :polymorphic => true
end
class Asset < ActiveRecord::Base
end
class EventedAsset < Asset
has_one :event, :as => :event_object
end
EventedAsset.find(:first).event generates the following SQL:
SELECT * FROM `events` WHERE (events.event_object_id = 1 AND
events.event_object_type = ''Asset'') LIMIT 1
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.
2012 Mar 22
1
why doesn't .where() honor polymorphism?
I love the query interface (ActiveMethod::QueryMethods), but one thing
has bugged me: why doesn''t it generate calls for polymorphic
associations? For example:
class MyModel < ActiveRecord::Base
belongs_to :parent, :polymorphic => true
end
I would expect:
MyModel.where(:parent => a)
to be equivalent to:
MyModel.where("my_models.parent_id = ? AND
2016 Mar 27
0
DW_TAG_member extends beyond the bounds error on Linux
...ause. I was able to capture
>>> one callstack of a small repro:
>>>
>>> Breakpoint 1, DWARFASTParserClang::ParseChildMembers (this=0x8c4520,
>>> sc=..., parent_die=..., class_clang_type=...,
>>> class_language=lldb::eLanguageTypeUnknown,
>>> base_classes=..., member_accessibilities=...,
>>> member_function_dies=..., delayed_properties=...,
>>> default_accessibility=@0x7ffdf3888cac: lldb::eAccessPublic,
>>> is_a_class=@0x7ffdf3888cab: false, layout_info=...)
>>> at
>>> /home/engshare/third-party2/...
2006 Jul 05
2
Serialized object behaves weird
Hi!
I got a class named EinsatzFilter which I serialized to session. Before
saving to session it works afterwards I keep getting the message:
"undefined method `to_s'' for #<Person:0x38c6ab8>". "Person" is a from
ActiveRecord::Base inherited class.
Code:
class EinsatzFilter
include ApplicationHelper
attr_reader :personen, :monat, :projekte, :kunde