search for: item_type

Displaying 10 results from an estimated 10 matches for "item_type".

2006 Mar 30
4
Select List to change type of STI class
Hi: I''m trying to create a drop-down list to change the type of a Single Table Inheritance class. I tried this: <%= select :user, :type, [ [''Author'', ''Author''], [''Editor'', ''Editor''], [''Administrator'', ''Administrator''] ]
2006 Apr 22
6
STI and type tables?
...STI, I would have something like: create_table :items do |t| t.column "type", :string t.column "title", :string end But if I want to store those type values in a separate table, such that I have ... create_table :items do |t| t.column "item_type_id", :string t.column "title", :string end create_table :item_types do |t| t.column "name", :string end How would I do that? Bruce
2013 Jun 04
0
[PATCH] Btrfs-progs: fix incorrect root backref errors in fsck
...io.com> --- cmds-check.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cmds-check.c b/cmds-check.c index bbef89a..4083298 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -1507,14 +1507,16 @@ static int add_root_backref(struct cache_tree *root_cache, } if (item_type == BTRFS_DIR_ITEM_KEY) { + if (backref->found_forward_ref) + rec->found_ref++; backref->found_dir_item = 1; - backref->reachable = 1; - rec->found_ref++; } else if (item_type == BTRFS_DIR_INDEX_KEY) { backref->found_dir_index = 1; } else if (item_type == BTRFS_ROOT_...
2009 Feb 20
6
How to mock an object defined in the before_filter function?
...ment.stub!(:id).and_return(1) @comment.stub!(:destroy).and_return(:true) controller.stub!(:find_comment).and_return(@comment) # execute ajax request request.env["HTTP_ACCEPT"] = "application/javascript" post :destroy, :comment_id => 1, :item_id => 1, :item_type => "Space" response.should render_template("destroy") end end
2006 Jul 29
0
SOAP for large datasets
....find(:all, :include => [:orderitems, :histories], :conditions => ["history.trans_date between ? and ?",start_date,end_d ate], :limit => 500) for order in @orders oi = [] for items in order.orderitems oi << OrderitemData.new(:sku => items.sku, :item_type => items.item_type, :descript => items.descript, :amount => items.amount, :quan t => items.quant, :trans_id => items.trans_id, :trans_date => items.trans_date) end trans = [] for history in order.histories trans << TransactionData.new(:sale_type =...
2007 Aug 23
0
active scaffold polymorphic model
Hi I am trying to use active scaffold to build a polymorphic model . I have a number of models that can be featured and I have a Feature model that belongs_to :item, :polymorphic => true In my config.columns I include :item_type and item_id, I also added :item_name to show the name of the record in the form. In the form, when a type of model is selected I populate the select box for item_name with with the names of the relevant records with the id of each as the value. I set the id of the select box to item_id instead of i...
2011 Jan 19
6
rake aborted! can't convert Hash into String
Hello, I encouter a problem when i try to do "rake db:migrate": rake aborted! can''t convert Hash into String Here is the trace result: ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment rake aborted! can''t convert Hash into String /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1408:in
2006 Oct 02
22
Multi Byte Strings
Hey guys, We''ve been talking about the multi-byte patch and I think it''s time to get feedback from you guys on a possible way forward. We can include ActiveSupport::Multibyte with rails 1.2, and update all of the relevant helpers to use the String#chars proxy. This will mean that none of the action view helpers will mangle multibyte strings. Similarly, if any Strings are being
2006 Jul 19
5
weird result for a custom attr reader!
Hi all, I am having a weird problem reading a value from my model. basicaly, I have these two models: class Category < ActiveRecord::Base acts_as_tree :order => "name" belongs_to :item_type has_many :specific_category_names end and class SpecificCategoryName < ActiveRecord::Base set_table_name "Specific_category_names" has_many :products belongs_to :brand belongs_to :category #if there is no name, use the name of the category def name if @name.nil?...
2011 May 13
18
Thoughts about extlookup: http://blog.wl0.org/2011/05/thoughts-about-extlookup-in-puppet/
Hi, I have been trying to improve the coding of some of my puppet recipes and had some trouble so wrote this: http://blog.wl0.org/2011/05/thoughts-about-extlookup-in-puppet/ Comments on the web seem to indicate that extlookup() solves "all problems" but I don''t really see that and hence have proposed a possible way to keep the data closer together and make the extlookup()