similar to: So how can I rewrite my app without using with_scope?

Displaying 20 results from an estimated 1000 matches similar to: "So how can I rewrite my app without using with_scope?"

2006 Feb 19
16
Open source rails e-commerce engine?
I''m pinging the list to see if anyone is working on an open-source e-commerce engine based on Rails yet - something like OSCommerice I guess. Anyone? Is there interest out there for such a thing? I have such a product which has been extracted from real world code. It currently runs 3 production rails sites in various shapes and forms, implemented as a rails engine. Basic feature list: -
2010 Aug 28
1
Alternative to merge_conditions in Rails 3
merge_conditions seems to be gone from rails 3. Is there something in Rails 3 or Arel that would allow me to achieve the same thing, which is to merge various types of conditions (array, hash, etc)? I haven''t spent much time with Arel, so I may be missing something obvious. Thanks -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2006 Jul 14
5
Acts_As_Taggable Plugin multiple controllers.
I have Acts_As_Taggable Plugin working. I have a HR controller and a sales controller. I have a document in hr tagged whitepaper and a differnent document in sales tagged whitepaper when I am in hr I see the hr document tagged with whitepaper and not the sale document (what I want). but if I click on the tag whitepaper I return two documents, hr and sales. I just want to return the hr document
2006 Jun 07
3
fedex tracking
I''ve been using the Business::FedEx::DirectConnect perl module to track and ship packages via FedEx for awhile now. I''m wanting to convert some of this functionality over to ROR, mostly just the package tracking part. Has anyone successfully tracked a package using the Shipping API out on RubyForge? It seems like the functionality is there since it''s just another
2007 Oct 18
9
with_scope issue
I have the following code: class User < ActiveRecord::Base has_many :requests do def find_active(options = {}) with_scope :find => { :conditions => ["requests.active = ?", true] } do find(:all, options) end end end end Executing user.requests.find_active results in the following SQL: SELECT * FROM requests WHERE (( requests.user_id = 10 ) AND (
2007 May 08
3
assert_difference eval magic in [6693]
I just saw Marcel''s change to assert_difference that changes the method API to take a string param that is evaled in a lambda. http://dev.rubyonrails.org/changeset/6693 I much preferred the old API, since it''s simple enough to pass a lambda. Passing a string means the lambda is in the wrong scope and doesn''t have access to objects in the test case scope. For an
2006 Apr 01
1
STI with_scope on parent - bug or feature?
Hi, It seems that setting a with_scope on the parent class doesn''t do anything MyClass.with_scope(:find=>{:conditions=> ["somecol = ?", ''val'']}) do @ext_pages, @ext_rows = paginate :my_extended_class, { :per_page => 13 } end # this doesn''t generate WHERE somecol=''val'' In order for scope to work you have to call
2011 Jul 11
2
Can't get this Rspec test to pass
Hello, I''m completely new to Rspec testing and I''m finding it very difficult to mock specific objects. In this test, I have a before block setup as such: [code] before do setup_controller_for_warden controller.session[:operation_id] = 1 @operator = Factory :operator sign_in :operator, @operator @persist_herd = Herd.new
2007 Aug 21
3
Eager Loading
is there a way to always eagerly load an associated object so that you don''t have to put :include into every finder? class Product <ActiveRecord::Base belongs_to :user #always load user when product is loaded end Product.find(1).user.login #1 query since user was loaded with the product, same as if i used :include but I don''t want to have to specify it everywhere.
2006 Feb 13
1
hackish error handling
I''ve got a block of code that''s turning out.. well - just plain ugly. So i know I must not be doing it the Ruby way. The main problem I''m having is in dealing with handling errors - and just not finding much Rails documentation that gives a deeper understanding of how to handle errors in Rails (outside of several docs on the catch-all''s) the main method
2006 Sep 08
1
has_many relationship extensions and scoping rules
Hi all ! Is this supposed to work ? class Email < ActiveRecord::Base has_many :to, :class_name => 'Recipient', :conditions => "recipients.source = 'to'" do def create!(*args) with_scope(:create => {:source => 'to'}) do super end end def build(*args) with_scope(:create => {:source => 'to'}) do
2006 Nov 21
2
Accessing scopes
If with_scope has been called previously, how do I access the find conditions dynamically? I am asking because I am using a find_by_sql call (which clobbers the with_scope). How can I access the method scoping so that I can read it and incorporate it into my query manually? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google
2010 Jan 05
1
PDC directory permission fail
Dear All .. I use webmin to do the samba PDC configuration The authentication is work well. I've a problem with share permission, the condition is : 1. I've group named "warehouse" 2. I've user named "wh01", with home dir /home/wh01, and be a group member of "warehouse" Both created via webmin. 3. Next I created share, named "warehouse"
2005 Apr 27
1
Ruby Shipping
To accompany the Payment library (http://payment.rufy.com/), I have created the shipping library that connects APIs for various shippers like UPS and FedEx. It is available as a ruby gem: gem install shipping or from rubyforge http://rubyforge.org/projects/shipping There is going to be some data that will persist for all shipments. For example, you will not want to repeat the fedex account
2006 Mar 24
1
handle multiple warehouses
Hello all, I am working on building a web store with RoR. The company has many locations. All the stock/order information is processed through the same site. Here is my question. How would you handle the multiple warehouse problem with Rails? How would you keep track of the information in multiple warehouses? Thank you for your help, PV -- Posted via http://www.ruby-forum.com/.
2006 Feb 24
4
Understanding controllers
You''ll have to forgive me ... I''ve been toying with rails for about a week and although I don''t feel completely lost there''s still a lot that I don''t understand. Here goes. Assume I have a controller called admin in app/controllers as well as three model classes in app/models: product, category, warehouse. How exactly do I use the admin controller to
2008 Feb 18
3
Displaying a base64-encoded image within an rhtml template
I''m working on generating FedEx labels for quick & easy shipping. FedEx returns the label as a base64-encoded string. Assuming that ''match'' is the base64 string containing the label data, here is what I have to display the image: send_data image, :filename => ''fedex_shipping_label.png'', :type => ''image/png'', :disposition
2006 Jul 23
4
Anything like with_scope for ActionController?
There are areas of my application that "want" to use a url structure like domain/<human_readable_param>/<Module>/<Controller>/<Action>/<Id> Please note that the human readable parameter I need to inject is NOT related to the <id> being used by the action/controller pair. It''s identifying a container object whose contains are operated
2010 Dec 16
12
Capybara + radio buttons
How do I select a radio button when both id and name are identical?: <input type="radio" name="BILFPB.bilPremieUppgifterFI.under24" tabindex="13" value="J24" checked="checked" id="forare">Ja <input type="radio" name="BILFPB.bilPremieUppgifterFI.under24" tabindex="14" value="N24"
2009 Apr 19
19
Controller spec: testing that scope is set
In a Rails controller I set the scope on a model class in an around filter. I have defined expectations on the model classes, and ideally, I would add a further expectation for the scope. Is this already possible in some way? How would I go about adding support a scope expectation? Michael -- Michael Schuerig mailto:michael at schuerig.de http://www.schuerig.de/michael/