Displaying 20 results from an estimated 1000 matches similar to: "ActiveRecord gotcha with references?"
2006 Jan 09
3
Include with two references of one model of the same table
Hey guys,
I just came across this oddity, not sure what to make of it yet, but
I think it might be incorrect behavior. When doing a @inst.find(:all,
:include => ["hometeam", "awayteam"] ...) hometeam and awayteam are two
references from a belongs_to that is of the same model and of the same
table. I will get a pgerror stating that "matches", which is
2006 Feb 23
4
MySQL Duplicate Key Error
I am a newbie and I am running into a problem which I cant understand. I
have a table called ''privileges'' which has the following fields
CREATE TABLE `sdqualplanner`.`privileges` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(20) NOT NULL default '''',
`description` varchar(100) NOT NULL default '''',
`section_id`
2006 Jan 18
3
retrieving value from select
In my view, I have:
<%= select("division_filter", "division_id", Division.find_all.collect
{|p| [ p.division, p.id ] }, { :include_blank => true }) %>
How do I retrieve the division_id in my controller?
--
Posted via http://www.ruby-forum.com/.
2006 Jul 14
8
CAS Authentication filter.
Hi
CAS is a centralized authentication service, and the cas_auth filter can
be installed to automatically make your web application authenticate
against a CAS server. The SVN path to the plugin is
http://svn.ki.se/rails/plugins/cas_auth
and a homepage with some information can be found at
http://opensource.ki.se/casauth.html
For use, just install the plugin in your application and set
2006 Aug 06
6
Having Problem w/ Agile Web Development book
I get this error ...
NoMethodError in StoreController#index
undefined method `salable_items'' for Product:Class
and here is my store_controller.rb ...
class StoreController < ApplicationController
def index
@products = Product.salable_items
end
def self.salable_items
find(:all, :conditions => "date_available <= now()", :order =>
"date_available
2006 Jul 21
4
Autocompleting InPlaceEditor
Hi,
I''ve created some extensions to script.aculo.us InPlaceEditor, allowing
the use of either server-driven, or local autocompletion. I''ve also
created new helper methods in Rails for this functionality.
My question is, is there any interest that I package this and make it
available as a plugin, or something like that?
Regards
--
Ola Bini (http://ola-bini.blogspot.com)
2006 Feb 07
1
Error undefined method `of_caller'' for Binding:Class
Hi all,
I have the following helper method:
def collapsible_fragment(collapsed, &block)
html = ''<div>''
html << capture(&block) if( block_given? && !collapsed)
html << ''</div>''
Binding.of_caller do |binding|
concat(html, binding)
end
2007 Dec 28
1
JtestR 0.1 released
JtestR allows you to test your Java code with Ruby frameworks.
Homepage: http://jtestr.codehaus.org
Download: http://dist.codehaus.org/jtestr
JtestR 0.1 is the first public release of the JtestR testing tool.
JtestR integrates JRuby with several Ruby frameworks to allow painless
testing of Java code, using RSpec, Test/Unit, dust and Mocha.
Features:
- Integrates with Ant and Maven
- Includes
2006 Aug 07
5
Store SOAP::RPC::Driver in user session throws TypeError
Hi All
I have a
requirement to consume a 3rd party web service from my Rails
application. I am doing this
in my action
require ''soap/wsdlDriver''
factory = SOAP::WSDLDriverFactory.new(TRANSIDIOM_WSDL_URL)
soap = factory.create_rpc_driver
soap.wiredump_file_base="#{RAILS_ROOT}/log/transidiom.log"
param = %(<Request
2006 Jul 14
4
sending additional parameters to before_filter
i am trying to create a system so that different users have different
priviliges on my application. i was going to modify my authorize
function so that i could pass the required role to it and have it check
the current user for that role.
i am using before_filter and would like to have just one function
instead of writing one for each role like so:
authorize(role)
instead of:
2007 Apr 11
1
Does Ruby 1.8.6 fix the Breakpointer problem?
Hello,
Does anyone here know if Ruby 1.8.6 fixes the "BreakPointer" problem in
Rails? The reason I ask is that I have been working with Curt Hibb''s
InstantRails in Window (at last I have found a usable Rails system on
Windows). Currently, I am on InstantRails 1.6, but Curt has made
available InstantRails 1.7 which has the following components:
Instant Rails 1.7 contains the
2006 Aug 03
3
Swedish Rails
I would like to announce my plugin Swedish Rails.
Rails provide many goodies and helpers for you, but some of these are
dependant on your user interface being in english. Date controls, for
example. Pluralization is another. And have you ever tried to capitalize
a string with Swedish letters in them? Then you know it doesn''t work
that well. Until now, that is. You install this
2010 May 06
1
question about rolling regressions
Hi All,
I am using R 2.11.0 on a Ubuntu machine. I have a time series data set and
want to run rolling regressions with it. Any suggestions would be useful.
Here are the details:
(1) I convert relevant variables into time series objects and compute first
differences:
vad <- ts(data$ALLGVA/data$GDPDEF, start=1948, frequency=1)
emp <- ts(data$ALLEMP, start=1948, frequency=1)
vad.dif1 <-
2006 Jul 14
2
Configuration search order
Hi
I''m in the process of deciding how a plugin should be designed to make
configuration as easy as possible. Right now I require the plugin from
init.rb, and set some configuration options (as class attribute
accessors) from environment.rb. Then I tried setting these from
environments/development.rb instead, and to my surprise this didn''t
work. It said the class in question
2006 Aug 16
4
Plugins and svn
Hi railers,
What do you do when you must use a plugin in a rails app that is under
subversion?
I think that an approach is simply install a version of the plugin, and once
all the test pass, commit the plugin itself to the repository, inside the
/vendor/ of the app. If a new version of the plugin is released, your app is
still using the working one (although the new version could work too).
2009 Jan 21
0
trouble switching to 'plm' from 'xtabond' and Stata
Hello,
I am switching to R from Stata and I am having particular trouble with
the transition from Stata's 'xtabond' and 'ivreg' commands to the
"plm" package. I am trying to replicate some of the dynamic panel data
work using the UK Employment data in Arellano and Bond (1991) and
available as 'EmplUK' under the 'plm' package.
I have been
2009 Nov 27
1
problem with "dynformula" from "plm" package [RE-POST]
Hello list,
I'm following the paper (http://www.jstatsoft.org/v27/i02/paper) on
how to use "plm" to run panel regressions, and am having trouble with
what I believe should be something very basic.
When I run the command (p.9 in the paper):
R>
dynformula(emp~wage+capital,log=list(capital=FALSE,TRUE),lag=list(emp=2,c(2,3)),diff=list(FALSE,capital=TRUE))
I see:
emp ~ wage +
2010 Jan 25
3
Issue using tapply
Hello all,
I am trying to use the tapply function to sum some values and change the
column names of the resulting vector.
I input
Emp Et
1 10565 ACC
2 7515 ADM
3 625 AGF
4 6243 CNS
5 12721 EDU
6 3924 FIN
7 18140 HLH
8 3686 INF
9 15841 MFG
10 243 MIN
11 1864 MNG
12 4664 OSV
13 5496 PRF
14 4988 PUB
15 2166 REC
16 2153 REL
17 16082 RTL
18 3582 TRN
19 757 UTL
20
2006 Jul 22
1
InPlaceEditor with Autocompletion
Hi
Rails AJAX controls are very handy, and the InPlaceEditor is probably
one of the easiest and most neat of them all. But, it doesn''t do
autocompletion. I''ve rectified that situation. The plugin provides a few
new helpers and a new JavaScript-file that extends the
Ajax.InPlaceEditor with local and remote Autocompletion features. So,
just install the plugin, include the
2009 Mar 30
0
pgmm (Blundell-Bond) sample needed)
Dear Ivo, dear list,
(see: Message: 70
Date: Thu, 26 Mar 2009 21:39:19 +0000
From: ivowel at gmail.com
Subject: [R] pgmm (Blundell-Bond) sample needed)
I think I finally figured out how to replicate your supersimple GMM
example with pgmm() so as to get the very same results as Stata.
Having no other regressors in the formula initially drove me crazy. This was a case where simpler models are