similar to: Finding items that aren''t associated

Displaying 20 results from an estimated 40000 matches similar to: "Finding items that aren''t associated"

2006 Aug 16
5
validation on methods that aren''t part of the database.
using the Rails Recipes book, i went through the tutorial on setting up authentication on a site. the tutorial was great, but it raises a few questions. the fields in the database are password_hash, and password_salt. the tutorial creates another method for password that takes the value it was given and hashes it and adds the 6 character salt at the end. what if i want to perform validation
2007 Apr 28
0
[975] branches/wxruby2/wxwidgets_282/rake/rakemswin.rb: Correct spacing for link command; remove odbc and db_table which aren''t
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!-- #msg dl { border: 1px #006 solid; background: #369; padding:
2005 Mar 08
2
ActionWebService SOAP Faults aren''t schema valid
I''m working with an ActionWebService client talking to an ActionWebService server through one of DataPower''s XS40 XML Security Gateways. One of the intrinsic functions of this gateway is automatic SOAP schema validation. When testing some failure cases, I noticed that SOAP Faults returned by ActionWebService aren''t schema valid to the SOAP 1.1 schema, specifically:
2008 Apr 24
2
Dynamic finders in has_many associations
I have these 3 models. class Ivr < ActiveRecord::Base has_many :klusterings, :dependent => :destroy has_many :klusters, :through => :klusterings, :uniq => true end class Kluster < ActiveRecord::Base has_many :klusterings, :dependent => :destroy has_many :ivrs, :through => :klusterings, :uniq => true end class Klustering < ActiveRecord::Base belongs_to :kluster
2007 Oct 18
0
Getting the through items from a has_many :through :uniq relationship
Getting the through items from a has_many :through :uniq relationship In a nutshell, I have been using the has_many :through :uniq relationship, and I want a DRY way to list the join model objects. Currently, my objects include taxon objects, toxin objects, data_object objects, and taxon_toxin_citation objects ("citation" is another word for data_object). A taxon has many data objects,
2006 Mar 30
3
Model.find(:all) where Model.association has more then 0 items?
Hi everyone, I have a Department model that has_many people. How do I go about finding all departments with more than 0 people? Department.find(:all, :conditions => Department.people.size > 0) That, of course, doesn''t work, but it was as close as I could come. Thanks! Sean
2009 Oct 06
1
Problems Processing multiple form elements generated by javascript actions
Hi all, After many days of struggling, I have a multi-model form with ajax elements more or less working, but I''m hitting a wall with a few bugs that I can''t figure out. Guidance would be very much appreciated. I''m using the Ryan Bates technique from Advanced Rails recipes to dynamically add and remove elements on a multi-model form.
2006 Mar 21
2
These objects aren''t equal..I''m confused
I''m testing to see if two objects are equal. One is accessed directly from the fixture, and the other is accessed through a relationship. Here''s the test: def test_hero assert_equal players(:hero), hands(:first).hero end Anyway, the values are exactly the same as far as I can tell. The only difference is the object id, but Ruby compares the values, right? This just
2008 Mar 13
3
Stories (well, integration tests) which aren''t plain text
Hi, Having just played with getting my first plain text story working, I like how it all fits together. It worked out nicely. However, I don''t feel our project needs to have stories as plain text, in fact it''s a slight hindrance for us. Is there any sensible mechanism for doing integration testing using rspec without plain text stories? Thanks, Rob
2004 Jan 11
1
HTB rates aren''t enforced correctly
Hi! I recently changed my qdisc from CBQ and PRIO to only HTB, and I can''t really seem to get the rates to work as I want them to. I have eight classes, which I set up as follows: tc qdisc add dev eth1 root handle 1: htb default 122 tc class add dev eth1 parent 1: classid 1:1 htb rate 1000kbit ceil 1000kbit cburst 1500 burst 50kb tc class add dev eth1 parent 1:1 classid 1:11 htb prio 0
2009 Feb 19
3
Associated child records not created on creation of a parent.
I am trying to create a record with association. Within the create method, I would also like to pre-populate dependent (has_many) records from a template in the database. The child records are <u>mysteriously rolled back </u> if I insert them in a loop. If I try to insert a single child record, it works.I have read the books and tried to google my way out of this but am at a dead
2013 Feb 23
0
where condition having no association
Rails 3.2.11 My app has a model called Plan, which has has_many self-referential association just like http://railscasts.com/episodes/163-self-referential-association has_many :matches has_many :counterparts, :through => :matches has_many :inverse_matches, :class_name => "Match", :foreign_key => :counterpart_id has_many :inverse_counterparts, :through =>
2006 May 08
2
Creating a "Foo has_many bars" association where bar isn''t a model.
Hi Let''s say we have model Foo. Each Foo instance can have several bars. Those bars are primitive, so they shouldn''t be models. For example, Foo might be a type of convention, and the bars might be years the convention was held in. Naively, we would have a conventions_years date, and put: has_many :years inside class Convention. But then we''d get an error, since for
2009 May 12
4
has_many :through and scopes: how to mutate the set of associated objects?
I have a model layer containing Movie, Person, Role, and RoleType, making it possible to express facts such as "Clint Easterbunny is director of the movie Gran Milano". The relevant model and associations look like this class Movie < ActiveRecord::Base has_many :roles, :include => :role_type, :dependent => :destroy has_many :participants, :through => :roles, :source
2007 Dec 07
0
Associations counting
Hi, I''m using the models, User, Item, and Add. Add belongs_to User (with counter_cache enabled) Add belongs_to Item (also, with counter_cache enabled) User has_many adds, and has_many items through adds Item has_many adds, and has_many users through adds When I go to save a new Item, I want to create a new Add for this, with the proper (loged in) User: @item.adds.create :user =>
2005 Dec 12
2
How to use arbitrary relationships in Activerecord
How can I ask ActiveRecord to make it''s "has_many" code to work on some arbitrary relationship between two tables? ie neither field is a primary key The situation is that I am writing a Postfix management application and one of the tables to manage is the "alias" table. My primary key in the "mailbox" table is "id", but the alias table is just
2009 Aug 05
1
[PATCH server] associated nics w/ network base class as it is in the db
fixes regression bug that got recently introduced --- src/app/models/network.rb | 2 ++ src/app/models/physical_network.rb | 2 -- src/app/models/vlan.rb | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/app/models/network.rb b/src/app/models/network.rb index a4b1b8b..89f9876 100644 --- a/src/app/models/network.rb +++
2006 Apr 04
1
Manipulating has_many :through associations
Hi, I haven''t done any associations before, so please forgive my incorrect use of terminology... If I set up a has_many :through association, can I manipulate the associated instances directly (like an Array), or do I need to manipulate the join model? For example, suppose I have two classes and the associated join model: class foo has_many :foo_bars has_many :bars, :through
2012 May 04
0
Why does Rails only save the joiner record in one instance but not another?
Assuming we have User, Account, and Role models, and a User has_many :accounts, through: :roles and vice-versa, with the following snippet Rails automatically creates the Role (joiner) record, but with the snippet after Rails will not. I think I''m misunderstanding how has_many through works, so I would appreciate any insight into the subject. def new @account =
2005 Dec 28
9
Idiom question - assertions which aren''t in tests
All, Although I''ve been keeping an eye on Ruby for several years now, I don''t have a huge amount of experience with it. So please forgive me if I''m missing something obvious. I''m in the process of writing my first really "serious" Rails app and would appreciate your advice. I am wondering if there is a standard idiom for including assertions in