similar to: ActiveRecord belongs_to ActiveResource

Displaying 20 results from an estimated 1000 matches similar to: "ActiveRecord belongs_to ActiveResource"

2006 Apr 17
2
has_one problem in a form
Hello all, I have a syntax question. How does one refer to a field brought in via a has_one/belongs_to relationship in a form helper? Basically, I have two models: class Resource < ActiveRecord::Base has_one :other_thing end class OtherThing < ActiveRecord::Base belongs_to :resource end It has the normal id-resource_id foreign key relationship. OtherThing has two fields, plus the
2009 Jun 24
3
ActiveResource:: HttpMock
I''m trying to set up testing on my ActiveResource project. The HttpMock appears to be what I want, but whenever I use the code in the "documentation", I get the error NameError: uninitialized constant ActiveResource::HttpMock Is there something I need to do to enable HttpMock testing? Thanks, Tom
2010 May 15
3
ActiveResource Mock Objects
Some of my tests use ActiveResource HttpMock requests and some of them do not. Does anyone know if there is a way to disable the HttpMocks after they have already been loaded? The method ActiveResource::HttpMock.reset! only removes all the objects, but ActiveResource still thinks it should look for mock requests rather than actually making requests. I hope this makes sense! Thanks, Tom --
2010 Jul 02
3
Ticket #5038 ActiveResource not handling updates correctly
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/5038-activeresource-not-handling-updates-correctly I just added this ticket. I''m writing a Sinatra API to be consumed by Rails and I''ve run into an issue where the ActiveResource documentation specifies that on update you should return an HTTP 204 status with no body. The problem is that Rack doesn''t
2008 Sep 04
0
ActiveResource testing
Hi, I''m trying to make some good testing on active resources, but I''ve some trouble with the *post* method. Basically this is my mock, where I set the POST verb and the expected URI. ActiveResource::HttpMock.respond_to do |mock| mock.post "/locations/buildings.xml?description=new- description&name=new-name", {}, @variable, 201 end Now, if I call the post
2010 Aug 29
0
Troll - A Rails plugin for making webservice mocking easier
Hi Folks, Troll trumps your existing ActiveResource mocking libraries like inbuilt HttpMock,Fakeweb or Webmock out of water. With Troll, ActiveResource mocking just works, some of its features: 1. Don''t need to mock calls at Net::HTTP level (which webmock,fakeweb do). Really, we don''t care what HTTP library ActiveResource uses, fakeweb and webmock bring additional complexity
2007 Oct 25
1
Mocking/Stubbing help with subdomain as account key
My app uses account_location to set up subdomains as account keys. In my controllers, all my model operations are scoped through the @current_person object. The question is: How do I test this with RSpec''s mocking and stubbing? Basically, I need to test that @current_person.things is getting the find message and returning @thing. I''ve tried stubbing and mocking
2008 Mar 01
0
Testing XML over HTTP in a Rails app
Hi I''m looking at testing the XML API methods of my RESTful controllers -- create, update etc. I thought this would be really straightforward, and perhaps it is, but I''m struggling to find a good explanation of how to go about it the Rails way. Firstly, I can successfully test it from the command line using curl, e.g: curl -H "Accept: application/xml" -X GET --basic
2006 Mar 15
4
[NQ] How to set an initial FK for a new item of something?
Hi all, running into a little problem here. I''ve a list of things with a "New thing" link beneath it. When you click that link, obviously, a new thing shall be created. Now, that works pretty fine for things that don''t have foreign keys, but for things that do it crashes, since there is not yet a thing.other_thing.name available. I suspect you can somewhere in
2009 Jul 24
1
Modifying ActiveResource classes
I''ve been struggling with an issue with ActiveResource for a bit now: when a hostname resolves for an ActiveResource request, but there''s no server on the other end to return information, ActiveResource''s timeout value doesn''t work. The request just hangs. After reviewing the ActiveResource code, I''ve realized that this is because the underlying
2009 May 20
1
activeresource-2.3.2 HTTPHeaderSyntaxError
Hi, I''m upgrading my app from 2.2.2 to 2.3.2 and am having a problem with ActiveResource. class FooResource < ActiveResource::Base self.site = "whatever" self.element_name = "foo" end FooResource.create(:bar => ''baz'') raises: Net::HTTPHeaderSyntaxError: wrong Content-Length format from
2007 Jun 21
2
does activeresource only work with edge?
hey all, I''ve just installed the activeresource gem and it wasn''t working, so I did gem update rails and it worked. But now I have rails-1.2.3.6906 and I think this is edge right? Is there a way to work on regular rails 1.2.3 with activeresource? thanx in advance Pat --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to
2006 Aug 31
0
ActiveResource
I''ve been sitting on an ActiveResource patch for a few weeks, waiting to get some feedback from David. But, I see other folks like Jeremy are starting to use it, so I committed my patch: http://dev.rubyonrails.org/changeset/4890 It gets all the basic operations in working order, and adds support for prefixes. I wasn''t quite sure how to pull this off. Right now, I''m
2007 Jan 05
0
ActiveResource cache using memcache-client
I''ve created this class that overrides methods for find,delete,destroy,reload, and save in activeresource. The code populates a local memcache daemon and uses that cache for future find requests. I''m posting it here to get whatever feedback people have. I''m most interested in the pro/con of inheritance over a mixin and how such a module might be tested. $ cat
2009 May 28
0
Re: ActiveResource as API test rig? Two jsons?
bump... On Wed, May 20, 2009 at 3:57 PM, Marc Byrd <dr.marc.byrd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > Hi, > > I''m using ActiveResource as an API test rig for an API we''re developing for > our PHP app - the goal being to validate that we''re following some > externally validated conventions for ReSTful API and that we can support at >
2007 Jul 04
1
Edge Rails required for ActiveResource
Just wanted to make sure I''m not missing anything here... I''m trying to use ActiveResource and I was trying to avoid using Edge Rails. However, since ActiveResource depends on the edge version of activesupport, I appear to be stuck going edge... have flailed around for a while trying to get ActiveResource to work with 1.2.3 but it just ain''t happening. Am I right? Gotta
2009 Jul 16
1
ActiveResource timeout not functioning?
I''m trying to contact a REST API using ActiveResource on Rails 2.3.2. I''m attempting to use the timeout functionality so that if the resource I''m contacting is down I can fail quickly - I''m doing this with the following: class WorkspaceResource < ActiveResource::Base self.timeout = 5 self.site = "http://mysite.com/restAPI" end However, when I
2009 Sep 09
0
ActiveResource - Two simple questions
I''m struggling a bit with implementing ActiveResource on a custom RESTful API. Firstly, I can''t seem to disable the transforms it does when it parses the XML. For example "CamelCase" gets rendered as camel_case, likewise underscores get converted to dashes. The docs page for ActiveResource mentions being able to set ActiveSupport.camelise_xml = false In an
2006 Sep 01
2
Include ActiveResource
Hello, I want to give ActiveResource a spin. I have all the code checked out from SVN in vendor/rails (yes, including ActiveResource). I''m trying to make sure it gets loaded. I did this in environment.rb: config.load_paths += %W( #{RAILS_ROOT}/vendor/rails/activeresource/lib ) Unfortunately I still can''t use it. I have an ActiveResource derived model, Address: class
2007 Sep 22
4
ActiveResource, find(1) works but no find(:all)
Hi, I''m on edge and Fuser.find(1) works but Fuser.find(:all) shows the error [1]. Fuser is declared here [2]. Do you know what''s happening? Thanks. [1] ActiveResource::ServerError: Failed with 500 Internal Server Error from /.../vendor/rails/activeresource/lib/active_resource/connection.rb:124:in `handle_response'' from