search for: othermodel

Displaying 6 results from an estimated 6 matches for "othermodel".

2008 Jul 28
1
callback executed like after_save but after transaction
.../bin/update_models -i #{self.id}` end # controller action delete def delete MyModel.find(params[:id]).update_attribute(:deleted_at, Time.now) # after_save is called when the table end But in this situation: # controller action new def new MyModel.transaction do newmodel = MyModel.new othermodel = MyOtherModel.new ... other code ... newmodel.save! othermodel.save! end end after_save gets called inside the transaction, and so the database is not up to date! I''ve looked into ActiveRecord::Observers but this also faces the same problem. Is there any way around this? -...
2006 Jan 12
8
Scaffolding support for many-to-many editing (habtm)?
Like with simple table editing, there are also typical ways of how a user usually interacts with one-to-many or many-to-many relations. For example, one would show the fields of one row of table1 in the screen and below a line-by-line view of all associated entries in table2. Then, one could press an "Edit" button and add or delete rows from table2 to this entry of table1,
2007 Jan 23
11
dynamic tablenames
Hi List! May I tap into your combined common sense ? I have a legacy logging app that needs to be modernized. At the moment, Data is going to be stored in 5 tables, one table is going to contain more than 200 million and 2 others about 60 million rows. Mysql will be used, unless someone sees a major advantage in using something else (at the moment data is stored in a raw positioned file format,
2009 Mar 17
11
Refactoring module
Dear all Please see the following module, In module SX3 SX4 and SX5 have similar class Tasklist, but inherit from different class. I will use the following code to connect to different data sources RemoteSX3Model.establish_connection sx3_hash RemoteSX4Model.establish_connection sx4_hash RemoteSX5Model.establish_connection sx5_hash How can I refactor my code in module to look simpler? Thank you
2008 Feb 21
7
looping through a list
what is the proper way to loop through a list in a rails view (assuming that you need to check if it is empty or not) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2007 Nov 25
15
Possible Problem with RSpec and
Sorry to be such a pest but I am trying to learn Ruby, Rails and RSpec all at one go and it is a bit overwhelming. I have previously completed the depot tutorial in the Agile Web Dev with rails book and now I am trying do do it again using RSpec. What I would like to know now is why I am getting a rake failure error at the end of every spec:models run. Is this the expected behaviour when a test