search for: has_

Displaying 20 results from an estimated 46 matches for "has_".

Did you mean: has
2016 Jan 27
4
[PATCH] lvm: support lvm2 older than 2.02.107
...(&ret) == -1) + return NULL; + + return ret.argv; +} + char ** do_pvs (void) { @@ -139,26 +219,76 @@ do_vgs (void) return convert_lvm_output (out, NULL); } +/* Check whether lvs has -S to filter its output. + * It is available only in lvm2 >= 2.02.107. + */ +static int +test_lvs_has_S_opt (void) +{ + static int result = -1; + if (result != -1) + return result; + + CLEANUP_FREE char *out = NULL; + CLEANUP_FREE char *err = NULL; + + int r = command (&out, &err, str_lvm, "lvs", "--help", NULL); + if (r == -1) { + reply_with_error ("lvm...
2006 May 23
0
does has_many: add a has_<associated_class>? method
Hi, I have a Country class which has_many: regions. At the same time, the corresponding countries table has a boolean column named has_regions. It happens that when I try to access that attribute using country_instance.has_regions? , I can see in the logs that Rails is querying the database with a SELECT that''s countin...
2006 May 26
4
What association do I want here, has_ or belongs_to?
...omebody can set me straight. I have an object AlertTemplate which will contain a fill in the blank style hunk of web content. I then have an object, Alert, which will have a relationship to one of those AlertTemplate objects, plus some data. So, in human speak, I''d think that an Alert has_one AlertTemplate. But I can''t really say that AlertTemplate belongs_to Alert, because each template may be used by many alerts. So AlertTemplate just as an id column, but Alert has a template_id column. In my form for creating an alert I have: collection_select(:alert, :template, (A...
2017 Jul 14
0
[PATCH 14/27] daemon: Reimplement ‘lvs’ API in OCaml.
...- return NULL; - - return take_stringsbuf (&ret); -} - char ** do_pvs (void) { @@ -222,74 +139,6 @@ do_vgs (void) return convert_lvm_output (out, NULL); } -/* Check whether lvs has -S to filter its output. - * It is available only in lvm2 >= 2.02.107. - */ -static int -test_lvs_has_S_opt (void) -{ - static int result = -1; - if (result != -1) - return result; - - CLEANUP_FREE char *out = NULL; - CLEANUP_FREE char *err = NULL; - - int r = command (&out, &err, str_lvm, "lvs", "--help", NULL); - if (r == -1) { - reply_with_error ("lvm...
2006 Jan 09
6
Nil column results, possible to ignore?
For a table "clients" there are city, state, and zip fields. However, for some clients we only have a state with no actual address. The following code throws a "You have a nil object" error when outputting my client list. Is there a way around this, short of writing a specific case for each possibility? &lt;%= client.city + '', '' + client.state +
2016 Jan 28
0
[PATCH v2] lvm: support lvm2 older than 2.02.107
...(&ret) == -1) + return NULL; + + return ret.argv; +} + char ** do_pvs (void) { @@ -139,26 +218,72 @@ do_vgs (void) return convert_lvm_output (out, NULL); } +/* Check whether lvs has -S to filter its output. + * It is available only in lvm2 >= 2.02.107. + */ +static int +test_lvs_has_S_opt (void) +{ + static int result = -1; + if (result != -1) + return result; + + CLEANUP_FREE char *out = NULL; + CLEANUP_FREE char *err = NULL; + + int r = command (&out, &err, str_lvm, "lvs", "--help", NULL); + if (r == -1) { + reply_with_error ("lvm...
2020 Sep 22
2
Unifying CMake variable names used in checks across subprojects
...or check_library_exists, CMake caches the resulting variable and doesn't run the check again. The problem is that in LLVM, each subproject uses different variable names for results of these checks. For example, most subprojects check if pthread is available and store the result in: COMPILER_RT_HAS_LIBPTHREAD (compiler-rt) LIBCXX_HAS_PTHREAD_LIB (libc++) LIBCXXABI_HAS_PTHREAD_LIB (libc++abi) LIBUNWIND_HAS_PTHREAD_LIB (libunwind) HAVE_LIBPTHREAD (llvm) This means that even though this check would ideally be performed just once (per target) and reused everywhere, it's performed 5 times. The...
2007 Apr 06
3
How to find rows where no row in associated table exists?
Basically, how do I do this "The Rails Way(tm)" SELECT * FROM beta_users u LEFT JOIN beta_codes c ON u.id = c.beta_user_id AND c.code IS NULL At the moment I''m using find_by_sql, and that works Ok, but what would be the Rails way? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on
2016 Jan 28
0
Re: [PATCH] lvm: support lvm2 older than 2.02.107
On Wed, Jan 27, 2016 at 07:06:46PM +0100, Pino Toscano wrote: > char ** > do_lvs (void) > { > char *out; > CLEANUP_FREE char *err = NULL; > int r; > + int has_S = test_lvs_has_S_opt (); > + if (has_S < 0) > return NULL; I think this doesn't do the right thing on the second failing call to test_lvs_has_S_opt, because it won't return a protocol error? > + /*NOTREACHED*/ > + assert (false); > + return NULL; > } What...
2006 Jul 25
2
join in legacy DB?
I''ve got a problem with some tables that don''t follow any RAILS standards. how do I define the join in the model when all three tables have wacky names? class Machine < ActiveRecord::Base set_table_name "tbl_CodeMgmt_Host" set_primary_key "Id" end class Pool < ActiveRecord::Base set_table_name "tbl_CodeMgmt_Pool" set_primary_key
2020 Sep 22
2
Unifying CMake variable names used in checks across subprojects
> On Sep 22, 2020, at 15:28, Eric Christopher <echristo at gmail.com> wrote: > > From the "not largely affected" camp: > > - the churn doesn't feel that major for HAS_ and ... > - the uniformity feels nice > > and in general feels nice and in pursuit of the longer term goals here. > > -eric > > On Tue, Sep 22, 2020 at 11:58 AM Petr Hosek via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote: >...
2007 Jul 04
3
Testing Rails Associations
...xisting rails app, porting from a mix of Test::Unit, and simply_bdd amongst others. I''m at the point where I want to test that certain associations are present. What I''m not sure of is should I test the association or the method and return object. That is, if I wanted to test a has_many should I: Confirm the methods exist, and that the return an array etc OR Check that the model has the named has_many association through it''s reflections. On one hand the second one looks like it will be a bit more robust, since if there is a has_many relationship, then all the ass...
2010 Apr 15
12
[PATCH] Add :touch option to has_many associations
Hi, it would be nice to have the touch option in has_many associations also. I have a scenario like this: An user has some credit (money) and some advertises. Each advertise can be enabled or disabled depending on some rules. One of the rules is that the user should have money. Each time the money of the user change, the advertises are touched, enab...
2020 Sep 25
2
Unifying CMake variable names used in checks across subprojects
...ailto:ldionne at apple.com>> wrote: >> On Sep 22, 2020, at 15:28, Eric Christopher <echristo at gmail.com <mailto:echristo at gmail.com>> wrote: >> >> From the "not largely affected" camp: >> >> - the churn doesn't feel that major for HAS_ and ... >> - the uniformity feels nice >> >> and in general feels nice and in pursuit of the longer term goals here. >> >> -eric >> >> On Tue, Sep 22, 2020 at 11:58 AM Petr Hosek via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists....
2006 Aug 13
0
how to work with has_many :through
I''m trying to understand how to use the has_many :through construct. I have two tables: customers and vendors associated through "assignments" table. Class Customer has_many :assignments has_ many :vendors, :through => :assignments . . . # other fields end Class Vendor has_many :assignments has_many :customers, :throu...
2016 Jul 26
0
[PATCH 4/5] daemon: lvm: list PVs/VGs/LVs with --foreign
...ame", "--noheadings", NULL); + str_lvm, "vgs", "--foreign", "-o", "vg_name", "--noheadings", NULL); if (r == -1) { reply_with_error ("%s", err); free (out); @@ -263,6 +263,7 @@ do_lvs (void) if (has_S > 0) { r = command (&out, &err, str_lvm, "lvs", + "--foreign", "-o", "vg_name,lv_name", "-S", "lv_role=public && lv_skip_activation!=1",...
2006 Jul 19
0
Authorization Plugin 1.0 rc3 + Test App
...ng roles for the entire application, a model class, or an instance of a model (i.e., a particular object). * Some english-like dynamic methods that draw on the defined roles. You will be able to use methods like "user.is_fan_of angelina", "user.is_fan_of_what", or "angelina.has_fans?", where a ''fan'' is only defined in the roles table. Models also pick up has_* methods like "group.has_moderators" (returns array of users who have role ''moderator'') and "group.has_moderators?" * Pick-and-choose a mixin for your desir...
2007 Aug 03
0
acts_as_paranoid and Association Extensions (has_one troubles)
Hi... Isn''t there a proper way or hack/workaround for the following? * For the example with unfortunate disabilities.. look below,,, Usage of has_* (associationmethods) do {def with_deleted AccociatedModel#with_scope} {Paranoid''s#find_with_deleted}... The has_one associations give me a nil object when invoking it with Model.association_OBJECT.with_deleted. Has_many does like expected: Model.association_COLLECTION.with_deleted. * Exa...
2008 Feb 02
16
[patch 00/16] ocfs2: SLES10 compatibility patch queue
Here is the original set of fixes, split out into 14 individual ones. In addition to splitting them out, I also changed the ones that were HAS_* to NO_* as requested. The last two patches are needed to build on openSUSE 10.3 which is based on 2.6.22. I used it as a sanity check and found those failures. -Jeff -- Jeff Mahoney SUSE Labs
2008 Oct 17
1
How to best start from scratch implementing a ERM diagram?
Hey people, I''m starting a new project and just finished creating the ERM diagram with about 30 tables. There are quite some tables with foreign keys so I''m not sure how to start creating the controllers/models. How should I start creating controllers/models? Should I first create all tables without foreign key? Should I just start somewhere and add them radomly? I''m