similar to: How to organize models into modules

Displaying 20 results from an estimated 30000 matches similar to: "How to organize models into modules"

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
2015 May 30
2
[LLVMdev] Linking modules across contexts crashes
I get a crash when I try to link multiple modules registered in their individual contexts. Documentation for Linker::LinkModules doesn't mention anything about contexts, and the first link succeeds. But the second link crashes. Is this not the right way to merge such modules? If not, then what is the right way? In any case, documentation for Linker::LinkModules should say if contexts are
2015 Jun 01
2
[LLVMdev] Linking modules across contexts crashes
> On 2015-Jun-01, at 11:06, Reid Kleckner <rnk at google.com> wrote: > > I'm pretty sure module linking is expected to occur in the same LLVM context. Correct. > IIRC Duncan had some proposal for how ld64 could do something clever with multiple contexts, but I've totally forgotten what it was. This was for LTO (probably unrelated to Yuri's scenario?). 1.
2005 Apr 24
2
Model names in controllers
Please excuse yet another newbie question... I''m getting this error: MissingSourceFile in <controller not set>#<action not set> c:/program files/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/dependencies.rb:75:in `require_dependencies'': Missing model MyModel.rb From these lines of code: class MyModelController < ApplicationController
2011 Aug 01
3
Class inheritance or virtual resources to manage apache modules
I want to start out with an apache class that will disable all modules except for a pre-defined list, thus establishing a baseline of active modules. Then as needed, other classes could enable a module that they require that would have been disabled by the baseline state. Its possible several classes may try to enable the same module (1 or more classes needing module1 could be on a single node)
2006 Jan 06
2
How do I reference eagerly loaded Models in the View?
[I hope the repost isnt'' "minded". Following the advice of another thread I''ve changed the subject to a question. If I haven''t included important info, please ask. My database is being unduly killed. Jodi] Cheers on-the-Rails-ers, Before I start, I''ve read the ActiveRecord docs on eager loading, but for the life of me, I can''t seem to get
2006 Jan 05
0
Keep the Queries Down or "Referencing eagerly loaded models"
Before I start, I''ve read the ActiveRecord docs on eager loading, but for the life of me, I can''t seem to get it working. What I mean by this, is that the eager query looks good (I can paste the sql dump, but it looks good to me - and runs well independantly), but it seems that I''m referencing the eagerly loaded data in a way that activerecord doesn''t
2006 Apr 07
2
ActiveRecord find all based on array -- need ids from array
Does anyone know if it is possible to perform an ActiveRecord find by passing in an array? I would like to be able to do the following: MyModel.find(:all, :conditions => ["user_id in (?)", users]) The problem I run into is that the returned SQL contains the to_s() output of the User object, not the ids of those users. Is it possible to change this behavior? I attempted to
2008 Jul 14
1
will_paginate paginates all instead of subclass
I''m still a newb but having fun - Any help on this problem will be much appreciated. I have mymodel Call.rb class Call < ActiveRecord::Base belongs_to :user has_many:visits, :dependent => :destroy has_many:visits do def latest find :all, :order => ''id DESC'', :limit => 3 end def all_latest find
2007 Jan 17
0
Models and Modules and subclassing, oh my!
So, our application has a large number of models at this point, and I''m getting a bit worried about people having to use long names, as well as clashes in the global namespace. More recently I wanted to add a new table with some STI subclasses of that table... module Portal end class Portal::Base < ActiveRecord::Base belongs_to :widget end However, Widget is a top level class,
2008 Apr 17
1
How to extract vectors from an arima() object and into a data frame?
This should be very easy, but alas, I'm very new to R. My end goal is to calculate p-values from arima(). Let's say I just ran this: > MyModel <- arima(y[1:58], order=c(1,0,0), xreg=MyData[1:58,7:14], > method="ML") > MyModel And I see: arima(x = y[1:58], order = c(1, 0, 0), xreg = MyData[1:58, 7:14], method = "ML") Coefficients: ar1
2008 Sep 12
1
Referencing exactly two models of the same kind
Hi, how do I solve this in Rails: Lets say I have a User and a Message. Now, a Message is sent from one User to another User, which means that in the Message I have to reference a User twice! This seems to be a problem, if I do not user one-to-many or many-to- many relationships, because it seems to me as if I could reference a Model of the same type only once. However, I would like the Message
2006 Mar 31
1
logging problem
Yep I tried those two options, and nothing... Even if the pre-user conf files have a log file in the same directory, which I touch before trying, messages keep going to syslog... I tried with 666 permissions on rsyncd.log too just to make sure... The following is one of the user's conf file, hope theres a clue. Thanks! log file = /home/pluto/rsyncd.log <<< This is the problem!!
2012 Dec 10
0
Managing windows agent
Hi all, I am new to puppet, and I am trying to manage a windows agent using puppet. I wrote a manifest file which will copy a text file from puppet master (linux) to the puppet agent(windows). When I tried to run the puppet agent, I was getting the following error. err: /Stage[main]/Module1/File[change-ip.bat]: Failed to generate additional resources using ''eval_generate: Error
2006 Jan 19
1
Model Validation & Floating Attributes
Hello all ! I have a model being validated that spits it''s error messages on the resulting page using: error_messages_for(:mymodel) .... Basic stuff. It''s working perfectly. Now, I have something else I want to check on the same page (that isn''t an attribute to the Model)... and am trying to add it using: @mymodel.errors.add_to_base("another error here")
2005 Aug 27
1
PLSR: model notation and reliabilities
I'm new in both R and statistics. I "did my homework", I tried the archives and whatever I managed to get from the sources, but still I need assistance with the plsr package. I have a model with 2 core determinants D1 and D2, made by 3 indicators each (D1a,D1b,D1c and so on). Also I have 2 moderating variables (m1,m2), where m1 moderates D1 and m2 modarates D2. The dependent
2013 May 21
1
Calculating AIC for the whole model in VAR
Hello! I am using package "VAR". I've fitted my model: mymodel<-VAR(mydata,myp,type="const") I can extract the Log Liklihood for THE WHOLE MODEL: logLik(mymodel) How could I calculate (other than manually) the corresponding Akaike Information Criterion (AIC)? I tried AIC - but it does not take mymodel: AIC(mymodel) # numeric(0) Thank you! -- Dimitri Liakhovitski
2004 Jun 07
1
rsync server complaining about vanishing files while they are not.
Greetings. I am running rsync 2.6.2 on both the server and the client. Server is Fedora Core 2 and client is Red Hat Linux 9. I am suffuring of the following errors on the server side: Jun 7 19:43:27 tux101 rsyncd[24906]: file has vanished: "redhat/9/en/os/i386/RedHat/RPMS/gtk2-engines-2.2.0-2.i386.rpm" (in module1) This messages repeats for a whole bunch of rpm files
2018 Jun 09
1
is "unintended library loading" actually possible?
Please, help me understand if 'use chroot' option in daemon config is secure enough. Rsync manual has following lines: As an additional safety feature, you can specify a dot-dir in the module's "path" to indicate the point where the chroot should occur.  This allows rsync to run in a chroot with a non-"/" path for the top of the transfer
2011 Feb 09
4
Modules being shared and model data
Have in a module in ./lib: module Pricing def sell_price (cost.to_f)/((100-(margn.to_f))/100) end def sell_price_inc ((product.cost.to_f)/((100-(product.margn.to_f))/100)*1.14) end def charge_excl (sell_price).to_f * quantity end end A model product: class Product < ActiveRecord::Base include Pricing attr_accessible :name, :code, :cost, :company_id, :margn