similar to: How to retrieve attributes from HABTM?

Displaying 20 results from an estimated 800 matches similar to: "How to retrieve attributes from HABTM?"

2006 Apr 05
7
Regex for splitting string
Hi We have a search website where the user can type in individual words separated by spaces and/or phrases enclosed in single or double quotes. We are looking for a way to obtain a list of words and phrases from the search string. Can someone help? Thanks, Yash -- Posted via http://www.ruby-forum.com/.
2006 Feb 08
2
How to install RailsCron?
Hi, I would like to start running a background procedure once a user logs in to his account on the website. For this I am considering using the RailsCron object. However, I am not able to download it. I am new to Rails. Can someone give me the excat command I should use to get RailsCron? Can someone suggest a better way of running a procedure in the background? Thanks -Yash -- Posted via
2006 Mar 15
1
push_with_attributes not inserting default values
I have a join table A_B with columns[a_id, b_id, c_data default 1, d_data default 1]. If I do: @aobj.bobjs.push_with_attributes(@bobj,{:c_data => 0}) I find that the row inserted, has d_data set to 0 and not the default value specified in the database, which is 1. So I am having to explicitly set it using : @aobj.bobjs.push_with_attributes(@bobj,{:c_data => 0, :d_data => 1}). Is this
2008 Mar 07
3
Boolean circles..
Hi, This is just kindof a RoR question, but since you all potentially do the same things as I do, I thought I''ll ask here.. Im trying to use the boolean type in the database. Migrations is no problem, it even converts the 0/1 values from my import CSV to false and true. However, I cannot make the :conditions part of a find work: Loading development environment (Rails 2.0.2) >> c
2006 Feb 11
1
How to POST raw data?
Hi, I know that ActionController::AbstractRequest provides a raw_post method that reads the data that has been posted to the HTTP server as raw data. I am trying to create a rails application that POSTs raw XML data to a web page that reads raw data. I would like to know how to POST raw data to an HTTP server using Ruby on Rails. Can you help me with this? Thanks, Yash -- Posted via
2006 Feb 11
1
Instructions required for RailsCron
Hi, I am writing a client-server rails app. The client and server maintain similar databases. Periodically, I would like them to synchronize their databases. For this, in the application, once the user logs in, I want to spawn a background process at the client that first sends the client''s new data and then receives the server''s new data. I am thinking of using RailsCron for
2006 Aug 10
1
Convert datetime_select to Time object?
-------------------------- Question 1 -------------------------- I am dealing with a database that holds products and it has a datetime field called "active_at". so I have the following for active_at: <%= f.datetime_select :active_at %> It gives me 5 different params: params[:product][:active_at(1i)] params[:product][:active_at(2i)] params[:product][:active_at(3i)]
2006 Mar 30
1
What is the entry-point for a rails app?
Hi, I would like to run a DOS command such as "net send ..." when I start the rails application using script\server. Can you please tell me where I need to put the call? Is it environment.rb by any chance? -Yash -- Posted via http://www.ruby-forum.com/.
2007 May 11
3
is_active?
Hey all, i''m rather new to rails and was curious if ActiveRecord implemented anything like is_active where the delete functions would just mark records as inactive, vs deleting rows. (similar to created_at, etc). I need a history of transactions, and this is how I would code in other languages. Any advice? Is there are smarter way to implement this? Thanks in advance! -- Posted via
2006 Jun 05
7
Is HABTM Dying?
For a while, I''ve been getting that HMT is replacing HABTM. It appears that HMT can do all of what HABTM can do and more. The question is: Should I stop using HABTM? Let''s take a simple case: A case has many categories For a given category, there are certain valid statuses Category has_and_belongs_to_many :statuses Status has_and_belongs_to_many :categories Question: Is
2006 Jan 20
11
HABTM relations
Hi, I have 3 tables with HABTM relation. USERS -> QUOTE_TO_USER <- QUOTES Table QUOTE_TO_USER has 3 attributes: quote_id, user_id, component. I have a form where I can tie multiple users to QUOTE. This is easy one, thru "user_ids" (@quote[:user_ids] = @params[:quote][:user_ids]). In this form I have all users and I just check those I want to tie to this quote, however
2006 Apr 29
5
HABTM - how to insert join row when associated rows exist
I have successfully used HABTM to create a many-to-one-to-many set of rows in one step. Now, if two objects I want to associate already exist, how do I create the join row? The Agile book mentions the ''push_with_attributes'' method. The text says this method is useful for adding additional attributes to the join row (in the example a ''read_at'' timestamp). I
2006 Feb 21
7
Self-referencial habtm relationship
Heyo! I am setting up a self-referencial habtm relationship with the users of my app. I am using Chad Fowler''s "Rails Recipes" to get me started, and everything works great with the join table "people_friends". I add friends by doing somebody.friends << somebodyelse. However, with my app, there is an approval process so my join table has columns person_id,
2015 Oct 05
1
Dovecot don't erase mails from storage.
Hi, I have a dovecot installation with a strange problem: all the mails stays in storage after deleted from users mailbox. If user logon after the mails are deleted, they don't receive them any more, but the m.## files aren?t deleted. This happens with pop3 (default for this installation) and/or imap. The dovecot is installed along postfix with mysql and multi-domains support Here's the
2006 Jul 10
7
What is has_many :through really buying you over HABTM?
So having just learned how to do has_many :through as opposed to HABTM, and then, being concerned that I wouldn''t get it to work, I started thinking about these two approaches. It seems to me that the _only_ problem that the HM:T (has_many :through) approach solves that HABTM doesn''t is the issue of the potential collision of id columns between your join table and one of
2006 Feb 07
1
habtm :uniq causing duplicate inserts? How to update Rails?
Hello *Gem* experts, Sorry for asking multiple questions in one post but they are both related to one problem. So far I have the following code: class Member < ActiveRecord::Base has_and_belongs_to_many :blogs, :uniq=>true ..... end class Blog < ActiveRecord::Base has_and_belongs_to_many :members, :uniq=>true ... end The issue is that
2006 Jan 29
9
Specify options with habtm
Hi all I have the following models: class member has_and_belongs_to_many :disc_jockeys end class disc_jockey has_and_belongs_to_many :members end The relation table is called disc_jockeys_members and has the following fields: disc_jockeys_members(disc_jockey_id, member_id, status) So far, the field status can have values like valid, invalid, locked etc., but it is not regarded yet by
2006 Jun 30
4
ActiveRecord Migrations, without autonumbered PK''s
I love using ActiveRecord Migrations to build tables. Sometimes, I don''t want to use autogenerated PK''s - I want to set them automatically (why? I''m importing read only data from a large list of medications, and want to use the PK''s assigned by the medication research company...). Is there anyway to do this using Migrations? I know that I don''t
2005 Nov 16
1
HABTM: deleting records based on attributes
Hello All, I am new to ROR, and can''t seem to get HABTM to cooperate entirely... however I might be abusing it! Before I try a different strategy I thought I''d ask here and see if I''m missing something simple. So say Projects and Companies are related. Projects can have multiple Companies, and Companies can be on multiple Projects. But, the same Company can also
2006 Mar 21
8
How to avoid multiple submits/posts?
Hello, How do I prevent previously submitted form data from being reinserted into the database when the user presses the browser''s Refresh button? On Aughey''s advice in #irc I tried using `redirect_to'' a new `:action'' but this approach doesn''t seems to work. Any idea what might be wrong or how to tackle this problem? Thanks for your help. P.S.- I