search for: end_ev

Displaying 13 results from an estimated 13 matches for "end_ev".

Did you mean: end_
2006 Jul 02
7
How can I intercept attribute calls?
Hi. I have two types of fields in my database, e.g. "name" and "name_ru". First one is a user''s name in english and the second one is in russian. I want to intercept calls like "c.name" and add "_ru" to it if current language is russian (I have my own Locale class like n Globalize). So I want such thing: -- Locale.set("en-US") c.name
2005 Dec 31
6
habtm recursion via destroy_without_callbacks
I am having a problem with two models that each have a HABTM relationship to the other. For example: CREATE TABLE people (id INT, name TEXT); CREATE TABLE teams (id INT, name TEXT); CREATE TABLE people_teams (person_id INT, team_id INT); The person model has: has_and_belongs_to_many :teams And the team model has: has_and_belongs_to_many :people The trouble comes when trying to destroy
2006 Jul 28
0
reserved words
...def objeck(table_name) klass(table_name).new end private def class_name_from_table(table_name) Inflector.camelize(table_name) end def define_klass(table_name) tname = class_name_from_table(table_name) class_def = <<-end_eval class #{tname} < ActiveRecord::Base set_table_name(''#{table_name}'') end end_eval eval(class_def, TOPLEVEL_BINDING) const_get(tname) end end end end I need to somehow validate against reserved...
2006 Jun 01
1
Automatted Getter/Setter
Hey.. So I have a model that has a lot of number fields. Each of these go through a process when read in and read out to add/remove commas (between every three numbers) to make them more readable. The getter I currently have is like this: def sale_price Listing.insert_commas(read_attribte (:sale_price)) end and the setter is: def sale_price=(price) write_attribute(:saleprice,
2008 Jan 13
2
module_eval and scope question
...'m trying to understand (in case you happen to use Rails: This is from file scaffolding.rb): module ActionController module Scaffolding .. module ClassMethods def scaffold(model_id, options = {}) ... unless options[:suffix] module_eval <<-"end_eval", __FILE__, __LINE__ def index list end end_eval end ... end end end The purpose of this code is to create at run-time the function ''index''. My question is: Why do I need ''module_eval''...
2016 Mar 23
7
[PATCH v4 0/6] tests/qemu: Add program for tracing and analyzing boot times.
v4: - Lots more analysis of the /init script and other parts. - Display a list of the longest to shortest activities. - Rebase on top of current head. Rich.
2006 Mar 23
2
rails 1.1 and mysql errors
Hi, I just upgraded to rails 1.1 this morning and i am getting a variety of errors from tests that were passing effortlessly on the previous edge release (i froze several weeks ago, so I not sure what version that was). Has anyone else experienced these types errors with the new rails: I have several errors that are grouped around create and destroy commands the errors are similar, first the
2016 Mar 19
1
[PATCH] tests/qemu: Add program for tracing and analyzing boot times.
...activity { + char *name; /* Name of this activity. */ + int flags; +#define LONG_ACTIVITY 1 /* Expected to take a long time. */ + + /* For each pass, record the actual start & end events of this + * activity. + */ + size_t start_event[NR_TEST_PASSES]; + size_t end_event[NR_TEST_PASSES]; + + double t; /* Start (ns offset). */ + + /* Length of this activity. */ + double mean; /* Mean time elapsed (ns). */ + double variance; /* Variance. */ + double sd; /* Standard deviation. */ + double pe...
2006 Aug 06
0
Rails Core Weekly July 16 - August 6
...to trouble when the order of his new restrict association turns out to be significant. Jeremy: "You can wrap the destroy method to leapfrog the callback chain." associations.rb, configure_dependency_* case reflection.options[:dependent] when :restrict class_eval <<-end_eval def destroy_with_has_many_#{reflection.name} unless #{reflection.name}.blank? raise DestroyRestricted.new(self, #{reflection.name.inspect}) end end alias_method_chain :destroy, "has_many_#{reflection.name}" end_eval...
2006 Jul 27
9
Introspecting validates_presence_of
Hello people, I''d like to detect whether an attribute of a model has vaildates_presence_of applied to it so I can automatically apply a mandatory (*) to the field...it doesn''t look easy...any ideas? Cheers, -- Dan Webb http://www.danwebb.net
2006 Feb 03
1
modifying scaffold method
...rb =================================================================== --- vendor/rails/actionpack/lib/action_controller/scaffolding.rb (revision 125) +++ vendor/rails/actionpack/lib/action_controller/scaffolding.rb (working copy) @@ -99,7 +99,7 @@ module_eval <<-"end_eval", __FILE__, __LINE__ def list#{suffix} - @#{singular_name}_pages, @#{plural_name} = paginate :#{plural_name}, :per_page => 10 + @#{plural_name} = #{class_name}.find(:all) render#{suffix}_scaffold "list#{suffix}" end @@ -1...
2016 Mar 22
19
[PATCH v3 0/11] tests/qemu: Add program for tracing and analyzing boot times.
Lots of changes since v2, too much to remember or summarize. Please ignore patch 11/11, it's just for my testing. Rich.
2016 Mar 20
14
[PATCH v2 0/7] tests/qemu: Add program for tracing and analyzing boot times.
v1 was here: https://www.redhat.com/archives/libguestfs/2016-March/thread.html#00157 Not running the 'hwclock' command reduces boot times considerably. However I'm not sure if it is safe. See the question I posted on qemu-devel: http://thread.gmane.org/gmane.comp.emulators.qemu/402194 At the moment, about 50% of the time is consumed by SeaBIOS. Of this, about ⅓rd is SGABIOS