Displaying 20 results from an estimated 7000 matches similar to: "ActiveRecord::Base::find_for_create_modify"
2006 May 17
6
ActiveRecord#to_param
Hello,
to implement some some kind of optimistic locking, I want to build a
view, where an object is displayed together with a link containing the
data of the displayed object. My first try looked something like
<%= object.object_discription %>
<%= link_to "action", :action => "take_action", :data => object %>
this won''t work because object is of
2006 Jul 04
1
How to override ActiveRecord#base#destroy
Hello,
I have a database table with a primary key not being a simple id but
three columns. By overriding update() and create() I got Rails to work
with that table quit good. Except for the destroy() action. From the
resulting trace I can see that the old version of destroy() is called
from transaction.rb. I think this lines might be the reason that I''m
unable to override detroy():
2006 Jun 27
3
Weird ActiveRecord Foreign Key Problem
Hello to all,
I ran into a weird problem with an ActivRecord. I have a table named
"build_order" with a column named "type" that is a foreign key to a
table called "building_type". In a controller I try to read all the
build_orders with "BuildOrder.find :all" and get the following error and
stack trace:
(eval):1:in `instance_eval'': compile
2006 Apr 04
4
Maintaining and securing the "Perfect Rails/Debian/Lighttpd Stack"
Hi there
I''m planning to build "The Perfect Rails/Debian/Lighttpd Stack",
published by Ezra Zygmuntowicz and Sean Schertell at
http://brainspl.at/rails_stack.html
I''m wondering what sort of constant maintanance that setup would
incur. What actions have be regularly performed to keep this setup
healthy and secure under normal conditions?
Alder
2006 May 10
2
Exploring ActiveRecord::Base#serialize
Hi
I was recently taught about the useful ActiveRecord::Base#serialize.
It''s very useful for persisting arbitrary objects through the regular
database. For example, say you want to store a Set of all the years a
Convention took place. You do:
class Convention < ActiveRecord::Base
serialize :years, Set
end
This effectively creates a Convention#years attribute, which is a set:
you
2006 Jul 21
2
File.open behavior for ActiveRecord, to ensure save after manipulation?
File.open in core Ruby is nifty, in that it automagically closes the
file when you''re done using/manipulating it. I''m wondering whether
there''s something like that for ActiveRecord?
So you can do:
AR.find(23).open {|ar|
ar.foo = ''bar''
...
}
And ar.save would be called when the block closes.
--
-Alder
2009 Aug 07
2
create separate plots by factors
Hello,
I am attempting to create several plots based on "site" (~300 total)
and am having trouble with the code. I simply want to create a plot
using the code, plot(year, peak), for the following dataset. I would
like for each site to be plotted on a separate page and the plots
saved in a directory. Would a "foreach" loop work? I tried a "by"
statement, but
2006 Jun 09
18
Is IRB the ruby console ?
I''m running script/console but keep getting the message that irb.bat is not
recognized as an internal or external command, operable program or batch
file.
If it means anything I am running instant rails. I can invoke irb straight
forward.
TIA
Stuart
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 May 18
7
Ruby Before Rails
As I, like many people, are coming to ruby in the rails era, I''m curious
about how Ruby Web Dev was done prior to rails. Any veterans want to
share their insights?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060518/20cde24d/attachment.html
2006 Jul 22
2
How to SELECT from multiple talbes with AR#find and associations?
So I want to SELECT from multiple tables, so as to be able to do
"SELECT FROM foo, bar WHERE foo.id=bar.id AND bar.baz=23".
How do I do it with AR#find?
Also, I need this for associations. has_many et. al. have :finder_sql,
which is nice, but feels like a Pyrrhic: it''s basically doing the
association in pure SQL, defeating the purpose of AR.
--
-Alder
2006 May 18
4
How do you delete a session variable?
Hi
Let''s say we set session[:foo] = ''bar''. Now we want to remove the :foo
key completely. How do you do that?
Appearantly, session is a CGI::Session [1] instance, so it doesn''t
have #delete like Hash. I tried:
session[:foo] = nil
But then debug(session) shows an empty :foo key. I''d like to remove
that key, as my session is already pretty crowded. Is
2006 May 15
3
Are the hashes faster than activerecord finds ?
Hello, I need to store somewhere one hundred of static ressources text
field (internationalization).
I wonder if it better to put them in a database or in a hash defined at
app startup (in environment.rb)
I would go to the second one, but am I right ?
Thanks
--
Posted via http://www.ruby-forum.com/.
2006 Mar 24
10
Running Rails tasks by schedule, instead of an HTTP request.
Hi there
I''m considering Rails for a new web-application planned to be built
from scratch.
The application has an extensive web front, and in fact most of the
application is interfaced through that front and engaged through
clients'' HTTP requests (i.e. the conventional way web-applications and
"dynamic web-sites" work). However, some essential parts are supposed
to
2006 May 06
3
Storing additional data on join tables with Rails
Hi there
I need to store additional attributes on join table. Searching the
Wiki [1] revealed two possible methods:
1) push_with_attributes, as described by Justin Palmer [2].
Unfortunately, "this method is now deprecated" [3]. Even if it wasn''t,
there seem to be inherent problems with that approach, for example
with updating those additional attributes, though Joshua Muheim
2006 May 17
6
White Screen of Death
Hello, I''ve heard these words to describe a RoR application returning an
empty page.
This happen from time to time even here, in the forum.
That is the cause of this misbehaviour ? Is it related with something
external to RoR itself ?
What is the solution to avoid the WSOD ?
--
Posted via http://www.ruby-forum.com/.
2006 May 13
8
Which Linux flavor for a Rails server?
Hi folks,
I''m a linux noob, and I''m trying to pick a distro for my rails server. I
don''t want to start a flame-war about linux distros! I''m interested in the
best distribution for these criteria:
1 - Simplicity of getting ruby and rails set-up (gem updates)
2 - Stability (it is a server, after all)
3 - Support resources (community, and as a fall-back, paid
2006 Apr 18
11
Which database to choose for a new Rails application - MySQL 4.1 or 5.0?
Hi
I''m choosing a database for a new Rails application. I pretty much
ruled out PostgreSQL, since despite good reviews of the database
itself, it seems it has countless issues with Rails (for example: in
recent releases migrations don''t work, and unit-tests fail).
So I should now choose between MySQL 4.1, which as I understand enjoys
widespread popularity - perhaps the most
2006 Jul 22
10
Non English characters
Hi folks,
Does anyone know how to tackle Swedish letters in Rails. Am I
completely off track in thinking that it should be done using map or
regex in some clever way?
Bealach
2006 Jun 08
5
How to find particular pattern in string?
Hi,
In my application I want to find out the occurance of substring
"http:\\" in the main string "http:\\www.abc.com"
Here how to find out whether substring "http:\\" is present in my
String?
& if substring "http:\\" is present then I want to delete it from main
string.
How to do this?
PLs help me.
Thanx in advance.
Prash
--
Posted via
2006 Jun 14
13
Undefined method
I really hope this is not a bad question (as in he''s abusing the
list). However I could use a little direction (even though I''m
reading books, tutorials)
Right now I''m getting a
undefined method `category'' for 4:Fixnum
The specific lines from the rhtml file are:
<td><%= link_to position.category_id.category, :action => "show", :id
=>