search for: listing_id

Displaying 7 results from an estimated 7 matches for "listing_id".

2006 Mar 30
5
Heeelp - no idea what''s going wrong.
...name varchar(100) not null, category_id int not null, constraint fk_items_category foreign key (category_id) references categories(id), primary key (id) ); create table listings_subcategories (practically a duplicate of categories_listings, which works) subcategory_id int not null, listing_id int not null, constraint fk_cp_subcategory foreign key (subcategory_id) references subcategories(id), constraint fk_cp_listing foreign key (listing_id) references listings(id), primary key (subcategory_id, listing_id) ); When I try to create a listing with subcategories the array subca...
2006 Jun 26
4
has_many :through
...ase belongs_to :keyword belongs_to :listing end the problem is, when i loop through all the @listing.keywords, I get ALL the keyword_links instead of just the keyword_links for that listing. For instance, if my @listing has an ID of 7, I''ll still have keyword_listings with ''listing_id''s of 2, 3, etc. i notice (in the logs) when I loop through @listing.keywords and access keyword_link, AR makes a query of SELECT count(*) AS count_all FROM keyword_links WHERE (keyword_links.keyword_id = 13) obviously missing the listing_id part of the WHERE. what am I missing to make t...
2006 May 30
1
Can''t read from file field second time around
...ge).first I am basically doing this in the controller and it fails on the second attempt - to resize and save the medium size image: if @params[:listing_image] @thumbnail_image = ListingImage.new(@params[:listing_image]) @listing = @session[:listing] @thumbnail_image.listing_id = @listing.id @thumbnail_image.image_type = "thumb" @thumbnail_image.resize if @thumbnail_image.save! @med_image = ListingImage.new(@params[:listing_image]) @med_image.listing_id = @listing.id @med_image.image_type = "med"...
2006 Feb 25
5
MySQL client ran out of memory
I''m getting the following error unexpectedly for my rails app. I just exported the databae from dreamhost and imported it on textdrive for my rails app. Mysql::Error: MySQL client ran out of memory: SELECT COUNT(*) FROM comments WHERE (comments.listing_id = 2666) /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract_adapter.rb:88:in `log'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:180:in `execute'' /usr/local/lib/ruby/ge...
2008 May 06
10
Best way to implement?
So I''m new to all this Rails stuff and this is probably a database design-related question to, but here it is... Just for learning I''m trying to build a little real estate listings application. Of course there is the listings model which will store basic information like name, price, description, and all that jazz. I''m to the point where I want to figure out how to
2008 Jun 15
7
Getting "no block given" on find method - rails 2.1
I am trying to do a simple find through the current_user but get an exception. Either someone spiked my Starbucks coffee and I am screwing up all over the place or there is something wrong. def index @league = current_user.leagues.find(13) end # Error LocalJumpError in Admin/schedule todosController#index no block given If I pass a block to it it works fine, but it is just messy: =====
2006 Jul 14
20
Method for associated relationships
I have these tables set up like this: listings has_many :states <field>state_id [int] <other fields.... .............. .............> states belongs_to: listings <field>name <other fields.. ............... .................> In my view I have <%= listing.name %> have also tried listing.state_id.name , that didn''t seem to do the magic either. This