Commit Graph

10987 Commits

Author SHA1 Message Date
Pratik Naik
572323135f Allow accepts_nested_attributes_for :reject_if option accept symbols for using a method
Conflicts:

	activerecord/lib/active_record/nested_attributes.rb
2009-10-07 23:50:30 +01:00
Michael Koziarski
9415935902 Switch to on-by-default XSS escaping for rails.
This consists of:

  * String#html_safe! a method to mark a string as 'safe'
  * ActionView::SafeBuffer a string subclass which escapes anything unsafe which is concatenated to it
  * Calls to String#html_safe! throughout the rails helpers
  * a 'raw' helper which lets you concatenate trusted HTML from non-safety-aware sources (e.g. presantized strings in the DB)
  * New ERB implementation based on erubis which uses a SafeBuffer instead of a String

Hat tip to Django for the inspiration.
2009-10-08 09:31:20 +13:00
José Valim
f27e7ebc0e Do not ignore .empty_directory files.
Signed-off-by: Carl Lerche <carllerche@mac.com>
2009-10-07 11:00:17 -07:00
Joshua Peek
ff56f3d5e1 Rewrite ActiveModel::Lint as a simple TU mixin 2009-10-07 09:24:51 -05:00
Sam Pohlenz
4df96338ed Fixed behavior of attribute_methods_generated? [#3220 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-10-07 09:07:39 -05:00
Sam Pohlenz
f8e91bda9c Don't share attribute matchers between classes [#3216 state:resolved]
Allows separate models that include ActiveModel::AttributeMethods to
use different sets of attribute matchers.

Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-10-07 09:07:39 -05:00
Yehuda Katz
3916f0340e Not calling a private method anymore 2009-10-07 00:33:13 -10:00
Yehuda Katz
e57197a967 Fix warning spew 2009-10-06 22:36:14 -10:00
Paul Gillard
6361d4234c Call initialize_copy when cloning [#3164 state:resolved]
Cloned AR objects are now instantiated through initialize_copy rather than
new/initialize. This allows AR classes to override initialize_copy in order to
implement deep cloning.

Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-10-06 16:25:51 -05:00
Michael Koziarski
126f623711 don't ignore all bin directories 2009-10-06 15:53:25 +13:00
Jeffrey Hardy
9212138ad0 MessageVerifier#verify raises InvalidSignature if the signature is blank
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-10-05 13:38:26 -07:00
Joshua Peek
b480da5cd6 Coerce all out going body parts to Strings 2009-10-05 13:58:43 -05:00
Joshua Peek
570f055c44 Yank FCGI Handler from core
http://github.com/rails/fcgi_handler
2009-10-05 11:16:24 -05:00
Joshua Peek
20d6938453 Rewrite FCGI handler test 2009-10-05 10:36:05 -05:00
Joshua Peek
7de5f69cc6 Try to load lib before trying to activate the gem for testing 2009-10-05 10:01:46 -05:00
Joshua Peek
444ba150bd Put test in place for deprecated dispatcher 2009-10-05 09:42:35 -05:00
Joshua Peek
635aa91224 More robust console test 2009-10-05 09:41:08 -05:00
Joshua Peek
76d823677f Revert "Revert "Fix Dispatch.new so passenger works" as it broke the build"
This reverts commit 49b52cadc2e66c11a025e7719837ae77b3736046.
2009-10-05 09:17:51 -05:00
Michael Koziarski
49b52cadc2 Revert "Fix Dispatch.new so passenger works" as it broke the build
This reverts commit c97c31b096e627480b64403d1460065738941c3e.
2009-10-05 17:23:37 +13:00
Joshua Peek
c97c31b096 Fix Dispatch.new so passenger works 2009-10-04 12:45:53 -05:00
Joshua Peek
86d0590022 Only draw default route once 2009-10-03 23:55:35 -05:00
Joshua Peek
86ed58d912 Use with_routing helper in tests instead of modifying global route set 2009-10-03 23:31:38 -05:00
Joshua Peek
61411f2aeb Redraw default routes on all internal integration tests. We don't need SimpleRouteCase anymore 2009-10-03 23:18:32 -05:00
Joshua Peek
8287a112c9 Avoid creating new controller constants during test runtime. All routable controllers should be defined beforehand. 2009-10-03 23:03:08 -05:00
Joshua Peek
2a938ad5e7 Run AP isolated tests on CI 2009-10-03 22:14:58 -05:00
Joshua Peek
f5cba5e6b1 Moved shared form helper models into fake_models 2009-10-03 22:14:50 -05:00
Joshua Peek
31319b471b NumberHelper depends on big decimal extensions 2009-10-03 22:06:25 -05:00
Joshua Peek
7eaed071a2 Changing directories during the test breaks file loading when ran by itself 2009-10-03 22:02:51 -05:00
Joshua Peek
660eb068d3 Don't load rubygems for isolated tests 2009-10-03 21:51:34 -05:00
Joshua Peek
75a2f00c97 Move improved isolated test runner to AP 2009-10-03 21:33:06 -05:00
Joshua Peek
018b79dd36 File extra test folders into controller, dispatch, or template 2009-10-03 21:05:51 -05:00
Joshua Peek
84e94551f6 Add custom "with_routing" to internal tests to fix reseting session after using
with_routing. This only affects our internal AP tests.
2009-10-03 20:45:49 -05:00
Joshua Peek
89630a7c2c Cleanup whitespace introduced in 8377646 and f4f6888 2009-10-02 10:19:30 -05:00
Taryn East
8377646d68 add indifferent access to the attributes
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-10-02 10:13:40 -05:00
Taryn East
f4f68885ef update_attribute(s) added to Active Resource
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-10-02 10:13:01 -05:00
Carl Lerche
420004e030 Initialize a new instance of Rails.application during integration tests
This is to fix the AWDWR tests until the application object is refactored to be a singleton.
2009-09-30 12:39:26 -07:00
Carl Lerche
2370e87ae0 Remove all calls to Rails::Initializer from boot.rb
This is starting a refactor of the rails initialization process. The boot.rb file will not remain the same.
2009-09-30 12:05:34 -07:00
Carl Lerche
34aae6d739 Remove a duplicate initializer 2009-09-29 17:46:33 -07:00
Carl Lerche
c9d4529c9d Change Rails::Application to a class that is inherited from.
This is still very experimental.
2009-09-29 17:33:17 -07:00
Carl Lerche
d1a63b15e3 Remove unneeded files from the railties test directory 2009-09-29 16:12:45 -07:00
Carl Lerche
6b086449be Fix the broken railties isolation tests 2009-09-29 16:07:29 -07:00
Yehuda Katz + Carl Lerche
6f6a589d4b Create the application object from config/environment.rb
This is preliminary and not necessarily reflective of the
  full plan.
2009-09-28 18:00:26 -07:00
Erik Ostrom
8ffc2e3b8d Ported the new ActionView::TestCase from 2-3-stable to master [#3260
state:resolved]

The test case now mimicks the template environment more closely, so it's
possible to use render, load helper dependencies.

This also fixes assert_select, and similar assertions. Because view tests
and helpers generally don't render full templates assert_select looks
first in rendered and then in output_buffer to find the rendered output.

Additional `master'-only changes: Made the Action Pack Rakefile run the
ActionView::TestCase tests, and made ActionView::Rendering#_render_text
always return a string.

Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-09-28 13:31:30 -05:00
Mike Gunderloy
1696039f29 Remove SQLite2 from CI setup
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2009-09-28 14:51:40 +13:00
Luciano G Panaro
4168f87623 Make has_one with :conditions hash scope build or creation of the associated object with those conditions
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#3088 state:committed]
2009-09-28 14:50:33 +13:00
Jay Pignata
d48ebeade2 Escaping symbol passed into Memoizable's flush_cache for query methods to allow them to be cleared
Signed-off-by: Michael Koziarski <michael@koziarski.com>

[#3138 state:committed]
2009-09-28 14:48:13 +13:00
John Trupiano
e01f99786a Allow PKG_NAME env variable to control the directory name used when 'rake dev' is used to generate a new rails app.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#3278 state:committed]
2009-09-28 14:41:17 +13:00
Matias Flores
173ee14c3d Prefer tap to returning
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#3280 state:committed]
2009-09-28 14:38:24 +13:00
John Trupiano
c9318e9010 Introduce :almost keyword for distance_of_time_in_words. Make 1.75 days - 2 days return '2 days'.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#3266 state:committed]
2009-09-28 14:37:31 +13:00
Jay Pignata
8ef1cd9733 Enhancing distance_of_time_in_words to prefix year output with over and about depending upon how many months have elapsed
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#3106 state:committed]
2009-09-28 14:36:38 +13:00