Displaying 20 results from an estimated 7000 matches similar to: "Magic field ''Status''"
2006 Apr 07
6
Magic Field Names - "position"
What does the Magic Field Name position do?
I was looking here:
http://wiki.rubyonrails.com/rails/pages/MagicFieldNames
And unfortunately that documentation is incomplete.
Thanks.
--
Posted via http://www.ruby-forum.com/.
2006 Mar 20
1
Running total of a field in child records
What is the best way to get the running total of a number field in child
records. Let say I have an Order model, which has_many :line_items, and each
LineItem has an amount field. I would like to get the grand total of a
specific Order. Is it a good idea to add a ''total'' column in the ''orders''
table and update it every time a line_item is
2006 May 03
1
nil.strip error While trying to post xml data over https.
I am trying to subit some xml data over https to access an API. My code
so far seems to generate a very non-helpful error in the guts of the
net/http library. This code produces a NoMethodError for nil.strip"
require ''net/http''
require ''net/https''
require ''uri''
url =
2006 Jun 12
2
on_update current_timestamp in Migrations
Is there any way to set database columns to auto update a timestamp
column on update?
Can I do something like
t.column "timestamp", :datetime, :default => :current_time, :null
=> false, :on_update => :current_timestamp
or do i need to just use custom sql like
sql = "ALTER TABLE `table` CHANGE `timestamp` `timestamp` TIMESTAMP ON
UPDATE CURRENT_TIMESTAMP NOT NULL
2006 Apr 27
7
SuperImage plugin
Greetings all,
This is the first release of the SuperImage plugin. The idea is you
upload images to the database, and then pull them out at any size you
want. Combine this with caching and it will stay light and fast.
More info and instructions are here:
http://beautifulpixel.textdriven.com/articles/2006/04/27/superimage-plugin-making-resizeable-uploaded-images-easy
svn:
2006 Apr 26
8
script/server lighttpd on Windows
Has anyone been able to get script/server to successfully use lighttpd
on a Windows box? When I try to start the server I get:
PROBLEM: Lighttpd is not available on your system (or not in your path)
So then I add "C:\lighttpd\sbin" to the path for the console session,
and it still fails with the same error.
If anyone has some success with this I sure would like to know. Webrick
2006 Apr 21
8
Stop Models auto loading
Is there a way to stop Rails automatically trying to load models?
Cheers,
Nicholas
2006 Jun 14
3
Attributes for a model which are excluded from DB?
If I want to do this but not save to the database, how can I go about
it?
things.each do |thing|
changed = someotherqueryresult
thing.update_attribute :testattrib, changed
end
Essentially I want to create a collection called things with some extra
attributes that are not saved into the database, as they are just used
for sorting in a view and should not be saved (in fact saving them
wastes
2006 Aug 04
1
All Fixtures plugin
Just released a very simple plugin for including all fixtures in your
tests. Once you have a large number of table, manually managing the
fixtures for every single test stub can be quite tedious.
Use as follows
class BlogArticleTest < Test::Unit::TestCase
all_fixtures
def test_foo
...
end
end
Couldn''t be easier. More info here:
2006 Jun 09
11
Adding routes from plugin
Can anyone tell me how to add routes from plugin? I know it is possible
because of this changeset: http://dev.rubyonrails.org/changeset/2967 but
i didn''t find way how to do it.
retro
--
Posted via http://www.ruby-forum.com/.
2006 Mar 26
5
How to write manage created_on and created_by via mixin?
Hi!
Definite newbie here - I''m working through this like-hate relationship with
Ruby and Rails right now... sometimes things work really well (like blobs
seem to rock) but other times, I dunno! :-)
Anyway, I''d like put in create and update user timestamps on all my primary
domain tables and allow them to be updated automatically by ActiveRecord.
Coming from Hibernate, I just
2006 Jun 01
5
flash not clearing after display
(Rails 1.1, Ruby 1.8.4)
In the layout for one of my controllers, I have a tag to display a flash
message (copied from AWDWR), like this:
<div id="data">
<% if @flash[:notice] -%>
<div id="notice"><%= @flash[:notice] %></div>
<% end -%>
<%= @content_for_layout %>
</div>
If the
2006 Aug 03
2
Including ALL fixtures for a test
I am running into some issues with my functional tests because they need
info from almost every single table in the database. I have long
laundry lists of fixture names to include on these test files and then I
have to troubleshooot bizarre test failures because of a fixture that
was not included.
So is there a way to simply include all fixtures in a test? Something
like:
fixtures :all
2006 Jun 07
7
file_column image versions
does anyone know much about resizing different versions of images with
file_column? i tried it and everything works fine, but my question is
can you do more than just make sizes with a version of image? i''m
working on a photo album and i would like to resize the image to a
medium size, but create a thumbnail as well and crop anything left to
make the thumbnail a perfect square.
--
2006 Jun 07
4
Edge rails and routes
I have a route that works under 1.1.2 but does not work under edge
rails.
route.wishlist ''wishlist/:id'',
:action => ''show_wishlist'',
:id => nil,
:requirements => {:id => /\d*/}
This worked great without an :id, but under edge rails when I call
wishlist_url with no parameters I get:
"Exception: can''t convert nil into
2006 May 09
9
Working around the year 2038 bug in Ruby''s Time class?
I would have never imagined that I''d be bitten by the Y2038 bug
someday... but it just happened and, trust me, it hurts!
I have to deal with a database containing datetime fields with dates
up to 2050 and more. ActiveRecord raises an exception because Ruby''s
Time class implementation.
Besides running Ruby on a 64-bit platform, what can be done to avoid that?
Does a
2006 Feb 28
1
Cache Magic field for totaling
Hello,
Rails provide counter cache field for associations, I want a similar cache
for totaling up values
(say account_balance = sum_of_deposits - sum_of_withdrawals).
I was wondering if rails, already has another surprise in store for me, or is
there any plug-in or how-to for doing these kind of things.
Thanks.
--
Surendra Singhi
http://ssinghi.kreeti.com, http://www.kreeti.com
Read the
2006 Jan 04
4
gmail attached file field magic
Hello,
does someone knows how gmail does file upload when the attached files
are automatically saved in drafts ?
I am trying to do it in Scriptalicious/Prototype but I don''t see how they
get
the file on the system using js...
Tarek
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
2006 May 10
3
migrations :timestamp becomes :datetime in mySql
For some reason whenever I try and create a timestamp column with
migrations and mysql I get a datetime column instead. That''s kind of
annoying because I want the column to update every time the row gets
changed. Is this a bug, or is there something I can do about it?
(Obviously I can manually change my mysql table, but that kind of
defeats the point of migrations!)
In my migration
2006 Dec 06
2
validates_uniqueness_of where scope euqals created_by "magic" field
I have the following ActiveRecord objects:
class Recipe < ActiveRecord::Base
has_many :ratings, :dependent => true
. . .
end
class Rating < ActiveRecord::Base
validates_uniqueness_of :created_by, :scope => :recipe_id
belongs_to :recipe, :counter_cache => true
. . .
end
The created_by field on Rating is implemented as a "magic" field
similar to this: