Displaying 20 results from an estimated 6000 matches similar to: "Release Retrospective"
2007 May 08
3
assert_difference eval magic in [6693]
I just saw Marcel''s change to assert_difference that changes the
method API to take a string param that is evaled in a lambda.
http://dev.rubyonrails.org/changeset/6693
I much preferred the old API, since it''s simple enough to pass a
lambda. Passing a string means the lambda is in the wrong scope and
doesn''t have access to objects in the test case scope.
For an
2006 Feb 20
5
find(:all) vs find_all
I started with Ruby on Rails in the 0.13.x period, so I''m sure I
missed out on a lot of history. There''s probably some good
explanation for something I''ve been wondering about, but I haven''t
seen it written down anywhere. Maybe someone can clue me in.
I''ve always felt that one of the uglier APIs was the
ActiveRecord::find() method. I call
2006 Apr 24
4
[TIP] Ensure your test data is valid
Recently I wanted to check that my test data was valid. Seems like a
reasonable thing to want to do so I thought I''d share the rake task. Add
this code to a rake file in lib/tasks and run with rake
db:fixtures:validate. It will print out the class, record id and error
messages for any model objects that fail validation.
Enjoy!
-Jonathan.
--
namespace :db do
namespace :fixtures do
2006 Jun 08
3
has_many :through updates on delete.
I have a model that looks like this:
class Actor < ActiveRecord::Base
has_many :member_groups, :foreign_key => ''member_id'', :class_name =>
''GroupMember''
has_many :groups, :through => :member_groups, :source => :group
end
class Group < Actor
has_many :group_members, :foreign_key => ''group_id'',:dependent =>
2006 Jul 27
25
Why are has_one objects resaved when the parent is saved?
If the associated object of a has_one association has been loaded, it
is resaved when the parent is saved. Eg:
class Person < ActiveRecord::Base
has_one :user
end
class User < ActiveRecord::Base
belongs_to :person
end
p = Person.find(:first)
p.save # As expected, nothing happens with the user association
p.user # Loads the associated object
p.save # As well as saving the person, the
2006 Feb 10
4
before_save gotcha
Is it will known and accepted that before_save triggers should return
true? I didn''t notice this before but now I see it in the
documentation.
Here is what I''m doing in my model:
def before_save
if self.has_album?
self.visible = self.album.visible?
end
end
That results in the expected result when album.visible? is true - but
not when it is false. To make it
2006 Mar 02
3
@session or session
Which is more appropriate? @session[] or session[]? Both seem to work.
Is there a difference between which should be used in the controller
vs. the view?
2006 Jan 09
6
What is AJAX?
What is AJAX?
SteveT
Steve Litt
Author:
* Universal Troubleshooting Process courseware
* Troubleshooting Techniques of the Successful Technologist
* Rapid Learning: Secret Weapon of the Successful Technologist
Webmaster
* Troubleshooters.Com
* http://www.troubleshooters.com
2006 Mar 19
2
How to create a proper name for the diff for the RoR patch?
Hello,
http://dev.rubyonrails.org/wiki suggests to:
Create a patch with your changes: svn diff > my_properly_named_patch.diff
but how this proper name looks like?
olegf
2006 May 30
3
Current process for tickets
This afternoon I was looking at the tickets posted in Trac, and I saw
that there we quite a few stale tickets and patches. A lot of these
are filed against very old versions of Rails, I think it''s fair for
the people posting these tickets that they get resolved. Either by
just removing them all or by weeding them out.
I understand that closing tickets is not very glamorous work
2006 Jan 15
6
Saving one-many associations (elegant solution please)
What is the most elegant way to save new one-many associations?
order = Order.new(:name => "My Order")
order.line_items << LineItem.new(:product_id => 1, :quantity => 2)
order.line_items << LineItem.new(:product_id => 2, :quantity => 5)
order.save
The above - which is by far the most elegant way of putting it - doesn''t
work for me - the line_items
2006 Apr 26
4
Re: Rails AR/Oracle Unit Test: [4280] failed
The revised patch submitted on #4748 broke the build, I''m looking to
sort out why.
Also note that this auto-test email didn''t make it to rails-core because
it was too big (every test failed, so the resulting email was huge).
I''ll patch my auto-testing script to truncate the email to no larger
than a few kb.
Michael Schoen wrote:
> "marcel" made
2006 Mar 23
5
Dirt simple .rcss templates
There was some discussion on this list recently about doing .rcss
templates in Rails using a custom template handler. I''ve come up
with a very simple way to support rcss without a handler. Turns out
all it takes is a route and an action that calls render(:file...). I
put a full write-up on my blog earlier today:
2006 Mar 22
2
Edge Rails (1.1.0 RC1) and Typo Trunk
I tried the current Typo trunk with Edge Rails (1.1.0 RC1) and ran
into the following problems:
1) /public/../config/environment.rb:107: undefined method
`enable_upload_progress'' for ActionController::Base:Class
(NoMethodError). I commented this line out and installed the Upload
Progress plugin and this problem _appears_ to have gone away.
2) The second problem I
2006 Jan 03
4
Would someone like to tell me why this code will not solve my problem? (it''s short)
I am building an invoicing system but cannot use the auto_increment
field to determine the invoice number (because they are running 3
different companies off the one system. I need to find the last
invoice number from any given company and then add 1 to it to get the
next invoice number. BUT, there is a unique case on the very first
invoice produced because there is no earlier invoice
2006 Feb 28
3
Object#id will be deprecated?
I didn''t get the memo on this :P
members_controller.rb:12: warning: Object#id will be deprecated; use
Object#object_id
Line 12 is:
@member = Member.find(@current_member.id)
How _should_ I be writing that line?
Thanks,
Joe
--
Posted via http://www.ruby-forum.com/.
2007 Apr 23
6
[CruiseControl] RubyOnRails build 6553 failed
The build failed.
See http://cruisecontrolrb.thoughtworks.com/builds/RubyOnRails/6553 for details.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscribe from this group, send email to
2006 Jan 11
6
RJS and layouts
Hi all,
I''ve been using RJS more and more for my app and I have sorta run into a
possible issue. My app has different user roles that require different
layouts. So far, this has worked fine, but now that I''m using rjs more
and more I''m finding that the two don''t really work together since I
have to rails not to use a layout upon controller method
2006 Jan 05
4
testing file uploads
Hi all,
I was wondering about the class used when rails receives file uploads.
Sometimes it appears to be a File, and other times it is a StringIO.
Also it has methods such as original_filename that don''t appear to
belong to either of these classes. I ask because I''m trying to work out
how to test my fil upload related models and controllers.
Is there some standardised way of
2006 Feb 25
2
How do templates get access to controller variables?
This is probably more of a Ruby question than a Rails question. I''ve
always wondered exactly how controller instance variables are being made
accessible to the ERb code in the views.
In the Agile Rails book on pages 38, there''s a sidebar at the top that
hints at what''s going on:
"Rails does some Ruby magic so that the instance variables of the
controller