similar to: Stuck on ActiveRecord

Displaying 20 results from an estimated 1400 matches similar to: "Stuck on ActiveRecord"

2007 May 11
2
spec a replace_html with a partial
I wanted to use ARTS to add RJS in a behaviour driven way to my application, but I''m having some trouble asserting a replace_html with a partial. I''ve created a pastie (http://pastie.caboo.se/60694) which contains the RJS I want to spec, the spec which I already wrote and its failure message. I''m currently using RSpec-0.9.2
2007 Sep 05
8
Hi..Guys new plugin again
Hi.. Guys new plugin again Foreign Key Associations is a plugin that automatically creates associations based on foreign-keys. The associations are created at runtime-ie. as your ActiveRecord models are loaded-so they will always be up-to-date. For example, given a foreign-key from a customer_id column in an orders table to an id column in a customers table, the plugin creates:
2013 Feb 18
6
How to clear ActiveRecord query cache on associations with dynamic table
In part of my application I''m using dynamic tables. I''m aware of the single thread conditions. I''ve tackled some caveats yet - will post a blog about it soon - but there''s one I need help with. Consider 2 models that are associated: Order and OrderLine where Order has many order_lines. Now we set the table names for them:
2006 Mar 29
13
Rails on Mongrel
Hi, After following advice from you good folks, I gave mongrel a try in a cluster design based on the example on the Mongrel website - and it worked right out of the box which is great - and it''s very fast :) I have got a bit stuck though. I have two MS Word files in /public/files/. I can pull back these files no problem but it isn''t sending a mimetype. I think I have two
2006 Mar 28
6
Deploying rails...
Hi, I thought I''d give lighttpd and FastCGI a go but the latest version I''ve found for fastcgi is 2.4.0 which was released in January 2003. Is this the right version? Can anyone recommend the versions I should use for FastCGI et al and where to find them? I''m not sure I''ve really found what I''m looking for... -- Posted via
2006 Mar 21
1
Form Validation
Hi, I''ve got an interesting one here :) I have a form with three fields : serial_number initial surname now, if serial_number is entered, it must be between 1 and 64000. If it''s filled in, the other two fields must be blank. If serial_number is left blank then the other two boxes must be filled. Any suggestions? -- Posted via http://www.ruby-forum.com/.
2007 Apr 11
12
redirection doesn''t get detected well?
I''m doing a redirect in one of my controller actions and somehow I can''t spec it, see this pastie: http://pastie.caboo.se/53120. When following the link from a browser I''m being redirected to the right page. -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Jun 25
2
Working out sales tax...
Hi, Having googled extensively about storing money in Rails, it seems to be accepted that the best way is to store the prices etc in the smallest part of the currency so that you can use an integer i.e ?20 would be stored as 2000 pence. This is fine and I''ve made a nice pretty wrapper that outputs the price in the standard form for invoicing and what not - but here I''ve
2006 Apr 12
1
URL Paths
Hi, I''m looking to rewrite an existing app in Ruby but it makes extensive use of URL paths. For example a site would redirect to : /Portal/foo/ and from this I could tell that ''foo'' was the site that did the redirect. Of course when I try this with Ruby I get "method not found" which is hardly surprising. I''ve had a quick look round google but
2006 Apr 17
1
SOAP and exceptions
Hi, I''ve been doing more searching, and I''m kinda stuck on how to send back error messages to a SOAP / XML-RPC client if say for example the username and password they supplied were incorrect. Can anyone point me in the right direction? Cheers, Pete -- Posted via http://www.ruby-forum.com/.
2006 Mar 23
3
Returning CSV data to the client
Hi, One of my apps has to export data for the backend system to process it. What''s the best way to create a CSV file in Rails and then return it as a file to the client? i.e when they go to the link /csv/get_data it would return a csv file. I''ve been messing with the CSV library and I can get it to write out to a file, but not sure how to best use this in a web app. Hope
2006 May 02
3
Ordering Results returned by has_many relationship.
Noob Question 31,265,232 if I''m searching on an object, say order, that has many "order_lines" and I want to display order lines by Quantity ( an attribute of the order_lines ) descending how could I do that without having to do a find() with :order, but something like; Order.order_lines.each do |ol| <!-- code to diplay the line --> how can I determine the field
2006 Jun 24
2
Migrations problem with Agile Rails book
I am following the instructions on Agile Web Development with Rails book "Iteratio E1: Capturing an Order" section. When I run the migrations I get the following error. rake db:migrate (in /Users/balaparanj/work/depot) -- execute("alter table line_items \n add constraint fk_line_item_products \n foreign key (product_id) references products(id)") rake
2006 Dec 07
2
Problem saving parent and children using belongs_to, class_name, and foreign_key
Hi, I have a real simple association setup here that''s just trying to: - Create a new PayjunctionOrder - Create some LineItem objects and assign them to the PayjunctionOrder - Save everything I''m using Rails Edge. ---- class PayjunctionOrder < ActiveRecord::Base has_many :line_items end ------------------ ---- class LineItem < ActiveRecord::Base belongs_to :order,
2011 Jun 04
0
Rails 3.1 : Complex database query with Arel 2
Hi, I''ve search for documentations on queries with Arel 2 but there is pretty nothing and all I''ve found is for Arel 1 so I''ve run into NoMethodError: undefined method `[]'' for #<Arel::SelectManager:0x00000003f1b820> errors with join syntax. My query is barely simple but involve nesting queries. I have 4 tables. Assets, Deposits, Orders and OrderLines
2006 Jun 06
3
Invoice and invoice_lines
Hello People, I have a possibly very lame question. I am fairly new to RoR, and I want to make sure I do it "right". I have a model called Invoice, and one called InvoiceLines. Usual story: the table "invoice" has a 1:n relationship with "invoice_lines", which includes invoice_id. Now... the application will have a "new order" button, which will allow
2006 Mar 01
2
active_record postgresql adapter problem
Instead of using numeric I created the field "unit_price" as PostgreSQL type money. Now when I try and add a row I get the following. How do I override AR default behaviour to cast numeric post data to money, or am I forced to only support database types that active_record knows about? RuntimeError: ERROR C42804 Mcolumn "unit_price" is of type money but expression is of
2007 Feb 16
4
Ideas for rails
Here are a few suggestions, wondering what others thought: When you generate a model for a DB table, it would be nice if the model.rb contained the DB schema (kind of like # commented out schema) right in the model file. This would make reference WAY easier and put all of the DB stuff in one easy file. Thanks. also nice, of course, woudl be for rails to try and ''guess'' the
2008 Oct 21
1
How to force a lock_version increment
Hi everyone, I have a order with order_lines use case. On changing the lines, I want to be sure no one else changed the order. So I use lock_version on the order. This works fine if something is changed on the order record. But now i have the situation that I delete, alter and add order lines without changing the order record itself. I have to check and increment the order#lock_version however
2006 Apr 01
3
Ignoring Validations In An Admin Tool?
I have the following validation on and ''Order'' model: validates_presence_of :order_lines, :message => ''missing one or more products.'', :on => :save Ok, great. An order has to have products. Ok. Problem is, there are some old orders that don''t have lines (don''t ask) and in the admin tool we need to be able to work on these orders.