similar to: Newbie question: How to reference models in subdirectories

Displaying 20 results from an estimated 4000 matches similar to: "Newbie question: How to reference models in subdirectories"

2012 Feb 02
3
MVC questions with rails
2006 Nov 17
6
RESTful routes and resulting urls
if I have the following in my routes.rb: map.resources :product_categories it provides urls such as: /product_categories /product_categories/1 /product_categories/1;edit etc. and uses the ProductCategories controller. how can I keep the same controller (and model) but set up the resources so that I can have any abitrary url point to the existing controller, much like specifying the controller
2011 Apr 09
1
How do I make this faster?
I was on vacation the last week and wrote some code to run a 500-day correlation between the Nasdaq tracking stock (QQQ) and 191 currency pairs for 500 days. The initial run took 9 hours(!) and I'd like to make it faster. So, I'm including my code below, in hopes that somebody will be able to figure out how to make it faster, either through parallelisation, or by making changes. I've
2008 May 08
1
Eager loading of association extensions
Hello all, Is it possible to do eager loading of association extensions? That is, the following code produces one SQL query: cat = ProductCategory.find(:first, :include => :pricing_rules) cat.pricing_rules But if in ProductCategory I have an association extension like this: has_many :pricing_rules do def applicable() find(:all).select(&:applicable?) end end the
2006 Mar 25
4
Rails PayPal and Currencies other than USD
Has anyone been able to make direct API calls to PayPal in currencies other than USD? I get an error message "The currency code submitted is not supported. Check the currency code and try again." I''m using the PayPal plugin for Rails. I can successfully transact in USD, but not AUD (Australian Dollars). Cheers, Dan
2006 Mar 03
1
number_to_currency() helper == non DRY == could be improved
Hi all, Apologies in advance if I got this one wrong, I''m still just a newbie ;-) Going through the Apple ADC RoR tutorial it suddenly occurred to me that the ''number_to_currency()'' helper method was not DRY streamlined. Scenario:: The "number_to_currency()" methods options hash works great when I need to dynamically display different currencies when I
2011 Jan 07
1
Currency return calculations
Dear sir, I am extremely sorry for messing up the logic asking for help w.r.t. my earlier mails   I have tried to explain below what I am looking for.     I have a database (say, currency_rates) storing datewise currency exchange rates with some base currency XYZ.   currency_rates <- data.frame(date = c("12/31/2010", "12/30/2010", "12/29/2010",
2011 Jan 07
0
Odp: Currency return calculations
My mistake sir. I was literally engrossed in my stupid logic, and while doing so, overlooked the simple and very effective solution you had offered. Sorry once again sir and will certainly try to be very careful in future. Thanks again and have a great weekend sir. Regards Amelia --- On Fri, 7/1/11, Petr PIKAL <petr.pikal@precheza.cz> wrote: From: Petr PIKAL
2007 Nov 05
6
Strange wildcard problem
Hi, Apologies for reposting this for those who read this via ruby-forum, but it didn''t make it to the list before, and the list seems more active... I''m using ferret (via acts_as_ferret) in a somewhat unorthodox manner and am having a strange wildcard problem. Before anyone wonders why we''re doing things this way, the answer is basically that it lets us
2013 Apr 03
4
Better way of writing R code
Dear R forum, (Pl note this is not a finance problem) I have two data.frames as currency_df = data.frame(current_date = c("3/4/2013", "3/4/2013", "3/4/2013", "3/4/2013"), issue_date = c("27/11/2012", "9/12/2012", "14/01/2013", "28/02/2013"), maturity_date = c("27/04/2013", "3/5/2013",
2013 Apr 25
1
Linear Interpolation : Missing rates
Dear R forum I have data.frame as df = data.frame(rate_name = c("USD_1w", "USD_1w", "USD_1w", "USD_1w", "USD_1m", "USD_1m", "USD_1m", "USD_1m", "USD_2m", "USD_2m", "USD_2m", "USD_2m",  "GBP_1w", "GBP_1w", "GBP_1w", "GBP_1w",
2014 Apr 16
0
[XPOST] Invoicing - 1.0.0 released
Hello people, We have released invoicing gem which helps you in creating, managing and generating pdf for invoices. Bit of background: Invoicing gem was initially developed by Martin Kleppmann (https://github.com/ept/) for generating and displaying invoices. This release polishes the gem, makes it compatible with rails 3 and rails 4, adds pdf generation source:
2009 Oct 14
3
currency conversion function?
Dear all Is there any R function that would perform currency conversion using up-to-date exchange rates? I would be looking for a function that allows to download recent exchange rates (say, from Yahoo!) and then use these in converting currencies (say, USD to EUR). I am not sure whether r-sig-finance would be more appropriate, but the (off-)topic feels general enough to me. Thank you Liviu --
2006 Sep 17
2
currency or stock trading strategy
Hi, are there any good charting and analysis tools for use with currencies, stocks, etc. in R? I have some tools to download currency data from the NYFRB using python and XML. Can we get and parse an XML download using R? Can we have interaction in R plots? Does anyone use R for back-testing trading strategies? Are there any forums for discussion of using R for this specific purpose (apart
2006 Feb 28
12
Examples for Money library ?
Can anybody share some examples of their Money implementation ? I''m trying to setup a Model to use this library, but can''t seem to wrap my head around how it is exactly supposed to work. My Model (Foo) looks like: =============== composed_of :commission, :class_name => "Money", :mapping => [ %w(commission_cents cents), %w(commission_currency currency) ] Yet, in
2006 Jun 26
5
How can I dynamiclly generate models?
I am trying to write a plugin, ''acts_as_commentable'', for my models - Image, Book, Music and so on, I do not want to use polymorphic association, so very model should have its own comment class. Here is my code acts_as_commentable.rb module Commentable def self.included(base) base.extend(ClassMethods) end module ClassMethods def
2010 Jun 10
1
RSpec 2: uninitialized constant - mocking belongs_to AR relation
gems/ruby-1.9.2-head/bundler/gems/rspec- core-2398fcadf5beb256bed9c548c59445d3b4c8a047-master/lib/rspec/core/ backward_compatibility.rb:26:in `const_missing'': uninitialized constant Message::User (NameError) from /Users/kristianconsult/.rvm/gems/ruby-1.9.2-head/bundler/gems/ rspec-expectations-996c752171a0a0e16347e934dadc25767e31186c-master/lib/
2002 Feb 09
1
How to access objects outside an R function
Dear R-Users, I have a dataframe (''forexdata'') of daily returns from the foreign exchange market for three currencies - British Pound (bp), Canadian Dollar(cd), Deustche Mark (dm) vis-a-vis the US Dollar and the Date Of Trade(yymmdd). For some dates the returns are missing (recorded as zero) as there were no trades in that currency for that date. My task is to substitute the
2005 Aug 19
13
Enumerations (again): Comments please
Some of my earlier questions may have hinted ever so slightly in the direction that I''m trying to implement "enumerations". By an enumeration here I mean a class that has a fixed number of immutable instances, which in turn have essentially only a name and a position. Requirements I''ve tried to meet are - Enumeration instances should only be loaded once from the
2002 Jul 03
0
SAVE MY SOUL
ATTN: CHAIRMAN/CEO DEAR SIR, HOW ARE YOU AND YOUR FAMILY? HOPE FINE. HOW IS YOUR BUSINESS? HOPE EVERYTHING IS VERY GOOD. I AM MRS MARIAM ABACHA, THE WIDOW OF THE LATE GEN. SANI ABACHA WHO WAS THE FORMER NIGERIAN PRESIDENT AND WHO DIED RECENTLY IN OFFICE AS A RESULT OF CARDIAC ARREST. SINCE THE DEATH OF MY HUSBAND MY FAMILY HAS BEEN UNDER RESTRICTION OF MOVEMENT AND OUR BANK