similar to: Active Record and Time support

Displaying 20 results from an estimated 40000 matches similar to: "Active Record and Time support"

2006 Feb 07
9
Is there a good time_select tag helper?
I''m trying to record a list of start and end times, and they''re simply an hour and a minute. Looking at the API, there''s a select_time helper, but that just creates the tag. There''s a datetime_select helper which takes an object and method name, so it does all the magic...but I only want to worry about the hour and the minute. I''ve tried writing my
2006 Feb 10
3
Quoting table and column names inside AR
There are quite a few tickets asking for quoted table names and field names to enable reserved words as table or column names. What is the general consensus regarding this issue? Bob Silva http://www.railtie.net/ _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
2006 Feb 28
5
Session Sweeping
Hi, Anyone got some slick ideas on how to sweep an AR session store? I have a few ideas how I can do it, just want to see if there is an elegant solution that someone is already using. Bob Silva http://www.railtie.net/ -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Feb 06
3
acts_as_threaded plugin
This plugin is related to the acts_as_nested_set functionality but differs in that it allows multiple roots to exist within your database. The other benefit, is that when adding a child, it doesn''t perform a full table update to rebuild the tree, each child insertion only affects the tree that it is placed in. It even comes with my first screencast to show how you can build an old
2006 Jan 27
0
Plugin - Redefining Numericality
I''ve put together another plugin, this time it adds some convenience functions to the validates_numericality_of validation routine. Nothing in this plugin can''t be done with existing validation routines, it just moves them to a place I feel is more appropriate. http://www.railtie.net/articles/2006/01/27/defining-numericality PS: Sorry for hijacking threads with my
2006 Feb 17
0
Caching Auto Complete Field
Greetings, I''ve extended script.aculo.us to have the autocompleter cache it results in the browser and only callback to the server when you clear your filter. This provides good performance for lists with lots of elements on a busy site. Typically, your initial result set doesn''t actually change, items just get filtered out. Why have your database perform this simple
2006 Jan 28
4
Rails Sessions - Disabling and Garbage Collection
Is there a way to turn sessions off in Rails? Doesn''t appear to be. Also, is there any garbage collection for stale sessions? On those two topics, are there any problems with Rails handling those options? I ask because it seems like something that would have been included. If there is no technical reason why it wasn''t included, then I''ll create/submit a source
2006 Jan 28
1
Unit Tests Behavior
Hi, Working on unit tests and I have a few cascade delete constraints I am testing. The unit tests stop at the first assert_raise test. Is this typical? def test_destroy_all_cascade_delete assert_equal 1, Iep.find(:first).client_id assert_equal 1, Encounter.find(:first).client_id @client.destroy assert_raise(ActiveRecord::RecordNotFound) { Iep.find(1) } <--
2006 Jan 28
1
Unit Tests Take 2
Different question this time, and maybe only a core developer can answer. In 1.0, use_instantiated_fixtures is turned off by default. What is the new best-practice for not tying your tests to your test data? Before you would use: In clients.yml first_client: id: 1 name: Fred In a test case: def test_sometest assert_equal @first_client.name, @client.name end
2006 Feb 05
1
acts as nested set
Hi Railers, Is the nested set model restricted to only one root? I''m working on a screencast building a threaded forum and nested set comes close but is lacking a few items for this project. First, all the documentation I can find restricts a nested_set to one root node, and a threaded forum would have many roots. Also, without a ton of fancy sql or an ungodly amount of db calls, it
2006 Feb 26
4
Creating objects with has_many :through relationship
Three tables: users: id clients: id admin_contacts: user_id, client_id class Client has_many :admin_contacts has_many :contacts, :through => :admin_contacts, :foreign_key => :user_id, :class_name => ''User'' end I added the :contacts for ease of use of grabbing the user objects associated with the admin_contact. This all works great, I can grab the Users that
2006 Jan 27
17
Multiple Model Validation
Hey All ! I have a form which contains two models. I would like both models to be validated, but have their validations aggregated on the page. If I do: <%= error_messages_for(:model1) %> <%= error_messages_for(:model2) %> It puts two big validation blocks on the page. I would like all the errors from both models, but only in one validation box. Is this possible ? All my attempts
2005 Dec 01
0
Problem using a date helper
Hi, I''m having trouble getting a date helper working. I was pointed to this by Sean Allen, and it resides at http://theredheadedstepchild.net/articles/2005/08/04/datehelper-fixes It''s meant to fix the bug in Rails which doesn''t allow datetime_select to properly discard the year. So, I''m trying to use the helper''s time_select function. date_helper.rb
2007 Nov 14
0
Problem time_select with fields_for
Hi, I''m using fields_for and a time_select but he isn''t saving the time in the db just 00:00:00 All the other fields are fine, but the time_field isn''t working:s This is my code: <% form_for :activity, @activity,:url => {:action => "create"} do |activity_form| %> <td><%= activity_form.time_select :datum_1_twrak_van, :order =>[ :hour,
2006 Mar 04
4
authorization framework?
There are a number of good authentication frameworks for rails - has anyone developed a generic authorization framework? I''m thinking of something that included the concept of roles, mapped roles to both actions and users and could be used to wrap actions before their invocation. Extra good would be some way to check data permissions (as in, "yes you can perform the ''Edit
2006 Mar 21
5
Getting a time select input
I''m having trouble workign out which ActionView DateHelpers to display a time input for an ActiveRecord field of type :time. I just want an hours input and a minuites input. I can get these with time_select helper using :field_name and :prefix but it gives both hours and miniutes the same name. <%= select_time(Time.now, :prefix => "search", :field_name =>
2013 Mar 14
0
[Rails 3.2] accepts_nested_attributes_for and time_select
Hi, I am upgrading a Rails application from Rails 3.1.11 to 3.2.12, but have a problem with ` accepts_nested_attributes_for` in conjunction with multipart attributes. The app is used to manage oral exams, so there is a model `Exam`, which has many `Examdate`s. When creating an exam, I can also create the examdates, consisting of a date, a start time and an end time. While the date field is
2007 Aug 07
0
Newbie: Want to use time_select to partial fill a datetime field
Hello Our Database schema, and hence Our Model has a few datetime columns/ fields. But when entering new instances, We only want to present time (i.e. HH:MM) in in our HTML views to the user. The time_select looks useful, because it has an attractive minute_select: =>15, so the user can enter 1/4 hours increments. The idea being that we would default the Date part of Datetime attribute to
2008 Sep 11
2
time value won't come back from UTC
Hi there, I''m fairly new to RoR, and I seem to be having a problem with :time types. I save my times with a time_select on my form, to a time type field on MySQL. Rails automatically pulls it back to UTC from my timezone (+02:00), but when I display it again, it stays at the UTC value, i.e. I enter in 6:30, and I get 4:30 on my list. Is it just me, or is this a limitation of the time
2006 Jan 20
8
validates_confirmation_of not working
is there any special requirement for validates_confirmation_of ? I am trying to make sure 2 passwords are equal (cleanly the rails way).. In my view i have two fields with id user[password] and user[password_confirmation]. in the model i have validates_confirmation_of :password, :message =>"Passwords do not match " Am i missing something here ? thanks adam