similar to: faster? database search or rewriting objects

Displaying 20 results from an estimated 7000 matches similar to: "faster? database search or rewriting objects"

2005 Dec 30
9
SELECT MAX
How does one do a SELECT MAX query in rails? I''ve searched and searched and tried lots of things with no luck. I want to implement "SELECT MAX(column_name) from table_name and have it return the maximum value from column_name. I just need to get that one value, not the whole object... Thanks for any ideas... Shelby _______________________________________________ Rails mailing
2006 Jun 15
3
how to give a form a name
Using a <%= form_tag ... %>, how do I give a form a name, so that I can reference it with javascript? I sure can''t figure this out from the docs... Thanks, Shelby PS - what I am trying to do is just have the focus in the first form field when the form is loaded. There has to be an easy way to do this, but I can''t figure it out... -------------- next part --------------
2006 Jun 13
7
model validation across multiple views
I have a rather complex object with a number of attributes. For a variety of reasons, I would like one view to create the object with only a couple of fields completed, then a second and third view to finish all the fields. I would like the model to validate_presence_of all these fields, since eventually I need them all there, and I would like each page to validate its portion of the fields that
2006 Jul 09
2
serialized DateTime objects returning as Time objects
I have a database field called dates in which I am trying to serialize an array of DateTime objects. When I unserialize them, they are coming back in as Time objects. I know this, because I am getting errors that say "comparison between Time and DateTime failed. Why is this happening? Is there a way to prevent it?? Thanks Shelby -------------- next part -------------- An HTML attachment
2005 Dec 27
3
myObject.send(column.name) from Agile Development book
I''m studying the Agile Development with Rails book. In the chapter that first sets up the depot application (page 68), there is this bit of code from a view: <% for product in @products %> <tr> <% for column in Product.content_columns %> <td><%=h product.send(column.name) %></td> <% end %> etc... I am trying to absorb both Ruby and
2005 Aug 07
3
tracking online users
Let''s say I have an application and I want to create an admin program that will show me who is currently online using the application. I don''t know the best way to do this. Assuming I am storing my sessions in the default PStore, I don''t suppose there is any method that lists all the active sessions, is there? The only way I can think of to do this is to setup a
2005 Dec 31
4
saving a collection
Reading the Agile book, I can''t find a single command to save a collection. The save command seems to operate on only individual objects. Lets say I have a collection that I have received from a find_all command. I want to go through and change some attributes in various objects in the collection. Then I want to resave the whole collection back to the database. I don''t think
2005 Dec 26
2
confused about ruby fast C bindings
I am confused about ruby fast C bindings. Does the command: gem install mysql install these? Is this page: http://www.tmtm.org/en/mysql/ruby/ the home page for these bindings? If so, it gives no instructions about installing them with using gem. Wondering if this is all the same??? Thanks for any help... Shelby _______________________________________________ Rails mailing list
2006 Jul 22
5
Single id column
Is it true that Rails needs a single column to uniquely identify a row in table? If yes, doesn''t this limit the database design and disables the use of Rails for legacy databases? /Fredrik -- Posted via http://www.ruby-forum.com/.
2006 Jul 27
3
[somewhat OT] Apache config for Rails + ColdFusion + PHP
Our group has several web apps developed in ColdFusion, PHP, and Rails. The ColdFusion and PHP apps are on an older server, and the Rails apps on a new server. Ideally, we''d like them all to share the same server. Our current setup for the Rails server is Apache2.2 with mod_proxy_balancer and mongrel_cluster. We''d like to have specific directories be processed and served by
2006 Jul 03
2
moving data from legacy database
I have rewritten a java webapp into rails. The database structure is basically the same except that: 1) in the legacy app, several of the tables did not use ID numbers, but relied on other fields as the primary key 2) in the legacy app, there is a join table that uses email address and category names to do the join, not ID numbers I would like to move or change this database to match my new
2005 Jul 16
2
Applying css style to a link_to
What is the proper syntax to apply a css class to a link created using link_to? I''ve tried <%= link_to("details", :class => "details", :action => "edit", :id => event) %> but that creates a link which looks like /admin/events/edit/3?class=details which is not what I''m looking for. Kyle Heon
2006 Jul 16
1
form helpers with non-ActiveRecord objects
I have an ActiveRecord model (called Festival) that contains an array of "FestDate" objects serialized into a sql text column of the Festival object. (like the Agile book first edition describes on p. 205) The FestDate objects themselvs are not ActiveRecord objects. (of course, otherwise they would be in their own table...) When working with a Festival, I would like to use various
2006 Jul 25
1
save trouble with has_many belongs_to relationship
I have a bit of code in a controller that looks like this: @current_festival.monitor_preferences.each do |pref| if pref.user_id == @me.id pref.preference = params[:monitor_pref] #pref.save end end @current_festival.save_with_validation(false) the Festival class has_many :monitor_preferences the MonitorPreference class belongs_to :festival In the configuration above, the
2006 Jan 04
2
collection_select with array as source
I would like to use the collection_select with a simply array as the source of the collection. My array looks like this: STATES = ["Alabama", "Alaska", "Texas"] and it is stored in my environment.rb I can''t figure out the syntax for the collection_select in this situation... collection_select("my_object", "state", what goes here??? ) I
2006 Jul 15
1
Is there a huge performance difference between using multiple periodically_call_remote functions or one?
My application has multiple things on the interface that need to be updated periodically. Some things every second, others not so much. Some of these things are global, meaning they are on the interface at all times, and some of these things are view specific. So what I figured I would do is add the periodically_call_remote function for the global elements and another one for the view
2006 Jul 11
3
LoginGenerator Killing Me ;)
OK I have dents in my head from beating on LoginGenerator, so if anyone who has used this thing can shed a little light I would greatly appreciate it. It is installed and I have set it up on my User class. Folks can login, logout, etc just fine. I have am not using the per method protection model yet, as I am trying to migrate slowly ;) What is broken though are all my methods that save or
2006 Jul 17
7
Who owns the web application after it code''s distributed?
Let''s say I''m building a "to-do" list application using Ruby on Rails. I decide to sell it to a customer, and distribute the source code files to him. Can I then restrict the user from distrubting the files by creating a license that prohibits distribution? That is, is it possible to create a "single-user" license? Or, am I limited to distributing the
2013 Oct 24
1
SAMBA 4 - Remove last Windows DC from Domain
HI, i just played around with Windows 2008 R2 as ADS Server and two SAMBA 4 as additional DCs. Setting up the Samba 4 DCs works fine. Now I wanted to remove the last Windows DC with dcpromo. It fails with the following statement: Der Vorgang konnte nicht durchgef?hrt werden. Fehler: Active Directory konnte keinen anderen Dom?nencontroller f?r die ?bertragung der verbleibenden Daten
2012 Jul 31
3
How can I parse this string to extract just the number 11?
Below is the string to parse and return the embedded number = "11" string = "\t\t\t\t\t<span class=\"compliment-count profile\">11</span>" On Jul 29, 2012, at 3:00 AM, r-help-request@r-project.org wrote: > char [[alternative HTML version deleted]]