similar to: Search from has_many?

Displaying 20 results from an estimated 1000 matches similar to: "Search from has_many?"

2007 May 05
4
autogenerated it (was ''Custom Matcher and NAME NOT GENERATED annoyance'')
> On 5/5/07, Luis Lavena <luislavena at gmail.com> wrote: > > describe "A User (in general)" do > > before(:each) do > > @user = User.new > > end > > > > it { @user.should have_many(:contest_public_votes) } > > it { @user.should have_many(:design_industry_user_interests) } > > it { @user.should
2008 Mar 12
2
nested routes with a 2-way has_many using join table?
I have two classes, InstructionalObject and Assets. They both have_many of the other, implemented through a join table (so it''s like a habtm without the habtm). For the next version of our app, we''re refactoring to RESTful, and i''m having trouble with my nested resources/routes. I tried this, in routes.rb: map.resources :assets do |assets| assets.resources
2009 Jun 27
6
User has many topics or subtopics
Hi, So i have users in the system and i have topics. Topics also have_many subtopics. What is the cleanest way to setup the AR relationships if a user can either have_many topics or subtopics ? Its basically a dual select box dropdown, where the second dropdown is optional. Is the best to have user_topics, and user_subtopics tables and manage that way ? or combine into one table with STI
2007 May 04
2
Custom Matcher and NAME NOT GENERATED annoyance
Hello RSpec users, Have been using RSpec since 0.8.2 (not too long ago, I must say). and been creating my custom matchers since was defined as "good practice". Also, auto-generated names for the examples is very helpful, I''m trying to take advantage of it. Since I often prior code/define all the "examples", I have created a few matchers to fulfill associations and
2011 Sep 14
1
rspec and should have_many through
Hi, Anyone can help me with rspec shoulda validations please. I can''t get the syntax right for these validations. Please correct me it { should have_one :tradable, :through => :trade_order} it { should belong_to :source, :polymorphic => true } it { should have_many :transfers, :as => :source } this is for Rspec 2, rails 3.1, gem "rspec-rails" gem
2007 Aug 10
0
ActiveRecordAssociationMatcher
I''ve started to put together a custom expectation matcher for specifying AR associations. Its not quite complete and I really need to put some specs together for it, but I''d appreciate any comments. It lets you spec your associations like this: describe Record do include ActiveRecordAssociationMatchers it "should belong to artist and use a counter cache" do
2011 Sep 05
0
undefined method `dependent' - rspec and shoulda
hello, Getting this error when using shoulda and rspec for model tests. my gemfile ... gem "shoulda-matchers" .. spec file .. it { should have_many(:balances).dependent(:destroy) } error: User shoulda validations Failure/Error: it { should have_many(:balances).dependent(:destroy) } NoMethodError: undefined method `dependent'' for
2010 Jan 10
3
[LLVMdev] Using a function from another module
On Sun, Jan 10, 2010 at 12:38 PM, Garrison Venn <gvenn.cfe.dev at gmail.com> wrote: > Won't passing llvm::Function* around vs strings (function names), also work, at code generation time, > without the need for a module A dec to module B impl. mapping? > > Garrison Nope. You cannot place a call instruction into one module whose callee is a Function from another module. You
2006 Feb 11
2
Route all LAN traffic through eth2 and keep web/mail traffic on eth0
Hi, I have the following config: 1 PC with 3 NICs, that shares internet connection to LAN. eth0 uses a public IP ($public_ip_1) eth1 uses a private IP ($private_ip) eth2 uses a public IP ($public_ip_2) I have a webserver and a mailserver accesible by $public_ip_1 (eth0) I have a LAN with all terminals using private IPs, and $private_ip (eth1) as gateway. $public_ip_1 and $public_ip_2 are from
2010 Jan 10
0
[LLVMdev] Using a function from another module
Kenneth Uildriks wrote: > On Sun, Jan 10, 2010 at 12:38 PM, Garrison Venn <gvenn.cfe.dev at gmail.com> wrote: > > Won't passing llvm::Function* around vs strings (function names), also work, at code generation time, > > without the need for a module A dec to module B impl. mapping? > > > > Garrison > > Nope. You cannot place a call instruction into one
2012 May 04
3
Database schema question
Im setting up a very basic rails app and have a question about the needed migrations & associations. Basically, my app is an occasion reminder service that emails users when occasions that they select or input are coming up. Occasions will be selected from a checkbox type list or alternatively manually input by the user (name and date of the occasion). Users can have_many occassions.
2006 Mar 21
2
Sorting by computed temporary field
Hey all, I''m rather new to Ruby and Rails (and not great with SQL), but I''m developing a ride sharing app and would like to be able to sort on something I don''t have stored. I have users, events, and rides, each of which has a zip code. Events have_many rides, and rides belong_to events. When an event is selected, I''d like to be able to show a list of
2011 Jul 11
36
has_many and belongs_to association
Hi , I want to test the one below but I got the problem belongs_to :name, :class_name => "Phrase", :foreign_key => "name" in my test context "test"do should have_many :phrases end in language.rb belongs_to :name, :class_name => "Phrase", :foreign_key => "name" error is 1) Failure: test: check has_many and belongs_to
2006 Apr 20
0
acts_as_list not CASCADE''ing in singular n-tier model structure
[using RAILs 1.1.2] Has anyone else seen issues where multiple tiered "acts_as_list" models do not CASCADE delete correctly? For instance, I have 4 models, the first 3 in the hierarchy have the appropriate "have_many" declarations with "exclusively_dependent => true". The last the models have the appropriate "acts_as_list" with the correct scope
2008 Apr 23
0
How i write the respec in this situation??
Hi all guys!im new in rails! i have a forum,have_many topics,and the topic also has_many replies.Now i want to write the respec for the repliescontroller: describe RepliesController do controller_name :repies describe "All Requests",:share=>true do before do @forum = mock_model(Forum,:id=>''1'') @topic =
2007 Oct 19
11
Patch idea for rspec_on_rails
I recently wrote a matcher for testing AR associations which allows you to specify things like: Foo.should have_many(:bars).through(:bazes) I''m pretty darned proud of it and a couple of people have suggested that I should submit it to the rspec_on_rails project. Before I go to the trouble of writing out rdoc and fully spec''ing it, I just wanted to make sure this was
2012 Sep 12
1
[LLVMdev] [Patch] Metadata nodes and C API
Hi Anthony, You need to send patches to the llvm-commits mailing list to get them reviewed and committed. -Dave -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation > -----Original Message----- > From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] > On Behalf Of Anthony Bryant > Sent: Wednesday, September
2011 Mar 01
11
Did rails or shoulda go insane on the inflection of 'taxes'?
I have a model ''xp_jurisdiction_taxes'' which rails (3) created correctly. Another model ''xp_jurisdiction_states'' has many :xp_jurisdiction_taxes. In my spec I am using a shoulda helper to test the association but get the following error. BTW, greped the whole project just in case and the string ''taxi'' exists nowhere. 1)
2015 Jul 03
6
boot... round 2
Hi, poma wrote: > - "unsigned char c;" does not solve the problem > > - "c >= 0 && c <= ' '" solves the problem for the current git What the ... ?!? My proposal of "(c >= 0 ... )" was only made to avoid the need for a type change of variable "c". Both proposals should be equivalent ... on the first morning glimpse they
2003 May 28
2
SSH1 security with Kerb5
Hi, I am trying to decide if it is worth the time to test the Kerberos support in a port I am working on of Openssh 3.5p1. Does using Kerb5 with SSH1 solve the security problems inherent in protocol 1 and bring it up to par with the security level of SSH2 or are there other issues that Kerb5 authentication won't help for SSH1? Thanks, Greg Lambert --------------------------------- Do