similar to: Automatic timestamping in join tables [596]

Displaying 20 results from an estimated 400 matches similar to: "Automatic timestamping in join tables [596]"

2010 Jun 11
5
Issues creating tables in mysql tests
Hello, I''m a beginner, so any hints are appreciated; I''m still trying to find my way around Rails code. For a bug I''ve found I need to create a table called "values" so I added this: create_table :values do |t| t.integer :value end among the other table creations in activerecord/test/cases/migration_test.rb. Is that ok? But then, when I run the tests
2005 Dec 04
2
Adding sortables dynamically
Hi all, is there a way to define the containment option for a sortable so that it is a class name instead of an id list? I have a case very similar to the sortable lists demo, the only difference is that I'm adding new list containers dinamically, so either I need to redo the Sortable.create calls for all new elements to include the newly added container, or having someway to have them
2005 Jul 21
3
Question about sortables
Hi, I''m trying to use sortables to sort table rows and move them between different tables (yes, it''s actual tabular data ;). However, either I don''t know how to use the tag property of Sortable.create properly, or it''s only working for li''s. Since it''s probably the first option, could someone post an example of sorting tr tags and move them
2005 Dec 08
3
Uncomplete hiding on Firefox 1.5
Hi all, I have observed the following on Firefox 1.5 (both on XP and OSX): My page has some div containers that hold sortable ul. The div's also contain links for showing/hiding the contained ul's. No matter which effect I use to do the hiding and showing (Fade/Appear, SlideUp/Down, BlindUp/Down) the hidden ul's don't hide completely, leaving a blank 'trace' behind.
2005 Oct 04
5
sorting
I just want to confirm that it''s *not* possible to sort <tr>s in tables.... Jamie
2012 Dec 27
1
superclass mismatch for class TeeInput?
> I was trying to run Unicorn 4.5.0''s tests and I''m getting this. Am I doing something wrong? > > [vagrant at localhost unicorn-4.5.0]$ testrb -Ilib -Iext/unicorn_http -I. test > /home/vagrant/.gem/ruby/1.9.1/gems/unicorn-4.5.0/test/unit/test_tee_input.rb:7:in `<top (required)>'': superclass mismatch for class TeeInput (TypeError) > from
2006 Jan 09
4
Problem with habtm and resulting SQL insert
Cheers, I have a problem with 1.0 and a habtm relationship between User and Article. I want to save all articles that users read. I have these models: class User < ActiveRecord::Base has_and_belongs_to_many :read_articles, :class_name => "Article", :join_table => "read_articles" ... end class Article < ActiveRecord::Base has_and_belongs_to_many :readers,
2005 Jan 25
4
Collection_select with multiple options
Hi, I have built a select field that allows multiple options selected with collection_select and "multiple"=>"multiple". How do I go about receiving the values? If I use a variable name like collection[], it complains that I can''t use @collection[] as the instance variable. TIA victor
2005 Dec 05
3
Multi-level drag and drop in scriptaculous?
I am trying to create a screen like Google''s personalized home pages or start.com, i.e., with draggable sections, with the extra feature that the child items under the parent headings could be dragged and dropped from one parent heading to another. I have set up nested droppable sortables (dropOnEmpty=true) but the behavior is very inconsistent, i.e, parents do not become droppable
2005 Sep 27
3
Too much recursion
Hey Guys, I''ve just encountered this error in Firefox will I pulled the latest scriptaculous rc into project. Sadly, I don''t have a linkable page for you to look over at the point. My question is what is this error exactly? My code before this never got it but now it does. My few searches suggest it''s the browsers way of keeping infinite loops from happening
2006 Mar 13
3
HABTM: two habtm''s between the same two tables
Imagine I want to track people, and the clubs that they belong to. table people with columns person_id, person_name table clubs with columns club_id, club_name And I have the association table: table clubs_people with columns person_id, club_id Now I know how to do this habtm between the two, in order to associate people with clubs that they belong to. However my application also needs a
2006 Jan 02
5
DB Modelling the Rails way - Opinions??
Hi, I''m trying to figure the most efficient way to model the following. I can think of at least two ways to relate the tables but from a client/server perspective! I''m wondering how to best (and elegantly)relate them from an AR perspective. A project has many people, A person can work on many projects at any time, A project has many roles, A role is performed by a person, A
2006 May 22
4
naming convention for bridge tables.
I read somewhere that the correct naming of bridge tables is in alpha order. For example. I have two tables: houses, and colors. If I want to create a bridge table to associate colors with houses, I would name the table: colors_houses The associations work fine. But, if I have a table named: track_houses. Building a bridge table called: colors_track_houses, gives me model associaton errors.
2006 Jul 25
2
join in legacy DB?
I''ve got a problem with some tables that don''t follow any RAILS standards. how do I define the join in the model when all three tables have wacky names? class Machine < ActiveRecord::Base set_table_name "tbl_CodeMgmt_Host" set_primary_key "Id" end class Pool < ActiveRecord::Base set_table_name "tbl_CodeMgmt_Pool" set_primary_key
2007 Sep 06
4
HABTM association with own class?
If I have a class, Asset, which has and belongs to many associated Asset objects, how do I do this? has_and_belongs_to_many :associated_assets, :class => "Asset", :foreign_key => ?????, :association_foreign_key => ????? Right now, my table has a :first_asset_id and a :second_asset_id, but I don''t see how the objects themselves are supposed to distinguish one from the
2006 May 18
8
Concatenated key
Hi all, I started playing a couple days ago with Rails and it find it very interesting. But I''m a bit stuck with making it work with a concatenated primary key. I want to use my own names for the DB fields and I''m using SQL Server 2005. My tables look roughly like this: CREATE TABLE USERS ( USR_ID VARCHAR(25) NOT NULL PRIMARY KEY, USR_PASS VARCHAR(25) ) CREATE TABLE
2005 Dec 19
4
need some help designing my messaging system
I am trying to create a messaging system for my users but I''m having a hard time designing my db. This is what i have in mind, but I am not sure if its the best approach. user has_one inbox user has_one outbox inbox has_many messages outbox has_many messages inbox table user_id outbox table user_id messages table box_id (refers to either inbox or outbox - how?) from_id to_id
2009 Jun 04
1
wrong number of arguments (1 for 0)
Hi, I hope someone can help me because this is driving me crazy, I''ve spent hours trying to track this down. I''m trying to convert a Rails 1.1 to Rails 2.3.2 and I''m getting the following error when trying to save a many to many relationship. I''ve double checked all the associations, I''ve used console to test my models and they all work ok, I can do
2005 Dec 07
3
Addressing a class, rather than an id?
Good day, I''m trying to use the slider control to resize a pile of images on a web page. Clever, huh. Bet cha didn''t think of that one!!! :) But seriously. It seems I want to address a class, rather than the individual id''s of the images. At this point, I''m getting some results with something like this:
2012 Jan 20
3
Istalling Ruby 1.9.2
I just installed 1.9.2 on my 2nd machine, but after I installed I checked the version with ruby -v and it sent me 1.8.7 Here''s the terminal output...anyone know what''s wrong (I have RVM installed): Francescas-MacBook-Air:~ fkrihely$ rvm install 1.9.2 Fetching yaml-0.1.4.tar.gz to /Users/fkrihely/.rvm/archives Extracting yaml-0.1.4.tar.gz to /Users/fkrihely/.rvm/src Configuring