\r\r"
- end
-
- def nested_multipart(recipient)
- recipients recipient
- subject "nested multipart"
- from "test@example.com"
- content_type "multipart/mixed"
- part :content_type => "multipart/alternative", :content_disposition => "inline", :headers => { "foo" => "bar" } do |p|
- p.part :content_type => "text/plain", :body => "test text\nline #2"
- p.part :content_type => "text/html", :body => "test HTML \nline #2"
- end
- attachment :content_type => "application/octet-stream",:filename => "test.txt", :body => "test abcdefghijklmnopqstuvwxyz"
- end
-
- def nested_multipart_with_body(recipient)
- recipients recipient
- subject "nested multipart with body"
- from "test@example.com"
- content_type "multipart/mixed"
- part :content_type => "multipart/alternative", :content_disposition => "inline", :body => "Nothing to see here." do |p|
- p.part :content_type => "text/html", :body => "test HTML "
- end
- end
-
- def attachment_with_custom_header(recipient)
- recipients recipient
- subject "custom header in attachment"
- from "test@example.com"
- content_type "multipart/related"
- part :content_type => "text/html", :body => 'yo'
- attachment :content_type => "image/jpeg",:filename => "test.jpeg", :body => "i am not a real picture", :headers => { 'Content-ID' => '' }
- end
-
- def unnamed_attachment(recipient)
- recipients recipient
- subject "nested multipart"
- from "test@example.com"
- content_type "multipart/mixed"
- part :content_type => "text/plain", :body => "hullo"
- attachment :content_type => "application/octet-stream", :body => "test abcdefghijklmnopqstuvwxyz"
- end
-
- def headers_with_nonalpha_chars(recipient)
- recipients recipient
- subject "nonalpha chars"
- from "One: Two "
- cc "Three: Four "
- bcc "Five: Six "
- body "testing"
- end
-
- def custom_content_type_attributes
- recipients "no.one@nowhere.test"
- subject "custom content types"
- from "some.one@somewhere.test"
- content_type "text/plain; format=flowed"
- body "testing"
- end
-
- def return_path
- recipients "no.one@nowhere.test"
- subject "return path test"
- from "some.one@somewhere.test"
- body "testing"
- headers "return-path" => "another@somewhere.test"
- end
-
- class < charset }
- end
- mail
- end
-
- # Replacing logger work around for mocha bug. Should be fixed in mocha 0.3.3
- def setup
- set_delivery_method :test
- ActionMailer::Base.perform_deliveries = true
- ActionMailer::Base.raise_delivery_errors = true
- ActionMailer::Base.deliveries = []
-
- @original_logger = TestMailer.logger
- @recipient = 'test@localhost'
- end
-
- def teardown
- TestMailer.logger = @original_logger
- restore_delivery_method
- end
-
- def test_nested_parts
- created = nil
- assert_nothing_raised { created = TestMailer.create_nested_multipart(@recipient)}
- assert_equal 2,created.parts.size
- assert_equal 2,created.parts.first.parts.size
-
- assert_equal "multipart/mixed", created.content_type
- assert_equal "multipart/alternative", created.parts.first.content_type
- assert_equal "bar", created.parts.first.header['foo'].to_s
- assert_equal "text/plain", created.parts.first.parts.first.content_type
- assert_equal "text/html", created.parts.first.parts[1].content_type
- assert_equal "application/octet-stream", created.parts[1].content_type
- end
-
- def test_nested_parts_with_body
- created = nil
- assert_nothing_raised { created = TestMailer.create_nested_multipart_with_body(@recipient)}
- assert_equal 1,created.parts.size
- assert_equal 2,created.parts.first.parts.size
-
- assert_equal "multipart/mixed", created.content_type
- assert_equal "multipart/alternative", created.parts.first.content_type
- assert_equal "Nothing to see here.", created.parts.first.parts.first.body
- assert_equal "text/plain", created.parts.first.parts.first.content_type
- assert_equal "text/html", created.parts.first.parts[1].content_type
- end
-
- def test_attachment_with_custom_header
- created = nil
- assert_nothing_raised { created = TestMailer.create_attachment_with_custom_header(@recipient)}
- assert_equal "", created.parts[1].header['content-id'].to_s
- end
-
- def test_signed_up
- expected = new_mail
- expected.to = @recipient
- expected.subject = "[Signed up] Welcome #{@recipient}"
- expected.body = "Hello there, \n\nMr. #{@recipient}"
- expected.from = "system@loudthinking.com"
- expected.date = Time.local(2004, 12, 12)
-
- created = nil
- assert_nothing_raised { created = TestMailer.create_signed_up(@recipient) }
- assert_not_nil created
- assert_equal expected.encoded, created.encoded
-
- assert_nothing_raised { TestMailer.deliver_signed_up(@recipient) }
- assert_not_nil ActionMailer::Base.deliveries.first
- assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded
- end
-
- def test_custom_template
- expected = new_mail
- expected.to = @recipient
- expected.subject = "[Signed up] Welcome #{@recipient}"
- expected.body = "Hello there, \n\nMr. #{@recipient}"
- expected.from = "system@loudthinking.com"
- expected.date = Time.local(2004, 12, 12)
-
- created = nil
- assert_nothing_raised { created = TestMailer.create_custom_template(@recipient) }
- assert_not_nil created
- assert_equal expected.encoded, created.encoded
- end
-
- def test_custom_templating_extension
- #
- # N.b., custom_templating_extension.text.plain.haml is expected to be in fixtures/test_mailer directory
- expected = new_mail
- expected.to = @recipient
- expected.subject = "[Signed up] Welcome #{@recipient}"
- expected.body = "Hello there, \n\nMr. #{@recipient}"
- expected.from = "system@loudthinking.com"
- expected.date = Time.local(2004, 12, 12)
-
- # Stub the render method so no alternative renderers need be present.
- ActionView::Base.any_instance.stubs(:render).returns("Hello there, \n\nMr. #{@recipient}")
-
- # If the template is not registered, there should be no parts.
- created = nil
- assert_nothing_raised { created = TestMailer.create_custom_templating_extension(@recipient) }
- assert_not_nil created
- assert_equal 0, created.parts.length
-
- ActionMailer::Base.register_template_extension('haml')
-
- # Now that the template is registered, there should be one part. The text/plain part.
- created = nil
- assert_nothing_raised { created = TestMailer.create_custom_templating_extension(@recipient) }
- assert_not_nil created
- assert_equal 2, created.parts.length
- assert_equal 'text/plain', created.parts[0].content_type
- assert_equal 'text/html', created.parts[1].content_type
- end
-
- def test_cancelled_account
- expected = new_mail
- expected.to = @recipient
- expected.subject = "[Cancelled] Goodbye #{@recipient}"
- expected.body = "Goodbye, Mr. #{@recipient}"
- expected.from = "system@loudthinking.com"
- expected.date = Time.local(2004, 12, 12)
-
- created = nil
- assert_nothing_raised { created = TestMailer.create_cancelled_account(@recipient) }
- assert_not_nil created
- assert_equal expected.encoded, created.encoded
-
- assert_nothing_raised { TestMailer.deliver_cancelled_account(@recipient) }
- assert_not_nil ActionMailer::Base.deliveries.first
- assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded
- end
-
- def test_cc_bcc
- expected = new_mail
- expected.to = @recipient
- expected.subject = "testing bcc/cc"
- expected.body = "Nothing to see here."
- expected.from = "system@loudthinking.com"
- expected.cc = "nobody@loudthinking.com"
- expected.bcc = "root@loudthinking.com"
- expected.date = Time.local 2004, 12, 12
-
- created = nil
- assert_nothing_raised do
- created = TestMailer.create_cc_bcc @recipient
- end
- assert_not_nil created
- assert_equal expected.encoded, created.encoded
-
- assert_nothing_raised do
- TestMailer.deliver_cc_bcc @recipient
- end
-
- assert_not_nil ActionMailer::Base.deliveries.first
- assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded
- end
-
- def test_reply_to
- expected = new_mail
-
- expected.to = @recipient
- expected.subject = "testing reply_to"
- expected.body = "Nothing to see here."
- expected.from = "system@loudthinking.com"
- expected.reply_to = "atraver@gmail.com"
- expected.date = Time.local 2008, 5, 23
-
- created = nil
- assert_nothing_raised do
- created = TestMailer.create_different_reply_to @recipient
- end
- assert_not_nil created
- assert_equal expected.encoded, created.encoded
-
- assert_nothing_raised do
- TestMailer.deliver_different_reply_to @recipient
- end
-
- assert_not_nil ActionMailer::Base.deliveries.first
- assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded
- end
-
- def test_iso_charset
- expected = new_mail( "iso-8859-1" )
- expected.to = @recipient
- expected.subject = encode "testing isø charsets", "iso-8859-1"
- expected.body = "Nothing to see here."
- expected.from = "system@loudthinking.com"
- expected.cc = "nobody@loudthinking.com"
- expected.bcc = "root@loudthinking.com"
- expected.date = Time.local 2004, 12, 12
-
- created = nil
- assert_nothing_raised do
- created = TestMailer.create_iso_charset @recipient
- end
- assert_not_nil created
- assert_equal expected.encoded, created.encoded
-
- assert_nothing_raised do
- TestMailer.deliver_iso_charset @recipient
- end
-
- assert_not_nil ActionMailer::Base.deliveries.first
- assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded
- end
-
- def test_unencoded_subject
- expected = new_mail
- expected.to = @recipient
- expected.subject = "testing unencoded subject"
- expected.body = "Nothing to see here."
- expected.from = "system@loudthinking.com"
- expected.cc = "nobody@loudthinking.com"
- expected.bcc = "root@loudthinking.com"
- expected.date = Time.local 2004, 12, 12
-
- created = nil
- assert_nothing_raised do
- created = TestMailer.create_unencoded_subject @recipient
- end
- assert_not_nil created
- assert_equal expected.encoded, created.encoded
-
- assert_nothing_raised do
- TestMailer.deliver_unencoded_subject @recipient
- end
-
- assert_not_nil ActionMailer::Base.deliveries.first
- assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded
- end
-
- def test_instances_are_nil
- assert_nil ActionMailer::Base.new
- assert_nil TestMailer.new
- end
-
- def test_deliveries_array
- assert_not_nil ActionMailer::Base.deliveries
- assert_equal 0, ActionMailer::Base.deliveries.size
- TestMailer.deliver_signed_up(@recipient)
- assert_equal 1, ActionMailer::Base.deliveries.size
- assert_not_nil ActionMailer::Base.deliveries.first
- end
-
- def test_perform_deliveries_flag
- ActionMailer::Base.perform_deliveries = false
- TestMailer.deliver_signed_up(@recipient)
- assert_equal 0, ActionMailer::Base.deliveries.size
- ActionMailer::Base.perform_deliveries = true
- TestMailer.deliver_signed_up(@recipient)
- assert_equal 1, ActionMailer::Base.deliveries.size
- end
-
- def test_doesnt_raise_errors_when_raise_delivery_errors_is_false
- ActionMailer::Base.raise_delivery_errors = false
- TestMailer.any_instance.expects(:perform_delivery_test).raises(Exception)
- assert_nothing_raised { TestMailer.deliver_signed_up(@recipient) }
- end
-
- def test_performs_delivery_via_sendmail
- sm = mock()
- sm.expects(:print).with(anything)
- sm.expects(:flush)
- IO.expects(:popen).once.with('/usr/sbin/sendmail -i -t', 'w+').yields(sm)
- ActionMailer::Base.delivery_method = :sendmail
- TestMailer.deliver_signed_up(@recipient)
- end
-
- def test_delivery_logs_sent_mail
- mail = TestMailer.create_signed_up(@recipient)
- logger = mock()
- logger.expects(:info).with("Sent mail to #{@recipient}")
- logger.expects(:debug).with("\n#{mail.encoded}")
- TestMailer.logger = logger
- TestMailer.deliver_signed_up(@recipient)
- end
-
- def test_unquote_quoted_printable_subject
- msg = <"
-
- expected = new_mail "iso-8859-1"
- expected.to = quote_address_if_necessary @recipient, "iso-8859-1"
- expected.subject = "testing extended headers"
- expected.body = "Nothing to see here."
- expected.from = quote_address_if_necessary "Grytøyr ", "iso-8859-1"
- expected.cc = quote_address_if_necessary "Grytøyr ", "iso-8859-1"
- expected.bcc = quote_address_if_necessary "Grytøyr ", "iso-8859-1"
- expected.date = Time.local 2004, 12, 12
-
- created = nil
- assert_nothing_raised do
- created = TestMailer.create_extended_headers @recipient
- end
-
- assert_not_nil created
- assert_equal expected.encoded, created.encoded
-
- assert_nothing_raised do
- TestMailer.deliver_extended_headers @recipient
- end
-
- assert_not_nil ActionMailer::Base.deliveries.first
- assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded
- end
-
- def test_utf8_body_is_not_quoted
- @recipient = "Foo áëô îü "
- expected = new_mail "utf-8"
- expected.to = quote_address_if_necessary @recipient, "utf-8"
- expected.subject = "testing utf-8 body"
- expected.body = "åœö blah"
- expected.from = quote_address_if_necessary @recipient, "utf-8"
- expected.cc = quote_address_if_necessary @recipient, "utf-8"
- expected.bcc = quote_address_if_necessary @recipient, "utf-8"
- expected.date = Time.local 2004, 12, 12
-
- created = TestMailer.create_utf8_body @recipient
- assert_match(/åœö blah/, created.encoded)
- end
-
- def test_multiple_utf8_recipients
- @recipient = ["\"Foo áëô îü\" ", "\"Example Recipient\" "]
- expected = new_mail "utf-8"
- expected.to = quote_address_if_necessary @recipient, "utf-8"
- expected.subject = "testing utf-8 body"
- expected.body = "åœö blah"
- expected.from = quote_address_if_necessary @recipient.first, "utf-8"
- expected.cc = quote_address_if_necessary @recipient, "utf-8"
- expected.bcc = quote_address_if_necessary @recipient, "utf-8"
- expected.date = Time.local 2004, 12, 12
-
- created = TestMailer.create_utf8_body @recipient
- assert_match(/\nFrom: =\?utf-8\?Q\?Foo_.*?\?= \r/, created.encoded)
- assert_match(/\nTo: =\?utf-8\?Q\?Foo_.*?\?= , Example Recipient _Google}, mail.body
- end
-
- def test_various_newlines
- mail = TestMailer.create_various_newlines(@recipient)
- assert_equal("line #1\nline #2\nline #3\nline #4\n\n" +
- "line #5\n\nline#6\n\nline #7", mail.body)
- end
-
- def test_various_newlines_multipart
- mail = TestMailer.create_various_newlines_multipart(@recipient)
- assert_equal "line #1\nline #2\nline #3\nline #4\n\n", mail.parts[0].body
- assert_equal "
line #1
\n
line #2
\n
line #3
\n
line #4
\n\n", mail.parts[1].body
- end
-
- def test_headers_removed_on_smtp_delivery
- ActionMailer::Base.delivery_method = :smtp
- TestMailer.deliver_cc_bcc(@recipient)
- assert MockSMTP.deliveries[0][2].include?("root@loudthinking.com")
- assert MockSMTP.deliveries[0][2].include?("nobody@loudthinking.com")
- assert MockSMTP.deliveries[0][2].include?(@recipient)
- assert_match %r{^Cc: nobody@loudthinking.com}, MockSMTP.deliveries[0][0]
- assert_match %r{^To: #{@recipient}}, MockSMTP.deliveries[0][0]
- assert_no_match %r{^Bcc: root@loudthinking.com}, MockSMTP.deliveries[0][0]
- end
-
- def test_recursive_multipart_processing
- fixture = File.read(File.dirname(__FILE__) + "/fixtures/raw_email7")
- mail = TMail::Mail.parse(fixture)
- assert_equal "This is the first part.\n\nAttachment: test.rb\nAttachment: test.pdf\n\n\nAttachment: smime.p7s\n", mail.body
- end
-
- def test_decode_encoded_attachment_filename
- fixture = File.read(File.dirname(__FILE__) + "/fixtures/raw_email8")
- mail = TMail::Mail.parse(fixture)
- attachment = mail.attachments.last
-
- expected = "01 Quien Te Dij\212at. Pitbull.mp3"
- expected.force_encoding(Encoding::ASCII_8BIT) if expected.respond_to?(:force_encoding)
-
- assert_equal expected, attachment.original_filename
- end
-
- def test_wrong_mail_header
- fixture = File.read(File.dirname(__FILE__) + "/fixtures/raw_email9")
- assert_raise(TMail::SyntaxError) { TMail::Mail.parse(fixture) }
- end
-
- def test_decode_message_with_unknown_charset
- fixture = File.read(File.dirname(__FILE__) + "/fixtures/raw_email10")
- mail = TMail::Mail.parse(fixture)
- assert_nothing_raised { mail.body }
- end
-
- def test_empty_header_values_omitted
- result = TestMailer.create_unnamed_attachment(@recipient).encoded
- assert_match %r{Content-Type: application/octet-stream[^;]}, result
- assert_match %r{Content-Disposition: attachment[^;]}, result
- end
-
- def test_headers_with_nonalpha_chars
- mail = TestMailer.create_headers_with_nonalpha_chars(@recipient)
- assert !mail.from_addrs.empty?
- assert !mail.cc_addrs.empty?
- assert !mail.bcc_addrs.empty?
- assert_match(/:/, mail.from_addrs.to_s)
- assert_match(/:/, mail.cc_addrs.to_s)
- assert_match(/:/, mail.bcc_addrs.to_s)
- end
-
- def test_deliver_with_mail_object
- mail = TestMailer.create_headers_with_nonalpha_chars(@recipient)
- assert_nothing_raised { TestMailer.deliver(mail) }
- assert_equal 1, TestMailer.deliveries.length
- end
-
- def test_multipart_with_template_path_with_dots
- mail = FunkyPathMailer.create_multipart_with_template_path_with_dots(@recipient)
- assert_equal 2, mail.parts.length
- end
-
- def test_custom_content_type_attributes
- mail = TestMailer.create_custom_content_type_attributes
- assert_match %r{format=flowed}, mail['content-type'].to_s
- assert_match %r{charset=utf-8}, mail['content-type'].to_s
- end
-
- def test_return_path_with_create
- mail = TestMailer.create_return_path
- assert_equal "", mail['return-path'].to_s
- end
-
- def test_return_path_with_deliver
- ActionMailer::Base.delivery_method = :smtp
- TestMailer.deliver_return_path
- assert_match %r{^Return-Path: }, MockSMTP.deliveries[0][0]
- end
-end
-
-end # uses_mocha
-
-class InheritableTemplateRootTest < Test::Unit::TestCase
- def test_attr
- expected = "#{File.dirname(__FILE__)}/fixtures/path.with.dots"
- assert_equal expected, FunkyPathMailer.template_root
-
- sub = Class.new(FunkyPathMailer)
- sub.template_root = 'test/path'
-
- assert_equal 'test/path', sub.template_root
- assert_equal expected, FunkyPathMailer.template_root
- end
-end
-
-class MethodNamingTest < Test::Unit::TestCase
- class TestMailer < ActionMailer::Base
- def send
- body 'foo'
- end
- end
-
- def setup
- set_delivery_method :test
- ActionMailer::Base.perform_deliveries = true
- ActionMailer::Base.deliveries = []
- end
-
- def teardown
- restore_delivery_method
- end
-
- def test_send_method
- assert_nothing_raised do
- assert_emails 1 do
- TestMailer.deliver_send
- end
- end
- end
-end
diff --git a/vendor/rails/actionmailer/test/quoting_test.rb b/vendor/rails/actionmailer/test/quoting_test.rb
deleted file mode 100644
index 13a859a5..00000000
--- a/vendor/rails/actionmailer/test/quoting_test.rb
+++ /dev/null
@@ -1,98 +0,0 @@
-# encoding: utf-8
-require 'abstract_unit'
-require 'tmail'
-require 'tempfile'
-
-class QuotingTest < Test::Unit::TestCase
- # Move some tests from TMAIL here
- def test_unquote_quoted_printable
- a ="=?ISO-8859-1?Q?[166417]_Bekr=E6ftelse_fra_Rejsefeber?="
- b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8')
- assert_equal "[166417] Bekr\303\246ftelse fra Rejsefeber", b
- end
-
- def test_unquote_base64
- a ="=?ISO-8859-1?B?WzE2NjQxN10gQmVrcuZmdGVsc2UgZnJhIFJlanNlZmViZXI=?="
- b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8')
- assert_equal "[166417] Bekr\303\246ftelse fra Rejsefeber", b
- end
-
- def test_unquote_without_charset
- a ="[166417]_Bekr=E6ftelse_fra_Rejsefeber"
- b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8')
- assert_equal "[166417]_Bekr=E6ftelse_fra_Rejsefeber", b
- end
-
- def test_unqoute_multiple
- a ="=?utf-8?q?Re=3A_=5B12=5D_=23137=3A_Inkonsistente_verwendung_von_=22Hin?==?utf-8?b?enVmw7xnZW4i?="
- b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8')
- assert_equal "Re: [12] #137: Inkonsistente verwendung von \"Hinzuf\303\274gen\"", b
- end
-
- def test_unqoute_in_the_middle
- a ="Re: Photos =?ISO-8859-1?Q?Brosch=FCre_Rand?="
- b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8')
- assert_equal "Re: Photos Brosch\303\274re Rand", b
- end
-
- def test_unqoute_iso
- a ="=?ISO-8859-1?Q?Brosch=FCre_Rand?="
- b = TMail::Unquoter.unquote_and_convert_to(a, 'iso-8859-1')
- expected = "Brosch\374re Rand"
- expected.force_encoding 'iso-8859-1' if expected.respond_to?(:force_encoding)
- assert_equal expected, b
- end
-
- def test_quote_multibyte_chars
- original = "\303\246 \303\270 and \303\245"
- original.force_encoding('ASCII-8BIT') if original.respond_to?(:force_encoding)
-
- result = execute_in_sandbox(<<-CODE)
- $:.unshift(File.dirname(__FILE__) + "/../lib/")
- $KCODE = 'u'
- require 'jcode'
- require 'action_mailer/quoting'
- include ActionMailer::Quoting
- quoted_printable(#{original.inspect}, "UTF-8")
- CODE
-
- unquoted = TMail::Unquoter.unquote_and_convert_to(result, nil)
- assert_equal unquoted, original
- end
-
-
- # test an email that has been created using \r\n newlines, instead of
- # \n newlines.
- def test_email_quoted_with_0d0a
- mail = TMail::Mail.parse(IO.read("#{File.dirname(__FILE__)}/fixtures/raw_email_quoted_with_0d0a"))
- assert_match %r{Elapsed time}, mail.body
- end
-
- def test_email_with_partially_quoted_subject
- mail = TMail::Mail.parse(IO.read("#{File.dirname(__FILE__)}/fixtures/raw_email_with_partially_quoted_subject"))
- assert_equal "Re: Test: \"\346\274\242\345\255\227\" mid \"\346\274\242\345\255\227\" tail", mail.subject
- end
-
- private
- # This whole thing *could* be much simpler, but I don't think Tempfile,
- # popen and others exist on all platforms (like Windows).
- def execute_in_sandbox(code)
- test_name = "#{File.dirname(__FILE__)}/am-quoting-test.#{$$}.rb"
- res_name = "#{File.dirname(__FILE__)}/am-quoting-test.#{$$}.out"
-
- File.open(test_name, "w+") do |file|
- file.write(<<-CODE)
- block = Proc.new do
- #{code}
- end
- puts block.call
- CODE
- end
-
- system("ruby #{test_name} > #{res_name}") or raise "could not run test in sandbox"
- File.read(res_name).chomp
- ensure
- File.delete(test_name) rescue nil
- File.delete(res_name) rescue nil
- end
-end
diff --git a/vendor/rails/actionmailer/test/test_helper_test.rb b/vendor/rails/actionmailer/test/test_helper_test.rb
deleted file mode 100644
index f8913e54..00000000
--- a/vendor/rails/actionmailer/test/test_helper_test.rb
+++ /dev/null
@@ -1,129 +0,0 @@
-require 'abstract_unit'
-
-class TestHelperMailer < ActionMailer::Base
- def test
- recipients "test@example.com"
- from "tester@example.com"
- body render(:inline => "Hello, <%= @world %>", :body => { :world => "Earth" })
- end
-end
-
-class TestHelperMailerTest < ActionMailer::TestCase
- def test_setup_sets_right_action_mailer_options
- assert_equal :test, ActionMailer::Base.delivery_method
- assert ActionMailer::Base.perform_deliveries
- assert_equal [], ActionMailer::Base.deliveries
- end
-
- def test_setup_creates_the_expected_mailer
- assert @expected.is_a?(TMail::Mail)
- assert_equal "1.0", @expected.mime_version
- assert_equal "text/plain", @expected.content_type
- end
-
- def test_mailer_class_is_correctly_inferred
- assert_equal TestHelperMailer, self.class.mailer_class
- end
-
- def test_determine_default_mailer_raises_correct_error
- assert_raises(ActionMailer::NonInferrableMailerError) do
- self.class.determine_default_mailer("NotAMailerTest")
- end
- end
-
- def test_charset_is_utf_8
- assert_equal "utf-8", charset
- end
-
- def test_encode
- assert_equal "=?utf-8?Q?=0aasdf=0a?=", encode("\nasdf\n")
- end
-
- def test_assert_emails
- assert_nothing_raised do
- assert_emails 1 do
- TestHelperMailer.deliver_test
- end
- end
- end
-
- def test_repeated_assert_emails_calls
- assert_nothing_raised do
- assert_emails 1 do
- TestHelperMailer.deliver_test
- end
- end
-
- assert_nothing_raised do
- assert_emails 2 do
- TestHelperMailer.deliver_test
- TestHelperMailer.deliver_test
- end
- end
- end
-
- def test_assert_emails_with_no_block
- assert_nothing_raised do
- TestHelperMailer.deliver_test
- assert_emails 1
- end
-
- assert_nothing_raised do
- TestHelperMailer.deliver_test
- TestHelperMailer.deliver_test
- assert_emails 3
- end
- end
-
- def test_assert_no_emails
- assert_nothing_raised do
- assert_no_emails do
- TestHelperMailer.create_test
- end
- end
- end
-
- def test_assert_emails_too_few_sent
- error = assert_raises Test::Unit::AssertionFailedError do
- assert_emails 2 do
- TestHelperMailer.deliver_test
- end
- end
-
- assert_match /2 .* but 1/, error.message
- end
-
- def test_assert_emails_too_many_sent
- error = assert_raises Test::Unit::AssertionFailedError do
- assert_emails 1 do
- TestHelperMailer.deliver_test
- TestHelperMailer.deliver_test
- end
- end
-
- assert_match /1 .* but 2/, error.message
- end
-
- def test_assert_no_emails_failure
- error = assert_raises Test::Unit::AssertionFailedError do
- assert_no_emails do
- TestHelperMailer.deliver_test
- end
- end
-
- assert_match /0 .* but 1/, error.message
- end
-end
-
-class AnotherTestHelperMailerTest < ActionMailer::TestCase
- tests TestHelperMailer
-
- def setup
- @test_var = "a value"
- end
-
- def test_setup_shouldnt_conflict_with_mailer_setup
- assert @expected.is_a?(TMail::Mail)
- assert_equal 'a value', @test_var
- end
-end
diff --git a/vendor/rails/actionmailer/test/tmail_test.rb b/vendor/rails/actionmailer/test/tmail_test.rb
deleted file mode 100644
index 718990e7..00000000
--- a/vendor/rails/actionmailer/test/tmail_test.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-require 'abstract_unit'
-
-class TMailMailTest < Test::Unit::TestCase
- def test_body
- m = TMail::Mail.new
- expected = 'something_with_underscores'
- m.encoding = 'quoted-printable'
- quoted_body = [expected].pack('*M')
- m.body = quoted_body
- assert_equal "something_with_underscores=\n", m.quoted_body
- assert_equal expected, m.body
- end
-
- def test_nested_attachments_are_recognized_correctly
- fixture = File.read("#{File.dirname(__FILE__)}/fixtures/raw_email_with_nested_attachment")
- mail = TMail::Mail.parse(fixture)
- assert_equal 2, mail.attachments.length
- assert_equal "image/png", mail.attachments.first.content_type
- assert_equal 1902, mail.attachments.first.length
- assert_equal "application/pkcs7-signature", mail.attachments.last.content_type
- end
-end
diff --git a/vendor/rails/actionmailer/test/url_test.rb b/vendor/rails/actionmailer/test/url_test.rb
deleted file mode 100644
index 71286bd1..00000000
--- a/vendor/rails/actionmailer/test/url_test.rb
+++ /dev/null
@@ -1,76 +0,0 @@
-require 'abstract_unit'
-
-class TestMailer < ActionMailer::Base
-
- default_url_options[:host] = 'www.basecamphq.com'
-
- def signed_up_with_url(recipient)
- @recipients = recipient
- @subject = "[Signed up] Welcome #{recipient}"
- @from = "system@loudthinking.com"
- @sent_on = Time.local(2004, 12, 12)
-
- @body["recipient"] = recipient
- @body["welcome_url"] = url_for :host => "example.com", :controller => "welcome", :action => "greeting"
- end
-
- class < charset }
- end
- mail
- end
-
- def setup
- set_delivery_method :test
- ActionMailer::Base.perform_deliveries = true
- ActionMailer::Base.deliveries = []
-
- @recipient = 'test@localhost'
- end
-
- def teardown
- restore_delivery_method
- end
-
- def test_signed_up_with_url
- ActionController::Routing::Routes.draw do |map|
- map.connect ':controller/:action/:id'
- map.welcome 'welcome', :controller=>"foo", :action=>"bar"
- end
-
- expected = new_mail
- expected.to = @recipient
- expected.subject = "[Signed up] Welcome #{@recipient}"
- expected.body = "Hello there, \n\nMr. #{@recipient}. Please see our greeting at http://example.com/welcome/greeting http://www.basecamphq.com/welcome\n\n"
- expected.from = "system@loudthinking.com"
- expected.date = Time.local(2004, 12, 12)
-
- created = nil
- assert_nothing_raised { created = TestMailer.create_signed_up_with_url(@recipient) }
- assert_not_nil created
- assert_equal expected.encoded, created.encoded
-
- assert_nothing_raised { TestMailer.deliver_signed_up_with_url(@recipient) }
- assert_not_nil ActionMailer::Base.deliveries.first
- assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded
- end
-end
diff --git a/vendor/rails/actionpack/CHANGELOG b/vendor/rails/actionpack/CHANGELOG
deleted file mode 100644
index cb684a92..00000000
--- a/vendor/rails/actionpack/CHANGELOG
+++ /dev/null
@@ -1,4798 +0,0 @@
-*2.1.0 (May 31st, 2008)*
-
-* InstanceTag#default_time_from_options overflows to DateTime [Geoff Buesing]
-
-* Fixed that forgery protection can be used without session tracking (Peter Jones) [#139]
-
-* Added session(:on) to turn session management back on in a controller subclass if the superclass turned it off (Peter Jones) [#136]
-
-* Change the request forgery protection to go by Content-Type instead of request.format so that you can't bypass it by POSTing to "#{request.uri}.xml" [rick]
-* InstanceTag#default_time_from_options with hash args uses Time.current as default; respects hash settings when time falls in system local spring DST gap [Geoff Buesing]
-
-* select_date defaults to Time.zone.today when config.time_zone is set [Geoff Buesing]
-
-* Fixed that TextHelper#text_field would corrypt when raw HTML was used as the value (mchenryc, Kevin Glowacz) [#80]
-
-* Added ActionController::TestCase#rescue_action_in_public! to control whether the action under test should use the regular rescue_action path instead of simply raising the exception inline (great for error testing) [DHH]
-
-* Reduce number of instance variables being copied from controller to view. [Pratik]
-
-* select_datetime and select_time default to Time.zone.now when config.time_zone is set [Geoff Buesing]
-
-* datetime_select defaults to Time.zone.now when config.time_zone is set [Geoff Buesing]
-
-* Remove ActionController::Base#view_controller_internals flag. [Pratik]
-
-* Add conditional options to caches_page method. [Paul Horsfall]
-
-* Move missing template logic to ActionView. [Pratik]
-
-* Introduce ActionView::InlineTemplate class. [Pratik]
-
-* Automatically parse posted JSON content for Mime::JSON requests. [rick]
-
- POST /posts
- {"post": {"title": "Breaking News"}}
-
- def create
- @post = Post.create params[:post]
- # ...
- end
-
-* add json_escape ERB util to escape html entities in json strings that are output in HTML pages. [rick]
-
-* Provide a helper proxy to access helper methods from outside views. Closes #10839 [Josh Peek]
- e.g. ApplicationController.helpers.simple_format(text)
-
-* Improve documentation. [Xavier Noria, leethal, jerome]
-
-* Ensure RJS redirect_to doesn't html-escapes string argument. Closes #8546 [josh, eventualbuddha, Pratik]
-
-* Support render :partial => collection of heterogeneous elements. #11491 [Zach Dennis]
-
-* Avoid remote_ip spoofing. [Brian Candler]
-
-* Added support for regexp flags like ignoring case in the :requirements part of routes declarations #11421 [NeilW]
-
-* Fixed that ActionController::Base#read_multipart would fail if boundary was exactly 10240 bytes #10886 [ariejan]
-
-* Fixed HTML::Tokenizer (used in sanitize helper) didn't handle unclosed CDATA tags #10071 [esad, packagethief]
-
-* Improve documentation. [Radar, Jan De Poorter, chuyeow, xaviershay, danger, miloops, Xavier Noria, Sunny Ripert]
-
-* Fixed that FormHelper#radio_button would produce invalid ids #11298 [harlancrystal]
-
-* Added :confirm option to submit_tag #11415 [miloops]
-
-* Fixed NumberHelper#number_with_precision to properly round in a way that works equally on Mac, Windows, Linux (closes #11409, #8275, #10090, #8027) [zhangyuanyi]
-
-* Allow the #simple_format text_helper to take an html_options hash for each paragraph. #2448 [Francois Beausoleil, thechrisoshow]
-
-* Fix regression from filter refactoring where re-adding a skipped filter resulted in it being called twice. [rick]
-
-* Refactor filters to use Active Support callbacks. #11235 [Josh Peek]
-
-* Fixed that polymorphic routes would modify the input array #11363 [thomas.lee]
-
-* Added :format option to NumberHelper#number_to_currency to enable better localization support #11149 [lylo]
-
-* Fixed that TextHelper#excerpt would include one character too many #11268 [Irfy]
-
-* Fix more obscure nested parameter hash parsing bug. #10797 [thomas.lee]
-
-* Added ActionView::Helpers::register_javascript/stylesheet_expansion to make it easier for plugin developers to inject multiple assets. #10350 [lotswholetime]
-
-* Fix nested parameter hash parsing bug. #10797 [thomas.lee]
-
-* Allow using named routes in ActionController::TestCase before any request has been made. Closes #11273 [alloy]
-
-* Fixed that sweepers defined by cache_sweeper will be added regardless of the perform_caching setting. Instead, control whether the sweeper should be run with the perform_caching setting. This makes testing easier when you want to turn perform_caching on/off [DHH]
-
-* Make MimeResponds::Responder#any work without explicit types. Closes #11140 [jaw6]
-
-* Better error message for type conflicts when parsing params. Closes #7962 [spicycode, matt]
-
-* Remove unused ActionController::Base.template_class. Closes #10787 [Pratik]
-
-* Moved template handlers related code from ActionView::Base to ActionView::Template. [Pratik]
-
-* Tests for div_for and content_tag_for helpers. Closes #11223 [thechrisoshow]
-
-* Allow file uploads in Integration Tests. Closes #11091 [RubyRedRick]
-
-* Refactor partial rendering into a PartialTemplate class. [Pratik]
-
-* Added that requests with JavaScript as the priority mime type in the accept header and no format extension in the parameters will be treated as though their format was :js when it comes to determining which template to render. This makes it possible for JS requests to automatically render action.js.rjs files without an explicit respond_to block [DHH]
-
-* Tests for distance_of_time_in_words with TimeWithZone instances. Closes #10914 [ernesto.jimenez]
-
-* Remove support for multivalued (e.g., '&'-delimited) cookies. [Jamis Buck]
-
-* Fix problem with render :partial collections, records, and locals. #11057 [lotswholetime]
-
-* Added support for naming concrete classes in sweeper declarations [DHH]
-
-* Remove ERB trim variables from trace template in case ActionView::Base.erb_trim_mode is changed in the application. #10098 [tpope, kampers]
-
-* Fix typo in form_helper documentation. #10650 [xaviershay, kampers]
-
-* Fix bug with setting Request#format= after the getter has cached the value. #10889 [cch1]
-
-* Correct inconsistencies in RequestForgeryProtection docs. #11032 [mislav]
-
-* Introduce a Template class to ActionView. #11024 [lifofifo]
-
-* Introduce the :index option for form_for and fields_for to simplify multi-model forms (see http://railscasts.com/episodes/75). #9883 [rmm5t]
-
-* Introduce map.resources :cards, :as => 'tarjetas' to use a custom resource name in the URL: cards_path == '/tarjetas'. #10578 [blj]
-
-* TestSession supports indifferent access. #7372 [tamc, Arsen7, mhackett, julik, jean.helou]
-
-* Make assert_routing aware of the HTTP method used. #8039 [mpalmer]
- e.g. assert_routing({ :method => 'put', :path => '/product/321' }, { :controller => "product", :action => "update", :id => "321" })
-
-* Make map.root accept a single symbol as an argument to declare an alias. #10818 [bscofield]
-
- e.g. map.dashboard '/dashboard', :controller=>'dashboard'
- map.root :dashboard
-
-* Handle corner case with image_tag when passed 'messed up' image names. #9018 [duncanbeevers, mpalmer]
-
-* Add label_tag helper for generating elements. #10802 [DefV]
-
-* Introduce TemplateFinder to handle view paths and lookups. #10800 [Pratik Naik]
-
-* Performance: optimize route recognition. Large speedup for apps with many resource routes. #10835 [oleganza]
-
-* Make render :partial recognise form builders and use the _form partial. #10814 [djanowski]
-
-* Allow users to declare other namespaces when using the atom feed helpers. #10304 [david.calavera]
-
-* Introduce send_file :x_sendfile => true to send an X-Sendfile response header. [Jeremy Kemper]
-
-* Fixed ActionView::Helpers::ActiveRecordHelper::form for when protect_from_forgery is used #10739 [jeremyevans]
-
-* Provide nicer access to HTTP Headers. Instead of request.env["HTTP_REFERRER"] you can now use request.headers["Referrer"]. [Koz]
-
-* UrlWriter respects relative_url_root. #10748 [Cheah Chu Yeow]
-
-* The asset_host block takes the controller request as an optional second argument. Example: use a single asset host for SSL requests. #10549 [Cheah Chu Yeow, Peter B, Tom Taylor]
-
-* Support render :text => nil. #6684 [tjennings, PotatoSalad, Cheah Chu Yeow]
-
-* assert_response failures include the exception message. #10688 [Seth Rasmussen]
-
-* All fragment cache keys are now by default prefixed with the "views/" namespace [DHH]
-
-* Moved the caching stores from ActionController::Caching::Fragments::* to ActiveSupport::Cache::*. If you're explicitly referring to a store, like ActionController::Caching::Fragments::MemoryStore, you need to update that reference with ActiveSupport::Cache::MemoryStore [DHH]
-
-* Deprecated ActionController::Base.fragment_cache_store for ActionController::Base.cache_store [DHH]
-
-* Made fragment caching in views work for rjs and builder as well #6642 [zsombor]
-
-* Fixed rendering of partials with layout when done from site layout #9209 [antramm]
-
-* Fix atom_feed_helper to comply with the atom spec. Closes #10672 [xaviershay]
-
- * The tags created do not contain a date (http://feedvalidator.org/docs/error/InvalidTAG.html)
- * IDs are not guaranteed unique
- * A default self link was not provided, contrary to the documentation
- * NOTE: This changes tags for existing atom entries, but at least they validate now.
-
-* Correct indentation in tests. Closes #10671 [l.guidi]
-
-* Fix that auto_link looks for ='s in url paths (Amazon urls have them). Closes #10640 [bgreenlee]
-
-* Ensure that test case setup is run even if overridden. #10382 [Josh Peek]
-
-* Fix HTML Sanitizer to allow trailing spaces in CSS style attributes. Closes #10566 [wesley.moxam]
-
-* Add :default option to time_zone_select. #10590 [Matt Aimonetti]
-
-
-*2.0.2* (December 16th, 2007)
-
-* Added delete_via_redirect and put_via_redirect to integration testing #10497 [philodespotos]
-
-* Allow headers['Accept'] to be set by hand when calling xml_http_request #10461 [BMorearty]
-
-* Added OPTIONS to list of default accepted HTTP methods #10449 [holoway]
-
-* Added option to pass proc to ActionController::Base.asset_host for maximum configurability #10521 [chuyeow]. Example:
-
- ActionController::Base.asset_host = Proc.new { |source|
- if source.starts_with?('/images')
- "http://images.example.com"
- else
- "http://assets.example.com"
- end
- }
-
-* Fixed that ActionView#file_exists? would be incorrect if @first_render is set #10569 [dbussink]
-
-* Added that Array#to_param calls to_param on all it's elements #10473 [brandon]
-
-* Ensure asset cache directories are automatically created. #10337 [Josh Peek, Cheah Chu Yeow]
-
-* render :xml and :json preserve custom content types. #10388 [jmettraux, Cheah Chu Yeow]
-
-* Refactor Action View template handlers. #10437, #10455 [Josh Peek]
-
-* Fix DoubleRenderError message and leave out mention of returning false from filters. Closes #10380 [Frederick Cheung]
-
-* Clean up some cruft around ActionController::Base#head. Closes #10417 [ssoroka]
-
-
-*2.0.1* (December 7th, 2007)
-
-* Fixed send_file/binary_content for testing #8044 [tolsen]
-
-* When a NonInferrableControllerError is raised, make the proposed fix clearer in the error message. Closes #10199 [danger]
-
-* Update Prototype to 1.6.0.1. [sam]
-
-* Update script.aculo.us to 1.8.0.1. [madrobby]
-
-* Add 'disabled' attribute to
- ]]>
-
-
-
-
- Test 2
- ]]>
-
-
-
-
-EOF
- assert_select "channel item description" do
- # Test element regardless of wrapper.
- assert_select_encoded do
- assert_select "p", :count=>2, :text=>/Test/
- end
- # Test through encoded wrapper.
- assert_select_encoded do
- assert_select "encoded p", :count=>2, :text=>/Test/
- end
- # Use :root instead (recommended)
- assert_select_encoded do
- assert_select ":root p", :count=>2, :text=>/Test/
- end
- # Test individually.
- assert_select "description" do |elements|
- assert_select_encoded elements[0] do
- assert_select "p", "Test 1"
- end
- assert_select_encoded elements[1] do
- assert_select "p", "Test 2"
- end
- end
- end
-
- # Test that we only un-encode element itself.
- assert_select "channel item" do
- assert_select_encoded do
- assert_select "p", 0
- end
- end
- end
-
-
- #
- # Test assert_select_email
- #
-
- def test_assert_select_email
- assert_raises(AssertionFailedError) { assert_select_email {} }
- AssertSelectMailer.deliver_test "
foo
bar
"
- assert_select_email do
- assert_select "div:root" do
- assert_select "p:first-child", "foo"
- assert_select "p:last-child", "bar"
- end
- end
- end
-
-
- protected
- def render_html(html)
- @controller.response_with = html
- get :html
- end
-
- def render_rjs(&block)
- @controller.response_with &block
- get :rjs
- end
-
- def render_xml(xml)
- @controller.response_with = xml
- get :xml
- end
-end
diff --git a/vendor/rails/actionpack/test/controller/base_test.rb b/vendor/rails/actionpack/test/controller/base_test.rb
deleted file mode 100644
index b2871759..00000000
--- a/vendor/rails/actionpack/test/controller/base_test.rb
+++ /dev/null
@@ -1,183 +0,0 @@
-require 'abstract_unit'
-require 'pp' # require 'pp' early to prevent hidden_methods from not picking up the pretty-print methods until too late
-
-# Provide some controller to run the tests on.
-module Submodule
- class ContainedEmptyController < ActionController::Base
- end
- class ContainedNonEmptyController < ActionController::Base
- def public_action
- end
-
- hide_action :hidden_action
- def hidden_action
- raise "Noooo!"
- end
-
- def another_hidden_action
- end
- hide_action :another_hidden_action
- end
- class SubclassedController < ContainedNonEmptyController
- hide_action :public_action # Hiding it here should not affect the superclass.
- end
-end
-class EmptyController < ActionController::Base
-end
-class NonEmptyController < ActionController::Base
- def public_action
- end
-
- hide_action :hidden_action
- def hidden_action
- end
-end
-
-class MethodMissingController < ActionController::Base
-
- hide_action :shouldnt_be_called
- def shouldnt_be_called
- raise "NO WAY!"
- end
-
-protected
-
- def method_missing(selector)
- render :text => selector.to_s
- end
-
-end
-
-class DefaultUrlOptionsController < ActionController::Base
- def default_url_options_action
- end
-
- def default_url_options(options = nil)
- { :host => 'www.override.com', :action => 'new', :bacon => 'chunky' }
- end
-end
-
-class ControllerClassTests < Test::Unit::TestCase
- def test_controller_path
- assert_equal 'empty', EmptyController.controller_path
- assert_equal EmptyController.controller_path, EmptyController.new.controller_path
- assert_equal 'submodule/contained_empty', Submodule::ContainedEmptyController.controller_path
- assert_equal Submodule::ContainedEmptyController.controller_path, Submodule::ContainedEmptyController.new.controller_path
- end
- def test_controller_name
- assert_equal 'empty', EmptyController.controller_name
- assert_equal 'contained_empty', Submodule::ContainedEmptyController.controller_name
- end
-end
-
-class ControllerInstanceTests < Test::Unit::TestCase
- def setup
- @empty = EmptyController.new
- @contained = Submodule::ContainedEmptyController.new
- @empty_controllers = [@empty, @contained, Submodule::SubclassedController.new]
-
- @non_empty_controllers = [NonEmptyController.new,
- Submodule::ContainedNonEmptyController.new]
- end
-
- def test_action_methods
- @empty_controllers.each do |c|
- hide_mocha_methods_from_controller(c)
- assert_equal Set.new, c.send!(:action_methods), "#{c.controller_path} should be empty!"
- end
- @non_empty_controllers.each do |c|
- hide_mocha_methods_from_controller(c)
- assert_equal Set.new(%w(public_action)), c.send!(:action_methods), "#{c.controller_path} should not be empty!"
- end
- end
-
- protected
- # Mocha adds some public instance methods to Object that would be
- # considered actions, so explicitly hide_action them.
- def hide_mocha_methods_from_controller(controller)
- mocha_methods = [
- :expects, :mocha, :mocha_inspect, :reset_mocha, :stubba_object,
- :stubba_method, :stubs, :verify, :__metaclass__, :__is_a__, :to_matcher,
- ]
- controller.class.send!(:hide_action, *mocha_methods)
- end
-end
-
-
-class PerformActionTest < Test::Unit::TestCase
- def use_controller(controller_class)
- @controller = controller_class.new
-
- # enable a logger so that (e.g.) the benchmarking stuff runs, so we can get
- # a more accurate simulation of what happens in "real life".
- @controller.logger = Logger.new(nil)
-
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
-
- @request.host = "www.nextangle.com"
- end
-
- def test_get_on_priv_should_show_selector
- use_controller MethodMissingController
- get :shouldnt_be_called
- assert_response :success
- assert_equal 'shouldnt_be_called', @response.body
- end
-
- def test_method_missing_is_not_an_action_name
- use_controller MethodMissingController
- assert ! @controller.send!(:action_methods).include?('method_missing')
-
- get :method_missing
- assert_response :success
- assert_equal 'method_missing', @response.body
- end
-
- def test_get_on_hidden_should_fail
- use_controller NonEmptyController
- get :hidden_action
- assert_response 404
-
- get :another_hidden_action
- assert_response 404
- end
-end
-
-class DefaultUrlOptionsTest < Test::Unit::TestCase
- def setup
- @controller = DefaultUrlOptionsController.new
-
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
-
- @request.host = 'www.example.com'
- end
-
- def test_default_url_options_are_used_if_set
- ActionController::Routing::Routes.draw do |map|
- map.default_url_options 'default_url_options', :controller => 'default_url_options'
- map.connect ':controller/:action/:id'
- end
-
- get :default_url_options_action # Make a dummy request so that the controller is initialized properly.
-
- assert_equal 'http://www.override.com/default_url_options/new?bacon=chunky', @controller.url_for(:controller => 'default_url_options')
- assert_equal 'http://www.override.com/default_url_options?bacon=chunky', @controller.send(:default_url_options_url)
- ensure
- ActionController::Routing::Routes.load!
- end
-end
-
-class EnsureNamedRoutesWorksTicket22BugTest < Test::Unit::TestCase
- def test_named_routes_still_work
- ActionController::Routing::Routes.draw do |map|
- map.resources :things
- end
- EmptyController.send :include, ActionController::UrlWriter
-
- assert_equal '/things', EmptyController.new.send(:things_path)
- ensure
- ActionController::Routing::Routes.load!
- end
-end
\ No newline at end of file
diff --git a/vendor/rails/actionpack/test/controller/benchmark_test.rb b/vendor/rails/actionpack/test/controller/benchmark_test.rb
deleted file mode 100644
index 608ea5f5..00000000
--- a/vendor/rails/actionpack/test/controller/benchmark_test.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-require 'abstract_unit'
-
-# Provide some static controllers.
-class BenchmarkedController < ActionController::Base
- def public_action
- render :nothing => true
- end
-
- def rescue_action(e)
- raise e
- end
-end
-
-class BenchmarkTest < Test::Unit::TestCase
- class MockLogger
- def method_missing(*args)
- end
- end
-
- def setup
- @controller = BenchmarkedController.new
- # benchmark doesn't do anything unless a logger is set
- @controller.logger = MockLogger.new
- @request, @response = ActionController::TestRequest.new, ActionController::TestResponse.new
- @request.host = "test.actioncontroller.i"
- end
-
- def test_with_http_1_0_request
- @request.host = nil
- assert_nothing_raised { get :public_action }
- end
-end
diff --git a/vendor/rails/actionpack/test/controller/caching_test.rb b/vendor/rails/actionpack/test/controller/caching_test.rb
deleted file mode 100644
index f9b6b87b..00000000
--- a/vendor/rails/actionpack/test/controller/caching_test.rb
+++ /dev/null
@@ -1,610 +0,0 @@
-require 'fileutils'
-require 'abstract_unit'
-
-CACHE_DIR = 'test_cache'
-# Don't change '/../temp/' cavalierly or you might hose something you don't want hosed
-FILE_STORE_PATH = File.join(File.dirname(__FILE__), '/../temp/', CACHE_DIR)
-ActionController::Base.page_cache_directory = FILE_STORE_PATH
-ActionController::Base.cache_store = :file_store, FILE_STORE_PATH
-ActionController::Base.view_paths = [ File.dirname(__FILE__) + '/../fixtures/' ]
-
-class PageCachingTestController < ActionController::Base
- caches_page :ok, :no_content, :if => Proc.new { |c| !c.request.format.json? }
- caches_page :found, :not_found
-
- def ok
- head :ok
- end
-
- def no_content
- head :no_content
- end
-
- def found
- redirect_to :action => 'ok'
- end
-
- def not_found
- head :not_found
- end
-
- def custom_path
- render :text => "Super soaker"
- cache_page("Super soaker", "/index.html")
- end
-
- def expire_custom_path
- expire_page("/index.html")
- head :ok
- end
-
- def trailing_slash
- render :text => "Sneak attack"
- end
-end
-
-class PageCachingTest < Test::Unit::TestCase
- def setup
- ActionController::Base.perform_caching = true
-
- ActionController::Routing::Routes.draw do |map|
- map.main '', :controller => 'posts'
- map.resources :posts
- map.connect ':controller/:action/:id'
- end
-
- @request = ActionController::TestRequest.new
- @request.host = 'hostname.com'
-
- @response = ActionController::TestResponse.new
- @controller = PageCachingTestController.new
-
- @params = {:controller => 'posts', :action => 'index', :only_path => true, :skip_relative_url_root => true}
- @rewriter = ActionController::UrlRewriter.new(@request, @params)
-
- FileUtils.rm_rf(File.dirname(FILE_STORE_PATH))
- FileUtils.mkdir_p(FILE_STORE_PATH)
- end
-
- def teardown
- FileUtils.rm_rf(File.dirname(FILE_STORE_PATH))
-
- ActionController::Base.perform_caching = false
- end
-
- def test_page_caching_resources_saves_to_correct_path_with_extension_even_if_default_route
- @params[:format] = 'rss'
- assert_equal '/posts.rss', @rewriter.rewrite(@params)
- @params[:format] = nil
- assert_equal '/', @rewriter.rewrite(@params)
- end
-
- def test_should_cache_get_with_ok_status
- get :ok
- assert_response :ok
- assert_page_cached :ok, "get with ok status should have been cached"
- end
-
- def test_should_cache_with_custom_path
- get :custom_path
- assert File.exist?("#{FILE_STORE_PATH}/index.html")
- end
-
- def test_should_expire_cache_with_custom_path
- get :custom_path
- assert File.exist?("#{FILE_STORE_PATH}/index.html")
-
- get :expire_custom_path
- assert !File.exist?("#{FILE_STORE_PATH}/index.html")
- end
-
- def test_should_cache_without_trailing_slash_on_url
- @controller.class.cache_page 'cached content', '/page_caching_test/trailing_slash'
- assert File.exist?("#{FILE_STORE_PATH}/page_caching_test/trailing_slash.html")
- end
-
- def test_should_cache_with_trailing_slash_on_url
- @controller.class.cache_page 'cached content', '/page_caching_test/trailing_slash/'
- assert File.exist?("#{FILE_STORE_PATH}/page_caching_test/trailing_slash.html")
- end
-
- uses_mocha("should_cache_ok_at_custom_path") do
- def test_should_cache_ok_at_custom_path
- @request.expects(:path).returns("/index.html")
- get :ok
- assert_response :ok
- assert File.exist?("#{FILE_STORE_PATH}/index.html")
- end
- end
-
- [:ok, :no_content, :found, :not_found].each do |status|
- [:get, :post, :put, :delete].each do |method|
- unless method == :get and status == :ok
- define_method "test_shouldnt_cache_#{method}_with_#{status}_status" do
- @request.env['REQUEST_METHOD'] = method.to_s.upcase
- process status
- assert_response status
- assert_page_not_cached status, "#{method} with #{status} status shouldn't have been cached"
- end
- end
- end
- end
-
- def test_page_caching_conditional_options
- @request.env['HTTP_ACCEPT'] = 'application/json'
- get :ok
- assert_page_not_cached :ok
- end
-
- private
- def assert_page_cached(action, message = "#{action} should have been cached")
- assert page_cached?(action), message
- end
-
- def assert_page_not_cached(action, message = "#{action} shouldn't have been cached")
- assert !page_cached?(action), message
- end
-
- def page_cached?(action)
- File.exist? "#{FILE_STORE_PATH}/page_caching_test/#{action}.html"
- end
-end
-
-
-class ActionCachingTestController < ActionController::Base
- caches_action :index, :redirected, :forbidden, :if => Proc.new { |c| !c.request.format.json? }
- caches_action :show, :cache_path => 'http://test.host/custom/show'
- caches_action :edit, :cache_path => Proc.new { |c| c.params[:id] ? "http://test.host/#{c.params[:id]};edit" : "http://test.host/edit" }
- caches_action :with_layout
-
- layout 'talk_from_action.erb'
-
- def index
- @cache_this = MockTime.now.to_f.to_s
- render :text => @cache_this
- end
-
- def redirected
- redirect_to :action => 'index'
- end
-
- def forbidden
- render :text => "Forbidden"
- headers["Status"] = "403 Forbidden"
- end
-
- def with_layout
- @cache_this = MockTime.now.to_f.to_s
- render :text => @cache_this, :layout => true
- end
-
- alias_method :show, :index
- alias_method :edit, :index
- alias_method :destroy, :index
-
- def expire
- expire_action :controller => 'action_caching_test', :action => 'index'
- render :nothing => true
- end
-end
-
-class MockTime < Time
- # Let Time spicy to assure that Time.now != Time.now
- def to_f
- super+rand
- end
-end
-
-class ActionCachingMockController
- attr_accessor :mock_url_for
- attr_accessor :mock_path
-
- def initialize
- yield self if block_given?
- end
-
- def url_for(*args)
- @mock_url_for
- end
-
- def request
- mocked_path = @mock_path
- Object.new.instance_eval(<<-EVAL)
- def path; '#{@mock_path}' end
- self
- EVAL
- end
-end
-
-class ActionCacheTest < Test::Unit::TestCase
- def setup
- reset!
- FileUtils.mkdir_p(FILE_STORE_PATH)
- @path_class = ActionController::Caching::Actions::ActionCachePath
- @mock_controller = ActionCachingMockController.new
- end
-
- def teardown
- FileUtils.rm_rf(File.dirname(FILE_STORE_PATH))
- end
-
- def test_simple_action_cache
- get :index
- cached_time = content_to_cache
- assert_equal cached_time, @response.body
- assert fragment_exist?('hostname.com/action_caching_test')
- reset!
-
- get :index
- assert_equal cached_time, @response.body
- end
-
- def test_simple_action_not_cached
- get :destroy
- cached_time = content_to_cache
- assert_equal cached_time, @response.body
- assert !fragment_exist?('hostname.com/action_caching_test/destroy')
- reset!
-
- get :destroy
- assert_not_equal cached_time, @response.body
- end
-
- def test_action_cache_with_layout
- get :with_layout
- cached_time = content_to_cache
- assert_not_equal cached_time, @response.body
- assert fragment_exist?('hostname.com/action_caching_test/with_layout')
- reset!
-
- get :with_layout
- assert_not_equal cached_time, @response.body
-
- assert_equal @response.body, read_fragment('hostname.com/action_caching_test/with_layout')
- end
-
- def test_action_cache_conditional_options
- @request.env['HTTP_ACCEPT'] = 'application/json'
- get :index
- assert !fragment_exist?('hostname.com/action_caching_test')
- end
-
- def test_action_cache_with_custom_cache_path
- get :show
- cached_time = content_to_cache
- assert_equal cached_time, @response.body
- assert fragment_exist?('test.host/custom/show')
- reset!
-
- get :show
- assert_equal cached_time, @response.body
- end
-
- def test_action_cache_with_custom_cache_path_in_block
- get :edit
- assert fragment_exist?('test.host/edit')
- reset!
-
- get :edit, :id => 1
- assert fragment_exist?('test.host/1;edit')
- end
-
- def test_cache_expiration
- get :index
- cached_time = content_to_cache
- reset!
-
- get :index
- assert_equal cached_time, @response.body
- reset!
-
- get :expire
- reset!
-
- get :index
- new_cached_time = content_to_cache
- assert_not_equal cached_time, @response.body
- reset!
-
- get :index
- assert_response :success
- assert_equal new_cached_time, @response.body
- end
-
- def test_cache_is_scoped_by_subdomain
- @request.host = 'jamis.hostname.com'
- get :index
- jamis_cache = content_to_cache
-
- reset!
-
- @request.host = 'david.hostname.com'
- get :index
- david_cache = content_to_cache
- assert_not_equal jamis_cache, @response.body
-
- reset!
-
- @request.host = 'jamis.hostname.com'
- get :index
- assert_equal jamis_cache, @response.body
-
- reset!
-
- @request.host = 'david.hostname.com'
- get :index
- assert_equal david_cache, @response.body
- end
-
- def test_redirect_is_not_cached
- get :redirected
- assert_response :redirect
- reset!
-
- get :redirected
- assert_response :redirect
- end
-
- def test_forbidden_is_not_cached
- get :forbidden
- assert_response :forbidden
- reset!
-
- get :forbidden
- assert_response :forbidden
- end
-
- def test_xml_version_of_resource_is_treated_as_different_cache
- @mock_controller.mock_url_for = 'http://example.org/posts/'
- @mock_controller.mock_path = '/posts/index.xml'
- path_object = @path_class.new(@mock_controller, {})
- assert_equal 'xml', path_object.extension
- assert_equal 'example.org/posts/index.xml', path_object.path
- end
-
- def test_correct_content_type_is_returned_for_cache_hit
- # run it twice to cache it the first time
- get :index, :id => 'content-type.xml'
- get :index, :id => 'content-type.xml'
- assert_equal 'application/xml', @response.content_type
- end
-
- def test_empty_path_is_normalized
- @mock_controller.mock_url_for = 'http://example.org/'
- @mock_controller.mock_path = '/'
-
- assert_equal 'example.org/index', @path_class.path_for(@mock_controller, {})
- end
-
- def test_file_extensions
- get :index, :id => 'kitten.jpg'
- get :index, :id => 'kitten.jpg'
-
- assert_response :success
- end
-
- private
- def content_to_cache
- assigns(:cache_this)
- end
-
- def reset!
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- @controller = ActionCachingTestController.new
- @request.host = 'hostname.com'
- end
-
- def fragment_exist?(path)
- @controller.fragment_exist?(path)
- end
-
- def read_fragment(path)
- @controller.read_fragment(path)
- end
-end
-
-class FragmentCachingTestController < ActionController::Base
- def some_action; end;
-end
-
-class FragmentCachingTest < Test::Unit::TestCase
- def setup
- ActionController::Base.perform_caching = true
- @store = ActiveSupport::Cache::MemoryStore.new
- ActionController::Base.cache_store = @store
- @controller = FragmentCachingTestController.new
- @params = {:controller => 'posts', :action => 'index'}
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- @controller.params = @params
- @controller.request = @request
- @controller.response = @response
- @controller.send(:initialize_current_url)
- end
-
- def test_fragment_cache_key
- assert_equal 'views/what a key', @controller.fragment_cache_key('what a key')
- assert_equal( "views/test.host/fragment_caching_test/some_action",
- @controller.fragment_cache_key(:controller => 'fragment_caching_test',:action => 'some_action'))
- end
-
- def test_read_fragment__with_caching_enabled
- @store.write('views/name', 'value')
- assert_equal 'value', @controller.read_fragment('name')
- end
-
- def test_read_fragment__with_caching_disabled
- ActionController::Base.perform_caching = false
- @store.write('views/name', 'value')
- assert_nil @controller.read_fragment('name')
- end
-
- def test_fragment_exist__with_caching_enabled
- @store.write('views/name', 'value')
- assert @controller.fragment_exist?('name')
- assert !@controller.fragment_exist?('other_name')
- end
-
- def test_fragment_exist__with_caching_disabled
- ActionController::Base.perform_caching = false
- @store.write('views/name', 'value')
- assert !@controller.fragment_exist?('name')
- assert !@controller.fragment_exist?('other_name')
- end
-
- def test_write_fragment__with_caching_enabled
- assert_nil @store.read('views/name')
- assert_equal 'value', @controller.write_fragment('name', 'value')
- assert_equal 'value', @store.read('views/name')
- end
-
- def test_write_fragment__with_caching_disabled
- assert_nil @store.read('views/name')
- ActionController::Base.perform_caching = false
- assert_equal nil, @controller.write_fragment('name', 'value')
- assert_nil @store.read('views/name')
- end
-
- def test_expire_fragment__with_simple_key
- @store.write('views/name', 'value')
- @controller.expire_fragment 'name'
- assert_nil @store.read('views/name')
- end
-
- def test_expire_fragment__with__regexp
- @store.write('views/name', 'value')
- @store.write('views/another_name', 'another_value')
- @store.write('views/primalgrasp', 'will not expire ;-)')
-
- @controller.expire_fragment /name/
-
- assert_nil @store.read('views/name')
- assert_nil @store.read('views/another_name')
- assert_equal 'will not expire ;-)', @store.read('views/primalgrasp')
- end
-
- def test_fragment_for__with_disabled_caching
- ActionController::Base.perform_caching = false
-
- @store.write('views/expensive', 'fragment content')
- fragment_computed = false
-
- buffer = 'generated till now -> '
- @controller.fragment_for(Proc.new { fragment_computed = true }, 'expensive') { buffer }
-
- assert fragment_computed
- assert_equal 'generated till now -> ', buffer
- end
-
- def test_fragment_for
- @store.write('views/expensive', 'fragment content')
- fragment_computed = false
-
- buffer = 'generated till now -> '
- @controller.fragment_for(Proc.new { fragment_computed = true }, 'expensive') { buffer}
-
- assert !fragment_computed
- assert_equal 'generated till now -> fragment content', buffer
- end
-
- def test_cache_erb_fragment
- @store.write('views/expensive', 'fragment content')
- _erbout = 'generated till now -> '
-
- assert_equal( 'generated till now -> fragment content',
- ActionView::TemplateHandlers::ERB.new(@controller).cache_fragment(Proc.new{ }, 'expensive'))
- end
-
- def test_cache_rxml_fragment
- @store.write('views/expensive', 'fragment content')
- xml = 'generated till now -> '
- class << xml; def target!; to_s; end; end
-
- assert_equal( 'generated till now -> fragment content',
- ActionView::TemplateHandlers::Builder.new(@controller).cache_fragment(Proc.new{ }, 'expensive'))
- end
-
- def test_cache_rjs_fragment
- @store.write('views/expensive', 'fragment content')
- page = 'generated till now -> '
-
- assert_equal( 'generated till now -> fragment content',
- ActionView::TemplateHandlers::RJS.new(@controller).cache_fragment(Proc.new{ }, 'expensive'))
- end
-
- def test_cache_rjs_fragment_debug_mode_does_not_interfere
- @store.write('views/expensive', 'fragment content')
- page = 'generated till now -> '
-
- begin
- debug_mode, ActionView::Base.debug_rjs = ActionView::Base.debug_rjs, true
- assert_equal( 'generated till now -> fragment content',
- ActionView::TemplateHandlers::RJS.new(@controller).cache_fragment(Proc.new{ }, 'expensive'))
- assert ActionView::Base.debug_rjs
- ensure
- ActionView::Base.debug_rjs = debug_mode
- end
- end
-end
-
-
-class FunctionalCachingController < ActionController::Base
- def fragment_cached
- end
-
- def html_fragment_cached_with_partial
- respond_to do |format|
- format.html
- end
- end
-
- def js_fragment_cached_with_partial
- respond_to do |format|
- format.js
- end
- end
-
-
- def rescue_action(e)
- raise e
- end
-end
-
-FunctionalCachingController.view_paths = [ File.dirname(__FILE__) + "/../fixtures/" ]
-
-class FunctionalFragmentCachingTest < Test::Unit::TestCase
- def setup
- ActionController::Base.perform_caching = true
- @store = ActiveSupport::Cache::MemoryStore.new
- ActionController::Base.cache_store = @store
- @controller = FunctionalCachingController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- end
- def test_fragment_caching
- get :fragment_cached
- assert_response :success
- expected_body = <<-CACHED
-Hello
-This bit's fragment cached
-CACHED
- assert_equal expected_body, @response.body
-
- assert_equal "This bit's fragment cached", @store.read('views/test.host/functional_caching/fragment_cached')
- end
-
- def test_fragment_caching_in_partials
- get :html_fragment_cached_with_partial
- assert_response :success
- assert_match /Fragment caching in a partial/, @response.body
- assert_match "Fragment caching in a partial", @store.read('views/test.host/functional_caching/html_fragment_cached_with_partial')
- end
-
- def test_fragment_caching_in_rjs_partials
- xhr :get, :js_fragment_cached_with_partial
- assert_response :success
- assert_match /Fragment caching in a partial/, @response.body
- assert_match "Fragment caching in a partial", @store.read('views/test.host/functional_caching/js_fragment_cached_with_partial')
- end
-end
diff --git a/vendor/rails/actionpack/test/controller/capture_test.rb b/vendor/rails/actionpack/test/controller/capture_test.rb
deleted file mode 100644
index aaafea39..00000000
--- a/vendor/rails/actionpack/test/controller/capture_test.rb
+++ /dev/null
@@ -1,89 +0,0 @@
-require 'abstract_unit'
-
-class CaptureController < ActionController::Base
- def self.controller_name; "test"; end
- def self.controller_path; "test"; end
-
- def content_for
- render :layout => "talk_from_action"
- end
-
- def content_for_with_parameter
- render :layout => "talk_from_action"
- end
-
- def content_for_concatenated
- render :layout => "talk_from_action"
- end
-
- def erb_content_for
- render :layout => "talk_from_action"
- end
-
- def block_content_for
- render :layout => "talk_from_action"
- end
-
- def non_erb_block_content_for
- render :layout => "talk_from_action"
- end
-
- def rescue_action(e) raise end
-end
-
-CaptureController.view_paths = [ File.dirname(__FILE__) + "/../fixtures/" ]
-
-class CaptureTest < Test::Unit::TestCase
- def setup
- @controller = CaptureController.new
-
- # enable a logger so that (e.g.) the benchmarking stuff runs, so we can get
- # a more accurate simulation of what happens in "real life".
- @controller.logger = Logger.new(nil)
-
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
-
- @request.host = "www.nextangle.com"
- end
-
- def test_simple_capture
- get :capturing
- assert_equal "Dreamy days", @response.body.strip
- end
-
- def test_content_for
- get :content_for
- assert_equal expected_content_for_output, @response.body
- end
-
- def test_should_concatentate_content_for
- get :content_for_concatenated
- assert_equal expected_content_for_output, @response.body
- end
-
- def test_erb_content_for
- get :erb_content_for
- assert_equal expected_content_for_output, @response.body
- end
-
- def test_should_set_content_for_with_parameter
- get :content_for_with_parameter
- assert_equal expected_content_for_output, @response.body
- end
-
- def test_block_content_for
- get :block_content_for
- assert_equal expected_content_for_output, @response.body
- end
-
- def test_non_erb_block_content_for
- get :non_erb_block_content_for
- assert_equal expected_content_for_output, @response.body
- end
-
- private
- def expected_content_for_output
- "Putting stuff in the title!\n\nGreat stuff!"
- end
-end
diff --git a/vendor/rails/actionpack/test/controller/cgi_test.rb b/vendor/rails/actionpack/test/controller/cgi_test.rb
deleted file mode 100755
index 87f72fda..00000000
--- a/vendor/rails/actionpack/test/controller/cgi_test.rb
+++ /dev/null
@@ -1,116 +0,0 @@
-require 'abstract_unit'
-require 'action_controller/cgi_process'
-
-class BaseCgiTest < Test::Unit::TestCase
- def setup
- @request_hash = {"HTTP_MAX_FORWARDS"=>"10", "SERVER_NAME"=>"glu.ttono.us:8007", "FCGI_ROLE"=>"RESPONDER", "HTTP_X_FORWARDED_HOST"=>"glu.ttono.us", "HTTP_ACCEPT_ENCODING"=>"gzip, deflate", "HTTP_USER_AGENT"=>"Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.5.1 (KHTML, like Gecko) Safari/312.3.1", "PATH_INFO"=>"", "HTTP_ACCEPT_LANGUAGE"=>"en", "HTTP_HOST"=>"glu.ttono.us:8007", "SERVER_PROTOCOL"=>"HTTP/1.1", "REDIRECT_URI"=>"/dispatch.fcgi", "SCRIPT_NAME"=>"/dispatch.fcgi", "SERVER_ADDR"=>"207.7.108.53", "REMOTE_ADDR"=>"207.7.108.53", "SERVER_SOFTWARE"=>"lighttpd/1.4.5", "HTTP_COOKIE"=>"_session_id=c84ace84796670c052c6ceb2451fb0f2; is_admin=yes", "HTTP_X_FORWARDED_SERVER"=>"glu.ttono.us", "REQUEST_URI"=>"/admin", "DOCUMENT_ROOT"=>"/home/kevinc/sites/typo/public", "SERVER_PORT"=>"8007", "QUERY_STRING"=>"", "REMOTE_PORT"=>"63137", "GATEWAY_INTERFACE"=>"CGI/1.1", "HTTP_X_FORWARDED_FOR"=>"65.88.180.234", "HTTP_ACCEPT"=>"*/*", "SCRIPT_FILENAME"=>"/home/kevinc/sites/typo/public/dispatch.fcgi", "REDIRECT_STATUS"=>"200", "REQUEST_METHOD"=>"GET"}
- # some Nokia phone browsers omit the space after the semicolon separator.
- # some developers have grown accustomed to using comma in cookie values.
- @alt_cookie_fmt_request_hash = {"HTTP_COOKIE"=>"_session_id=c84ace847,96670c052c6ceb2451fb0f2;is_admin=yes"}
- @fake_cgi = Struct.new(:env_table).new(@request_hash)
- @request = ActionController::CgiRequest.new(@fake_cgi)
- end
-
- def default_test; end
-end
-
-
-class CgiRequestTest < BaseCgiTest
- def test_proxy_request
- assert_equal 'glu.ttono.us', @request.host_with_port
- end
-
- def test_http_host
- @request_hash.delete "HTTP_X_FORWARDED_HOST"
- @request_hash['HTTP_HOST'] = "rubyonrails.org:8080"
- assert_equal "rubyonrails.org:8080", @request.host_with_port
-
- @request_hash['HTTP_X_FORWARDED_HOST'] = "www.firsthost.org, www.secondhost.org"
- assert_equal "www.secondhost.org", @request.host
- end
-
- def test_http_host_with_default_port_overrides_server_port
- @request_hash.delete "HTTP_X_FORWARDED_HOST"
- @request_hash['HTTP_HOST'] = "rubyonrails.org"
- assert_equal "rubyonrails.org", @request.host_with_port
- end
-
- def test_host_with_port_defaults_to_server_name_if_no_host_headers
- @request_hash.delete "HTTP_X_FORWARDED_HOST"
- @request_hash.delete "HTTP_HOST"
- assert_equal "glu.ttono.us:8007", @request.host_with_port
- end
-
- def test_host_with_port_falls_back_to_server_addr_if_necessary
- @request_hash.delete "HTTP_X_FORWARDED_HOST"
- @request_hash.delete "HTTP_HOST"
- @request_hash.delete "SERVER_NAME"
- assert_equal "207.7.108.53:8007", @request.host_with_port
- end
-
- def test_host_with_port_if_http_standard_port_is_specified
- @request_hash['HTTP_X_FORWARDED_HOST'] = "glu.ttono.us:80"
- assert_equal "glu.ttono.us", @request.host_with_port
- end
-
- def test_host_with_port_if_https_standard_port_is_specified
- @request_hash['HTTP_X_FORWARDED_PROTO'] = "https"
- @request_hash['HTTP_X_FORWARDED_HOST'] = "glu.ttono.us:443"
- assert_equal "glu.ttono.us", @request.host_with_port
- end
-
- def test_host_if_ipv6_reference
- @request_hash.delete "HTTP_X_FORWARDED_HOST"
- @request_hash['HTTP_HOST'] = "[2001:1234:5678:9abc:def0::dead:beef]"
- assert_equal "[2001:1234:5678:9abc:def0::dead:beef]", @request.host
- end
-
- def test_host_if_ipv6_reference_with_port
- @request_hash.delete "HTTP_X_FORWARDED_HOST"
- @request_hash['HTTP_HOST'] = "[2001:1234:5678:9abc:def0::dead:beef]:8008"
- assert_equal "[2001:1234:5678:9abc:def0::dead:beef]", @request.host
- end
-
- def test_cookie_syntax_resilience
- cookies = CGI::Cookie::parse(@request_hash["HTTP_COOKIE"]);
- assert_equal ["c84ace84796670c052c6ceb2451fb0f2"], cookies["_session_id"], cookies.inspect
- assert_equal ["yes"], cookies["is_admin"], cookies.inspect
-
- alt_cookies = CGI::Cookie::parse(@alt_cookie_fmt_request_hash["HTTP_COOKIE"]);
- assert_equal ["c84ace847,96670c052c6ceb2451fb0f2"], alt_cookies["_session_id"], alt_cookies.inspect
- assert_equal ["yes"], alt_cookies["is_admin"], alt_cookies.inspect
- end
-end
-
-
-class CgiRequestParamsParsingTest < BaseCgiTest
- def test_doesnt_break_when_content_type_has_charset
- data = 'flamenco=love'
- @request.env['CONTENT_LENGTH'] = data.length
- @request.env['CONTENT_TYPE'] = 'application/x-www-form-urlencoded; charset=utf-8'
- @request.env['RAW_POST_DATA'] = data
- assert_equal({"flamenco"=> "love"}, @request.request_parameters)
- end
-
- def test_doesnt_interpret_request_uri_as_query_string_when_missing
- @request.env['REQUEST_URI'] = 'foo'
- assert_equal({}, @request.query_parameters)
- end
-end
-
-
-class CgiRequestNeedsRewoundTest < BaseCgiTest
- def test_body_should_be_rewound
- data = 'foo'
- fake_cgi = Struct.new(:env_table, :query_string, :stdinput).new(@request_hash, '', StringIO.new(data))
- fake_cgi.env_table['CONTENT_LENGTH'] = data.length
- fake_cgi.env_table['CONTENT_TYPE'] = 'application/x-www-form-urlencoded; charset=utf-8'
-
- # Read the request body by parsing params.
- request = ActionController::CgiRequest.new(fake_cgi)
- request.request_parameters
-
- # Should have rewound the body.
- assert_equal 0, request.body.pos
- end
-end
diff --git a/vendor/rails/actionpack/test/controller/components_test.rb b/vendor/rails/actionpack/test/controller/components_test.rb
deleted file mode 100644
index 82c55483..00000000
--- a/vendor/rails/actionpack/test/controller/components_test.rb
+++ /dev/null
@@ -1,140 +0,0 @@
-require 'abstract_unit'
-
-class CallerController < ActionController::Base
- def calling_from_controller
- render_component(:controller => "callee", :action => "being_called")
- end
-
- def calling_from_controller_with_params
- render_component(:controller => "callee", :action => "being_called", :params => { "name" => "David" })
- end
-
- def calling_from_controller_with_different_status_code
- render_component(:controller => "callee", :action => "blowing_up")
- end
-
- def calling_from_template
- render :inline => "Ring, ring: <%= render_component(:controller => 'callee', :action => 'being_called') %>"
- end
-
- def internal_caller
- render :inline => "Are you there? <%= render_component(:action => 'internal_callee') %>"
- end
-
- def internal_callee
- render :text => "Yes, ma'am"
- end
-
- def set_flash
- render_component(:controller => "callee", :action => "set_flash")
- end
-
- def use_flash
- render_component(:controller => "callee", :action => "use_flash")
- end
-
- def calling_redirected
- render_component(:controller => "callee", :action => "redirected")
- end
-
- def calling_redirected_as_string
- render :inline => "<%= render_component(:controller => 'callee', :action => 'redirected') %>"
- end
-
- def rescue_action(e) raise end
-end
-
-class CalleeController < ActionController::Base
- def being_called
- render :text => "#{params[:name] || "Lady"} of the House, speaking"
- end
-
- def blowing_up
- render :text => "It's game over, man, just game over, man!", :status => 500
- end
-
- def set_flash
- flash[:notice] = 'My stoney baby'
- render :text => 'flash is set'
- end
-
- def use_flash
- render :text => flash[:notice] || 'no flash'
- end
-
- def redirected
- redirect_to :controller => "callee", :action => "being_called"
- end
-
- def rescue_action(e) raise end
-end
-
-class ComponentsTest < Test::Unit::TestCase
- def setup
- @controller = CallerController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- end
-
- def test_calling_from_controller
- get :calling_from_controller
- assert_equal "Lady of the House, speaking", @response.body
- end
-
- def test_calling_from_controller_with_params
- get :calling_from_controller_with_params
- assert_equal "David of the House, speaking", @response.body
- end
-
- def test_calling_from_controller_with_different_status_code
- get :calling_from_controller_with_different_status_code
- assert_equal 500, @response.response_code
- end
-
- def test_calling_from_template
- get :calling_from_template
- assert_equal "Ring, ring: Lady of the House, speaking", @response.body
- end
-
- def test_etag_is_set_for_parent_template_when_calling_from_template
- get :calling_from_template
- expected_etag = etag_for("Ring, ring: Lady of the House, speaking")
- assert_equal expected_etag, @response.headers['ETag']
- end
-
- def test_internal_calling
- get :internal_caller
- assert_equal "Are you there? Yes, ma'am", @response.body
- end
-
- def test_flash
- get :set_flash
- assert_equal 'My stoney baby', flash[:notice]
- get :use_flash
- assert_equal 'My stoney baby', @response.body
- get :use_flash
- assert_equal 'no flash', @response.body
- end
-
- def test_component_redirect_redirects
- get :calling_redirected
-
- assert_redirected_to :action => "being_called"
- end
-
- def test_component_multiple_redirect_redirects
- test_component_redirect_redirects
- test_internal_calling
- end
-
- def test_component_as_string_redirect_renders_redirected_action
- get :calling_redirected_as_string
-
- assert_equal "Lady of the House, speaking", @response.body
- end
-
- protected
- def etag_for(text)
- %("#{Digest::MD5.hexdigest(text)}")
- end
-end
diff --git a/vendor/rails/actionpack/test/controller/content_type_test.rb b/vendor/rails/actionpack/test/controller/content_type_test.rb
deleted file mode 100644
index d262ce81..00000000
--- a/vendor/rails/actionpack/test/controller/content_type_test.rb
+++ /dev/null
@@ -1,139 +0,0 @@
-require 'abstract_unit'
-
-class ContentTypeController < ActionController::Base
- def render_content_type_from_body
- response.content_type = Mime::RSS
- render :text => "hello world!"
- end
-
- def render_defaults
- render :text => "hello world!"
- end
-
- def render_content_type_from_render
- render :text => "hello world!", :content_type => Mime::RSS
- end
-
- def render_charset_from_body
- response.charset = "utf-16"
- render :text => "hello world!"
- end
-
- def render_default_for_rhtml
- end
-
- def render_default_for_rxml
- end
-
- def render_default_for_rjs
- end
-
- def render_change_for_rxml
- response.content_type = Mime::HTML
- render :action => "render_default_for_rxml"
- end
-
- def render_default_content_types_for_respond_to
- respond_to do |format|
- format.html { render :text => "hello world!" }
- format.xml { render :action => "render_default_content_types_for_respond_to.rhtml" }
- format.js { render :text => "hello world!" }
- format.rss { render :text => "hello world!", :content_type => Mime::XML }
- end
- end
-
- def rescue_action(e) raise end
-end
-
-ContentTypeController.view_paths = [ File.dirname(__FILE__) + "/../fixtures/" ]
-
-class ContentTypeTest < Test::Unit::TestCase
- def setup
- @controller = ContentTypeController.new
-
- # enable a logger so that (e.g.) the benchmarking stuff runs, so we can get
- # a more accurate simulation of what happens in "real life".
- @controller.logger = Logger.new(nil)
-
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- end
-
- def test_render_defaults
- get :render_defaults
- assert_equal "utf-8", @response.charset
- assert_equal Mime::HTML, @response.content_type
- end
-
- def test_render_changed_charset_default
- ContentTypeController.default_charset = "utf-16"
- get :render_defaults
- assert_equal "utf-16", @response.charset
- assert_equal Mime::HTML, @response.content_type
- ContentTypeController.default_charset = "utf-8"
- end
-
- def test_content_type_from_body
- get :render_content_type_from_body
- assert_equal "application/rss+xml", @response.content_type
- assert_equal "utf-8", @response.charset
- end
-
- def test_content_type_from_render
- get :render_content_type_from_render
- assert_equal "application/rss+xml", @response.content_type
- assert_equal "utf-8", @response.charset
- end
-
- def test_charset_from_body
- get :render_charset_from_body
- assert_equal "utf-16", @response.charset
- assert_equal Mime::HTML, @response.content_type
- end
-
- def test_default_for_rhtml
- get :render_default_for_rhtml
- assert_equal Mime::HTML, @response.content_type
- assert_equal "utf-8", @response.charset
- end
-
- def test_default_for_rxml
- get :render_default_for_rxml
- assert_equal Mime::XML, @response.content_type
- assert_equal "utf-8", @response.charset
- end
-
- def test_default_for_rjs
- xhr :post, :render_default_for_rjs
- assert_equal Mime::JS, @response.content_type
- assert_equal "utf-8", @response.charset
- end
-
- def test_change_for_rxml
- get :render_change_for_rxml
- assert_equal Mime::HTML, @response.content_type
- assert_equal "utf-8", @response.charset
- end
-
- def test_render_default_content_types_for_respond_to
- @request.env["HTTP_ACCEPT"] = Mime::HTML.to_s
- get :render_default_content_types_for_respond_to
- assert_equal Mime::HTML, @response.content_type
-
- @request.env["HTTP_ACCEPT"] = Mime::JS.to_s
- get :render_default_content_types_for_respond_to
- assert_equal Mime::JS, @response.content_type
- end
-
- def test_render_default_content_types_for_respond_to_with_template
- @request.env["HTTP_ACCEPT"] = Mime::XML.to_s
- get :render_default_content_types_for_respond_to
- assert_equal Mime::XML, @response.content_type
- end
-
- def test_render_default_content_types_for_respond_to_with_overwrite
- @request.env["HTTP_ACCEPT"] = Mime::RSS.to_s
- get :render_default_content_types_for_respond_to
- assert_equal Mime::XML, @response.content_type
- end
-end
diff --git a/vendor/rails/actionpack/test/controller/controller_fixtures/app/controllers/admin/user_controller.rb b/vendor/rails/actionpack/test/controller/controller_fixtures/app/controllers/admin/user_controller.rb
deleted file mode 100644
index e69de29b..00000000
diff --git a/vendor/rails/actionpack/test/controller/controller_fixtures/app/controllers/user_controller.rb b/vendor/rails/actionpack/test/controller/controller_fixtures/app/controllers/user_controller.rb
deleted file mode 100644
index e69de29b..00000000
diff --git a/vendor/rails/actionpack/test/controller/controller_fixtures/vendor/plugins/bad_plugin/lib/plugin_controller.rb b/vendor/rails/actionpack/test/controller/controller_fixtures/vendor/plugins/bad_plugin/lib/plugin_controller.rb
deleted file mode 100644
index e69de29b..00000000
diff --git a/vendor/rails/actionpack/test/controller/cookie_test.rb b/vendor/rails/actionpack/test/controller/cookie_test.rb
deleted file mode 100644
index b45fbb17..00000000
--- a/vendor/rails/actionpack/test/controller/cookie_test.rb
+++ /dev/null
@@ -1,146 +0,0 @@
-require 'abstract_unit'
-
-class CookieTest < Test::Unit::TestCase
- class TestController < ActionController::Base
- def authenticate
- cookies["user_name"] = "david"
- end
-
- def authenticate_for_fourteen_days
- cookies["user_name"] = { "value" => "david", "expires" => Time.local(2005, 10, 10) }
- end
-
- def authenticate_for_fourteen_days_with_symbols
- cookies[:user_name] = { :value => "david", :expires => Time.local(2005, 10, 10) }
- end
-
- def set_multiple_cookies
- cookies["user_name"] = { "value" => "david", "expires" => Time.local(2005, 10, 10) }
- cookies["login"] = "XJ-122"
- end
-
- def access_frozen_cookies
- cookies["will"] = "work"
- end
-
- def logout
- cookies.delete("user_name")
- end
-
- def delete_cookie_with_path
- cookies.delete("user_name", :path => '/beaten')
- render :text => "hello world"
- end
-
- def authenticate_with_http_only
- cookies["user_name"] = { :value => "david", :http_only => true }
- end
-
- def rescue_action(e)
- raise unless ActionView::MissingTemplate # No templates here, and we don't care about the output
- end
- end
-
- def setup
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
-
- @controller = TestController.new
- @request.host = "www.nextangle.com"
- end
-
- def test_setting_cookie
- get :authenticate
- assert_equal [ CGI::Cookie::new("name" => "user_name", "value" => "david") ], @response.headers["cookie"]
- end
-
- def test_setting_cookie_for_fourteen_days
- get :authenticate_for_fourteen_days
- assert_equal [ CGI::Cookie::new("name" => "user_name", "value" => "david", "expires" => Time.local(2005, 10, 10)) ], @response.headers["cookie"]
- end
-
- def test_setting_cookie_for_fourteen_days_with_symbols
- get :authenticate_for_fourteen_days
- assert_equal [ CGI::Cookie::new("name" => "user_name", "value" => "david", "expires" => Time.local(2005, 10, 10)) ], @response.headers["cookie"]
- end
-
- def test_setting_cookie_with_http_only
- get :authenticate_with_http_only
- assert_equal [ CGI::Cookie::new("name" => "user_name", "value" => "david", "http_only" => true) ], @response.headers["cookie"]
- assert_equal CGI::Cookie::new("name" => "user_name", "value" => "david", "path" => "/", "http_only" => true).to_s, @response.headers["cookie"][0].to_s
- end
-
- def test_multiple_cookies
- get :set_multiple_cookies
- assert_equal 2, @response.cookies.size
- end
-
- def test_setting_test_cookie
- assert_nothing_raised { get :access_frozen_cookies }
- end
-
- def test_expiring_cookie
- get :logout
- assert_equal [ CGI::Cookie::new("name" => "user_name", "value" => "", "expires" => Time.at(0)) ], @response.headers["cookie"]
- assert_equal CGI::Cookie::new("name" => "user_name", "value" => "", "expires" => Time.at(0)).value, []
- end
-
- def test_cookiejar_accessor
- @request.cookies["user_name"] = CGI::Cookie.new("name" => "user_name", "value" => "david", "expires" => Time.local(2025, 10, 10))
- @controller.request = @request
- jar = ActionController::CookieJar.new(@controller)
- assert_equal "david", jar["user_name"]
- assert_equal nil, jar["something_else"]
- end
-
- def test_cookiejar_accessor_with_array_value
- a = %w{1 2 3}
- @request.cookies["pages"] = CGI::Cookie.new("name" => "pages", "value" => a, "expires" => Time.local(2025, 10, 10))
- @controller.request = @request
- jar = ActionController::CookieJar.new(@controller)
- assert_equal a, jar["pages"]
- end
-
- def test_delete_cookie_with_path
- get :delete_cookie_with_path
- assert_equal "/beaten", @response.headers["cookie"].first.path
- assert_not_equal "/", @response.headers["cookie"].first.path
- end
-
- def test_cookie_to_s_simple_values
- assert_equal 'myname=myvalue; path=', CGI::Cookie.new('myname', 'myvalue').to_s
- end
-
- def test_cookie_to_s_hash
- cookie_str = CGI::Cookie.new(
- 'name' => 'myname',
- 'value' => 'myvalue',
- 'domain' => 'mydomain',
- 'path' => 'mypath',
- 'expires' => Time.utc(2007, 10, 20),
- 'secure' => true,
- 'http_only' => true).to_s
- assert_equal 'myname=myvalue; domain=mydomain; path=mypath; expires=Sat, 20 Oct 2007 00:00:00 GMT; secure; HttpOnly', cookie_str
- end
-
- def test_cookie_to_s_hash_default_not_secure_not_http_only
- cookie_str = CGI::Cookie.new(
- 'name' => 'myname',
- 'value' => 'myvalue',
- 'domain' => 'mydomain',
- 'path' => 'mypath',
- 'expires' => Time.utc(2007, 10, 20))
- assert cookie_str !~ /secure/
- assert cookie_str !~ /HttpOnly/
- end
-
- def test_cookies_should_not_be_split_on_ampersand_values
- cookies = CGI::Cookie.parse('return_to=http://rubyonrails.org/search?term=api&scope=all&global=true')
- assert_equal({"return_to" => ["http://rubyonrails.org/search?term=api&scope=all&global=true"]}, cookies)
- end
-
- def test_cookies_should_not_be_split_on_values_with_newlines
- cookies = CGI::Cookie.new("name" => "val", "value" => "this\nis\na\ntest")
- assert cookies.size == 1
- end
-end
diff --git a/vendor/rails/actionpack/test/controller/custom_handler_test.rb b/vendor/rails/actionpack/test/controller/custom_handler_test.rb
deleted file mode 100644
index ac484ae1..00000000
--- a/vendor/rails/actionpack/test/controller/custom_handler_test.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-require 'abstract_unit'
-
-class CustomHandler < ActionView::TemplateHandler
- def initialize( view )
- @view = view
- end
-
- def render( template )
- [ template.source,
- template.locals,
- @view ]
- end
-end
-
-class CustomHandlerTest < Test::Unit::TestCase
- def setup
- ActionView::Template.register_template_handler "foo", CustomHandler
- ActionView::Template.register_template_handler :foo2, CustomHandler
- @view = ActionView::Base.new
- end
-
- def test_custom_render
- template = ActionView::InlineTemplate.new(@view, "hello <%= one %>", { :one => "two" }, "foo")
-
- result = @view.render_template(template)
- assert_equal(
- [ "hello <%= one %>", { :one => "two" }, @view ],
- result )
- end
-
- def test_custom_render2
- template = ActionView::InlineTemplate.new(@view, "hello <%= one %>", { :one => "two" }, "foo2")
- result = @view.render_template(template)
- assert_equal(
- [ "hello <%= one %>", { :one => "two" }, @view ],
- result )
- end
-
- def test_unhandled_extension
- # uses the ERb handler by default if the extension isn't recognized
- template = ActionView::InlineTemplate.new(@view, "hello <%= one %>", { :one => "two" }, "bar")
- result = @view.render_template(template)
- assert_equal "hello two", result
- end
-end
diff --git a/vendor/rails/actionpack/test/controller/deprecation/deprecated_base_methods_test.rb b/vendor/rails/actionpack/test/controller/deprecation/deprecated_base_methods_test.rb
deleted file mode 100644
index 8c1a8954..00000000
--- a/vendor/rails/actionpack/test/controller/deprecation/deprecated_base_methods_test.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-require 'abstract_unit'
-
-class DeprecatedBaseMethodsTest < Test::Unit::TestCase
- class Target < ActionController::Base
-
- def home_url(greeting)
- "http://example.com/#{greeting}"
- end
-
- def raises_name_error
- this_method_doesnt_exist
- end
-
- def rescue_action(e) raise e end
- end
-
- Target.view_paths = [ File.dirname(__FILE__) + "/../../fixtures" ]
-
- def setup
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- @controller = Target.new
- end
-
- def test_log_error_silences_deprecation_warnings
- get :raises_name_error
- rescue => e
- assert_not_deprecated { @controller.send :log_error, e }
- end
-
- def test_assertion_failed_error_silences_deprecation_warnings
- get :raises_name_error
- rescue => e
- error = Test::Unit::Error.new('testing ur doodz', e)
- assert_not_deprecated { error.message }
- end
-end
diff --git a/vendor/rails/actionpack/test/controller/dispatcher_test.rb b/vendor/rails/actionpack/test/controller/dispatcher_test.rb
deleted file mode 100644
index eea0813e..00000000
--- a/vendor/rails/actionpack/test/controller/dispatcher_test.rb
+++ /dev/null
@@ -1,105 +0,0 @@
-require 'abstract_unit'
-
-uses_mocha 'dispatcher tests' do
-
-require 'action_controller/dispatcher'
-
-class DispatcherTest < Test::Unit::TestCase
- Dispatcher = ActionController::Dispatcher
-
- def setup
- @output = StringIO.new
- ENV['REQUEST_METHOD'] = 'GET'
-
- # Clear callbacks as they are redefined by Dispatcher#define_dispatcher_callbacks
- Dispatcher.instance_variable_set("@prepare_dispatch_callbacks", ActiveSupport::Callbacks::CallbackChain.new)
- Dispatcher.instance_variable_set("@before_dispatch_callbacks", ActiveSupport::Callbacks::CallbackChain.new)
- Dispatcher.instance_variable_set("@after_dispatch_callbacks", ActiveSupport::Callbacks::CallbackChain.new)
-
- Dispatcher.stubs(:require_dependency)
-
- @dispatcher = Dispatcher.new(@output)
- end
-
- def teardown
- ENV.delete 'REQUEST_METHOD'
- end
-
- def test_clears_dependencies_after_dispatch_if_in_loading_mode
- ActionController::Routing::Routes.expects(:reload).once
- Dependencies.expects(:clear).once
-
- dispatch(@output, false)
- end
-
- def test_leaves_dependencies_after_dispatch_if_not_in_loading_mode
- ActionController::Routing::Routes.expects(:reload).never
- Dependencies.expects(:clear).never
-
- dispatch
- end
-
- # Stub out dispatch error logger
- class << Dispatcher
- def log_failsafe_exception(status, exception); end
- end
-
- def test_failsafe_response
- CGI.expects(:new).raises('some multipart parsing failure')
- Dispatcher.expects(:log_failsafe_exception)
-
- assert_nothing_raised { dispatch }
-
- assert_equal "Status: 400 Bad Request\r\nContent-Type: text/html\r\n\r\n
400 Bad Request
", @output.string
- end
-
- def test_prepare_callbacks
- a = b = c = nil
- Dispatcher.to_prepare { |*args| a = b = c = 1 }
- Dispatcher.to_prepare { |*args| b = c = 2 }
- Dispatcher.to_prepare { |*args| c = 3 }
-
- # Ensure to_prepare callbacks are not run when defined
- assert_nil a || b || c
-
- # Run callbacks
- @dispatcher.send :run_callbacks, :prepare_dispatch
-
- assert_equal 1, a
- assert_equal 2, b
- assert_equal 3, c
-
- # Make sure they are only run once
- a = b = c = nil
- @dispatcher.send :dispatch
- assert_nil a || b || c
- end
-
- def test_to_prepare_with_identifier_replaces
- a = b = nil
- Dispatcher.to_prepare(:unique_id) { |*args| a = b = 1 }
- Dispatcher.to_prepare(:unique_id) { |*args| a = 2 }
-
- @dispatcher.send :run_callbacks, :prepare_dispatch
- assert_equal 2, a
- assert_equal nil, b
- end
-
- private
- def dispatch(output = @output, cache_classes = true)
- controller = mock
- controller.stubs(:process).returns(controller)
- controller.stubs(:out).with(output).returns('response')
-
- ActionController::Routing::Routes.stubs(:recognize).returns(controller)
-
- Dispatcher.define_dispatcher_callbacks(cache_classes)
- Dispatcher.dispatch(nil, {}, output)
- end
-
- def assert_subclasses(howmany, klass, message = klass.subclasses.inspect)
- assert_equal howmany, klass.subclasses.size, message
- end
-end
-
-end
diff --git a/vendor/rails/actionpack/test/controller/fake_controllers.rb b/vendor/rails/actionpack/test/controller/fake_controllers.rb
deleted file mode 100644
index 75c114c1..00000000
--- a/vendor/rails/actionpack/test/controller/fake_controllers.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-class << Object; alias_method :const_available?, :const_defined?; end
-
-class ContentController < Class.new(ActionController::Base)
-end
-class NotAController
-end
-module Admin
- class << self; alias_method :const_available?, :const_defined?; end
- class UserController < Class.new(ActionController::Base); end
- class NewsFeedController < Class.new(ActionController::Base); end
-end
-
-# For speed test
-class SpeedController < ActionController::Base; end
-class SearchController < SpeedController; end
-class VideosController < SpeedController; end
-class VideoFileController < SpeedController; end
-class VideoSharesController < SpeedController; end
-class VideoAbusesController < SpeedController; end
-class VideoUploadsController < SpeedController; end
-class VideoVisitsController < SpeedController; end
-class UsersController < SpeedController; end
-class SettingsController < SpeedController; end
-class ChannelsController < SpeedController; end
-class ChannelVideosController < SpeedController; end
-class SessionsController < SpeedController; end
-class LostPasswordsController < SpeedController; end
-class PagesController < SpeedController; end
-
-ActionController::Routing::Routes.draw do |map|
- map.route_one 'route_one', :controller => 'elsewhere', :action => 'flash_me'
- map.connect ':controller/:action/:id'
-end
diff --git a/vendor/rails/actionpack/test/controller/fake_models.rb b/vendor/rails/actionpack/test/controller/fake_models.rb
deleted file mode 100644
index 7420579e..00000000
--- a/vendor/rails/actionpack/test/controller/fake_models.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-class Customer < Struct.new(:name, :id)
- def to_param
- id.to_s
- end
-end
-
-class BadCustomer < Customer
-end
-
-class GoodCustomer < Customer
-end
diff --git a/vendor/rails/actionpack/test/controller/filter_params_test.rb b/vendor/rails/actionpack/test/controller/filter_params_test.rb
deleted file mode 100644
index c4de1018..00000000
--- a/vendor/rails/actionpack/test/controller/filter_params_test.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-require 'abstract_unit'
-
-class FilterParamController < ActionController::Base
-end
-
-class FilterParamTest < Test::Unit::TestCase
- def setup
- @controller = FilterParamController.new
- end
-
- def test_filter_parameters
- assert FilterParamController.respond_to?(:filter_parameter_logging)
- assert !@controller.respond_to?(:filter_parameters)
-
- FilterParamController.filter_parameter_logging
- assert @controller.respond_to?(:filter_parameters)
-
- test_hashes = [[{},{},[]],
- [{'foo'=>nil},{'foo'=>nil},[]],
- [{'foo'=>'bar'},{'foo'=>'bar'},[]],
- [{'foo'=>'bar'},{'foo'=>'bar'},%w'food'],
- [{'foo'=>'bar'},{'foo'=>'[FILTERED]'},%w'foo'],
- [{'foo'=>'bar', 'bar'=>'foo'},{'foo'=>'[FILTERED]', 'bar'=>'foo'},%w'foo baz'],
- [{'foo'=>'bar', 'baz'=>'foo'},{'foo'=>'[FILTERED]', 'baz'=>'[FILTERED]'},%w'foo baz'],
- [{'bar'=>{'foo'=>'bar','bar'=>'foo'}},{'bar'=>{'foo'=>'[FILTERED]','bar'=>'foo'}},%w'fo'],
- [{'foo'=>{'foo'=>'bar','bar'=>'foo'}},{'foo'=>'[FILTERED]'},%w'f banana']]
-
- test_hashes.each do |before_filter, after_filter, filter_words|
- FilterParamController.filter_parameter_logging(*filter_words)
- assert_equal after_filter, @controller.send!(:filter_parameters, before_filter)
-
- filter_words.push('blah')
- FilterParamController.filter_parameter_logging(*filter_words) do |key, value|
- value.reverse! if key =~ /bargain/
- end
-
- before_filter['barg'] = {'bargain'=>'gain', 'blah'=>'bar', 'bar'=>{'bargain'=>{'blah'=>'foo'}}}
- after_filter['barg'] = {'bargain'=>'niag', 'blah'=>'[FILTERED]', 'bar'=>{'bargain'=>{'blah'=>'[FILTERED]'}}}
-
- assert_equal after_filter, @controller.send!(:filter_parameters, before_filter)
- end
- end
-
- def test_filter_parameters_is_protected
- FilterParamController.filter_parameter_logging(:foo)
- assert !FilterParamController.action_methods.include?('filter_parameters')
- assert_raise(NoMethodError) { @controller.filter_parameters([{'password' => '[FILTERED]'}]) }
- end
-end
diff --git a/vendor/rails/actionpack/test/controller/filters_test.rb b/vendor/rails/actionpack/test/controller/filters_test.rb
deleted file mode 100644
index 3652c482..00000000
--- a/vendor/rails/actionpack/test/controller/filters_test.rb
+++ /dev/null
@@ -1,881 +0,0 @@
-require 'abstract_unit'
-
-# FIXME: crashes Ruby 1.9
-class FilterTest < Test::Unit::TestCase
- class TestController < ActionController::Base
- before_filter :ensure_login
- after_filter :clean_up
-
- def show
- render :inline => "ran action"
- end
-
- private
- def ensure_login
- @ran_filter ||= []
- @ran_filter << "ensure_login"
- end
-
- def clean_up
- @ran_after_filter ||= []
- @ran_after_filter << "clean_up"
- end
- end
-
- class ChangingTheRequirementsController < TestController
- before_filter :ensure_login, :except => [:go_wild]
-
- def go_wild
- render :text => "gobble"
- end
- end
-
- class TestMultipleFiltersController < ActionController::Base
- before_filter :try_1
- before_filter :try_2
- before_filter :try_3
-
- (1..3).each do |i|
- define_method "fail_#{i}" do
- render :text => i.to_s
- end
- end
-
- protected
- (1..3).each do |i|
- define_method "try_#{i}" do
- instance_variable_set :@try, i
- if action_name == "fail_#{i}"
- head(404)
- end
- end
- end
- end
-
- class RenderingController < ActionController::Base
- before_filter :render_something_else
-
- def show
- @ran_action = true
- render :inline => "ran action"
- end
-
- private
- def render_something_else
- render :inline => "something else"
- end
- end
-
- class ConditionalFilterController < ActionController::Base
- def show
- render :inline => "ran action"
- end
-
- def another_action
- render :inline => "ran action"
- end
-
- def show_without_filter
- render :inline => "ran action without filter"
- end
-
- private
- def ensure_login
- @ran_filter ||= []
- @ran_filter << "ensure_login"
- end
-
- def clean_up_tmp
- @ran_filter ||= []
- @ran_filter << "clean_up_tmp"
- end
-
- def rescue_action(e) raise(e) end
- end
-
- class ConditionalCollectionFilterController < ConditionalFilterController
- before_filter :ensure_login, :except => [ :show_without_filter, :another_action ]
- end
-
- class OnlyConditionSymController < ConditionalFilterController
- before_filter :ensure_login, :only => :show
- end
-
- class ExceptConditionSymController < ConditionalFilterController
- before_filter :ensure_login, :except => :show_without_filter
- end
-
- class BeforeAndAfterConditionController < ConditionalFilterController
- before_filter :ensure_login, :only => :show
- after_filter :clean_up_tmp, :only => :show
- end
-
- class OnlyConditionProcController < ConditionalFilterController
- before_filter(:only => :show) {|c| c.assigns["ran_proc_filter"] = true }
- end
-
- class ExceptConditionProcController < ConditionalFilterController
- before_filter(:except => :show_without_filter) {|c| c.assigns["ran_proc_filter"] = true }
- end
-
- class ConditionalClassFilter
- def self.filter(controller) controller.assigns["ran_class_filter"] = true end
- end
-
- class OnlyConditionClassController < ConditionalFilterController
- before_filter ConditionalClassFilter, :only => :show
- end
-
- class ExceptConditionClassController < ConditionalFilterController
- before_filter ConditionalClassFilter, :except => :show_without_filter
- end
-
- class AnomolousYetValidConditionController < ConditionalFilterController
- before_filter(ConditionalClassFilter, :ensure_login, Proc.new {|c| c.assigns["ran_proc_filter1"] = true }, :except => :show_without_filter) { |c| c.assigns["ran_proc_filter2"] = true}
- end
-
- class ConditionalOptionsFilter < ConditionalFilterController
- before_filter :ensure_login, :if => Proc.new { |c| true }
- before_filter :clean_up_tmp, :if => Proc.new { |c| false }
- end
-
- class EmptyFilterChainController < TestController
- self.filter_chain.clear
- def show
- @action_executed = true
- render :text => "yawp!"
- end
- end
-
- class PrependingController < TestController
- prepend_before_filter :wonderful_life
- # skip_before_filter :fire_flash
-
- private
- def wonderful_life
- @ran_filter ||= []
- @ran_filter << "wonderful_life"
- end
- end
-
- class SkippingAndLimitedController < TestController
- skip_before_filter :ensure_login
- before_filter :ensure_login, :only => :index
-
- def index
- render :text => 'ok'
- end
-
- def public
- end
- end
-
- class SkippingAndReorderingController < TestController
- skip_before_filter :ensure_login
- before_filter :find_record
- before_filter :ensure_login
-
- private
- def find_record
- @ran_filter ||= []
- @ran_filter << "find_record"
- end
- end
-
- class ConditionalSkippingController < TestController
- skip_before_filter :ensure_login, :only => [ :login ]
- skip_after_filter :clean_up, :only => [ :login ]
-
- before_filter :find_user, :only => [ :change_password ]
-
- def login
- render :inline => "ran action"
- end
-
- def change_password
- render :inline => "ran action"
- end
-
- protected
- def find_user
- @ran_filter ||= []
- @ran_filter << "find_user"
- end
- end
-
- class ConditionalParentOfConditionalSkippingController < ConditionalFilterController
- before_filter :conditional_in_parent, :only => [:show, :another_action]
- after_filter :conditional_in_parent, :only => [:show, :another_action]
-
- private
-
- def conditional_in_parent
- @ran_filter ||= []
- @ran_filter << 'conditional_in_parent'
- end
- end
-
- class ChildOfConditionalParentController < ConditionalParentOfConditionalSkippingController
- skip_before_filter :conditional_in_parent, :only => :another_action
- skip_after_filter :conditional_in_parent, :only => :another_action
- end
-
- class AnotherChildOfConditionalParentController < ConditionalParentOfConditionalSkippingController
- skip_before_filter :conditional_in_parent, :only => :show
- end
-
- class ProcController < PrependingController
- before_filter(proc { |c| c.assigns["ran_proc_filter"] = true })
- end
-
- class ImplicitProcController < PrependingController
- before_filter { |c| c.assigns["ran_proc_filter"] = true }
- end
-
- class AuditFilter
- def self.filter(controller)
- controller.assigns["was_audited"] = true
- end
- end
-
- class AroundFilter
- def before(controller)
- @execution_log = "before"
- controller.class.execution_log << " before aroundfilter " if controller.respond_to? :execution_log
- controller.assigns["before_ran"] = true
- end
-
- def after(controller)
- controller.assigns["execution_log"] = @execution_log + " and after"
- controller.assigns["after_ran"] = true
- controller.class.execution_log << " after aroundfilter " if controller.respond_to? :execution_log
- end
- end
-
- class AppendedAroundFilter
- def before(controller)
- controller.class.execution_log << " before appended aroundfilter "
- end
-
- def after(controller)
- controller.class.execution_log << " after appended aroundfilter "
- end
- end
-
- class AuditController < ActionController::Base
- before_filter(AuditFilter)
-
- def show
- render :text => "hello"
- end
- end
-
- class AroundFilterController < PrependingController
- around_filter AroundFilter.new
- end
-
- class BeforeAfterClassFilterController < PrependingController
- begin
- filter = AroundFilter.new
- before_filter filter
- after_filter filter
- end
- end
-
- class MixedFilterController < PrependingController
- cattr_accessor :execution_log
-
- def initialize
- @@execution_log = ""
- end
-
- before_filter { |c| c.class.execution_log << " before procfilter " }
- prepend_around_filter AroundFilter.new
-
- after_filter { |c| c.class.execution_log << " after procfilter " }
- append_around_filter AppendedAroundFilter.new
- end
-
- class MixedSpecializationController < ActionController::Base
- class OutOfOrder < StandardError; end
-
- before_filter :first
- before_filter :second, :only => :foo
-
- def foo
- render :text => 'foo'
- end
-
- def bar
- render :text => 'bar'
- end
-
- protected
- def first
- @first = true
- end
-
- def second
- raise OutOfOrder unless @first
- end
- end
-
- class DynamicDispatchController < ActionController::Base
- before_filter :choose
-
- %w(foo bar baz).each do |action|
- define_method(action) { render :text => action }
- end
-
- private
- def choose
- self.action_name = params[:choose]
- end
- end
-
- class PrependingBeforeAndAfterController < ActionController::Base
- prepend_before_filter :before_all
- prepend_after_filter :after_all
- before_filter :between_before_all_and_after_all
-
- def before_all
- @ran_filter ||= []
- @ran_filter << 'before_all'
- end
-
- def after_all
- @ran_filter ||= []
- @ran_filter << 'after_all'
- end
-
- def between_before_all_and_after_all
- @ran_filter ||= []
- @ran_filter << 'between_before_all_and_after_all'
- end
- def show
- render :text => 'hello'
- end
- end
-
- class ErrorToRescue < Exception; end
-
- class RescuingAroundFilterWithBlock
- def filter(controller)
- begin
- yield
- rescue ErrorToRescue => ex
- controller.send! :render, :text => "I rescued this: #{ex.inspect}"
- end
- end
- end
-
- class RescuedController < ActionController::Base
- around_filter RescuingAroundFilterWithBlock.new
-
- def show
- raise ErrorToRescue.new("Something made the bad noise.")
- end
-
- private
- def rescue_action(exception)
- raise exception
- end
- end
-
- class NonYieldingAroundFilterController < ActionController::Base
-
- before_filter :filter_one
- around_filter :non_yielding_filter
- before_filter :filter_two
- after_filter :filter_three
-
- def index
- render :inline => "index"
- end
-
- #make sure the controller complains
- def rescue_action(e); raise e; end
-
- private
-
- def filter_one
- @filters ||= []
- @filters << "filter_one"
- end
-
- def filter_two
- @filters << "filter_two"
- end
-
- def non_yielding_filter
- @filters << "zomg it didn't yield"
- @filter_return_value
- end
-
- def filter_three
- @filters << "filter_three"
- end
-
- end
-
- def test_non_yielding_around_filters_not_returning_false_do_not_raise
- controller = NonYieldingAroundFilterController.new
- controller.instance_variable_set "@filter_return_value", true
- assert_nothing_raised do
- test_process(controller, "index")
- end
- end
-
- def test_non_yielding_around_filters_returning_false_do_not_raise
- controller = NonYieldingAroundFilterController.new
- controller.instance_variable_set "@filter_return_value", false
- assert_nothing_raised do
- test_process(controller, "index")
- end
- end
-
- def test_after_filters_are_not_run_if_around_filter_returns_false
- controller = NonYieldingAroundFilterController.new
- controller.instance_variable_set "@filter_return_value", false
- test_process(controller, "index")
- assert_equal ["filter_one", "zomg it didn't yield"], controller.assigns['filters']
- end
-
- def test_after_filters_are_not_run_if_around_filter_does_not_yield
- controller = NonYieldingAroundFilterController.new
- controller.instance_variable_set "@filter_return_value", true
- test_process(controller, "index")
- assert_equal ["filter_one", "zomg it didn't yield"], controller.assigns['filters']
- end
-
- def test_empty_filter_chain
- assert_equal 0, EmptyFilterChainController.filter_chain.size
- assert test_process(EmptyFilterChainController).template.assigns['action_executed']
- end
-
- def test_added_filter_to_inheritance_graph
- assert_equal [ :ensure_login ], TestController.before_filters
- end
-
- def test_base_class_in_isolation
- assert_equal [ ], ActionController::Base.before_filters
- end
-
- def test_prepending_filter
- assert_equal [ :wonderful_life, :ensure_login ], PrependingController.before_filters
- end
-
- def test_running_filters
- assert_equal %w( wonderful_life ensure_login ), test_process(PrependingController).template.assigns["ran_filter"]
- end
-
- def test_running_filters_with_proc
- assert test_process(ProcController).template.assigns["ran_proc_filter"]
- end
-
- def test_running_filters_with_implicit_proc
- assert test_process(ImplicitProcController).template.assigns["ran_proc_filter"]
- end
-
- def test_running_filters_with_class
- assert test_process(AuditController).template.assigns["was_audited"]
- end
-
- def test_running_anomolous_yet_valid_condition_filters
- response = test_process(AnomolousYetValidConditionController)
- assert_equal %w( ensure_login ), response.template.assigns["ran_filter"]
- assert response.template.assigns["ran_class_filter"]
- assert response.template.assigns["ran_proc_filter1"]
- assert response.template.assigns["ran_proc_filter2"]
-
- response = test_process(AnomolousYetValidConditionController, "show_without_filter")
- assert_equal nil, response.template.assigns["ran_filter"]
- assert !response.template.assigns["ran_class_filter"]
- assert !response.template.assigns["ran_proc_filter1"]
- assert !response.template.assigns["ran_proc_filter2"]
- end
-
- def test_running_conditional_options
- response = test_process(ConditionalOptionsFilter)
- assert_equal %w( ensure_login ), response.template.assigns["ran_filter"]
- end
-
- def test_running_collection_condition_filters
- assert_equal %w( ensure_login ), test_process(ConditionalCollectionFilterController).template.assigns["ran_filter"]
- assert_equal nil, test_process(ConditionalCollectionFilterController, "show_without_filter").template.assigns["ran_filter"]
- assert_equal nil, test_process(ConditionalCollectionFilterController, "another_action").template.assigns["ran_filter"]
- end
-
- def test_running_only_condition_filters
- assert_equal %w( ensure_login ), test_process(OnlyConditionSymController).template.assigns["ran_filter"]
- assert_equal nil, test_process(OnlyConditionSymController, "show_without_filter").template.assigns["ran_filter"]
-
- assert test_process(OnlyConditionProcController).template.assigns["ran_proc_filter"]
- assert !test_process(OnlyConditionProcController, "show_without_filter").template.assigns["ran_proc_filter"]
-
- assert test_process(OnlyConditionClassController).template.assigns["ran_class_filter"]
- assert !test_process(OnlyConditionClassController, "show_without_filter").template.assigns["ran_class_filter"]
- end
-
- def test_running_except_condition_filters
- assert_equal %w( ensure_login ), test_process(ExceptConditionSymController).template.assigns["ran_filter"]
- assert_equal nil, test_process(ExceptConditionSymController, "show_without_filter").template.assigns["ran_filter"]
-
- assert test_process(ExceptConditionProcController).template.assigns["ran_proc_filter"]
- assert !test_process(ExceptConditionProcController, "show_without_filter").template.assigns["ran_proc_filter"]
-
- assert test_process(ExceptConditionClassController).template.assigns["ran_class_filter"]
- assert !test_process(ExceptConditionClassController, "show_without_filter").template.assigns["ran_class_filter"]
- end
-
- def test_running_before_and_after_condition_filters
- assert_equal %w( ensure_login clean_up_tmp), test_process(BeforeAndAfterConditionController).template.assigns["ran_filter"]
- assert_equal nil, test_process(BeforeAndAfterConditionController, "show_without_filter").template.assigns["ran_filter"]
- end
-
- def test_around_filter
- controller = test_process(AroundFilterController)
- assert controller.template.assigns["before_ran"]
- assert controller.template.assigns["after_ran"]
- end
-
- def test_before_after_class_filter
- controller = test_process(BeforeAfterClassFilterController)
- assert controller.template.assigns["before_ran"]
- assert controller.template.assigns["after_ran"]
- end
-
- def test_having_properties_in_around_filter
- controller = test_process(AroundFilterController)
- assert_equal "before and after", controller.template.assigns["execution_log"]
- end
-
- def test_prepending_and_appending_around_filter
- controller = test_process(MixedFilterController)
- assert_equal " before aroundfilter before procfilter before appended aroundfilter " +
- " after appended aroundfilter after aroundfilter after procfilter ",
- MixedFilterController.execution_log
- end
-
- def test_rendering_breaks_filtering_chain
- response = test_process(RenderingController)
- assert_equal "something else", response.body
- assert !response.template.assigns["ran_action"]
- end
-
- def test_filters_with_mixed_specialization_run_in_order
- assert_nothing_raised do
- response = test_process(MixedSpecializationController, 'bar')
- assert_equal 'bar', response.body
- end
-
- assert_nothing_raised do
- response = test_process(MixedSpecializationController, 'foo')
- assert_equal 'foo', response.body
- end
- end
-
- def test_dynamic_dispatch
- %w(foo bar baz).each do |action|
- request = ActionController::TestRequest.new
- request.query_parameters[:choose] = action
- response = DynamicDispatchController.process(request, ActionController::TestResponse.new)
- assert_equal action, response.body
- end
- end
-
- def test_running_prepended_before_and_after_filter
- assert_equal 3, PrependingBeforeAndAfterController.filter_chain.length
- response = test_process(PrependingBeforeAndAfterController)
- assert_equal %w( before_all between_before_all_and_after_all after_all ), response.template.assigns["ran_filter"]
- end
-
- def test_skipping_and_limiting_controller
- assert_equal %w( ensure_login ), test_process(SkippingAndLimitedController, "index").template.assigns["ran_filter"]
- assert_nil test_process(SkippingAndLimitedController, "public").template.assigns["ran_filter"]
- end
-
- def test_skipping_and_reordering_controller
- assert_equal %w( find_record ensure_login ), test_process(SkippingAndReorderingController, "index").template.assigns["ran_filter"]
- end
-
- def test_conditional_skipping_of_filters
- assert_nil test_process(ConditionalSkippingController, "login").template.assigns["ran_filter"]
- assert_equal %w( ensure_login find_user ), test_process(ConditionalSkippingController, "change_password").template.assigns["ran_filter"]
-
- assert_nil test_process(ConditionalSkippingController, "login").template.controller.instance_variable_get("@ran_after_filter")
- assert_equal %w( clean_up ), test_process(ConditionalSkippingController, "change_password").template.controller.instance_variable_get("@ran_after_filter")
- end
-
- def test_conditional_skipping_of_filters_when_parent_filter_is_also_conditional
- assert_equal %w( conditional_in_parent conditional_in_parent ), test_process(ChildOfConditionalParentController).template.assigns['ran_filter']
- assert_nil test_process(ChildOfConditionalParentController, 'another_action').template.assigns['ran_filter']
- end
-
- def test_condition_skipping_of_filters_when_siblings_also_have_conditions
- assert_equal %w( conditional_in_parent conditional_in_parent ), test_process(ChildOfConditionalParentController).template.assigns['ran_filter'], "1"
- assert_equal nil, test_process(AnotherChildOfConditionalParentController).template.assigns['ran_filter']
- assert_equal %w( conditional_in_parent conditional_in_parent ), test_process(ChildOfConditionalParentController).template.assigns['ran_filter']
- end
-
- def test_changing_the_requirements
- assert_equal nil, test_process(ChangingTheRequirementsController, "go_wild").template.assigns['ran_filter']
- end
-
- def test_a_rescuing_around_filter
- response = nil
- assert_nothing_raised do
- response = test_process(RescuedController)
- end
-
- assert response.success?
- assert_equal("I rescued this: #", response.body)
- end
-
- private
- def test_process(controller, action = "show")
- request = ActionController::TestRequest.new
- request.action = action
- controller.process(request, ActionController::TestResponse.new)
- end
-end
-
-
-
-class PostsController < ActionController::Base
- def rescue_action(e); raise e; end
-
- module AroundExceptions
- class Error < StandardError ; end
- class Before < Error ; end
- class After < Error ; end
- end
- include AroundExceptions
-
- class DefaultFilter
- include AroundExceptions
- end
-
- module_eval %w(raises_before raises_after raises_both no_raise no_filter).map { |action| "def #{action}; default_action end" }.join("\n")
-
- private
- def default_action
- render :inline => "#{action_name} called"
- end
-end
-
-class ControllerWithSymbolAsFilter < PostsController
- around_filter :raise_before, :only => :raises_before
- around_filter :raise_after, :only => :raises_after
- around_filter :without_exception, :only => :no_raise
-
- private
- def raise_before
- raise Before
- yield
- end
-
- def raise_after
- yield
- raise After
- end
-
- def without_exception
- # Do stuff...
- 1 + 1
-
- yield
-
- # Do stuff...
- 1 + 1
- end
-end
-
-class ControllerWithFilterClass < PostsController
- class YieldingFilter < DefaultFilter
- def self.filter(controller)
- yield
- raise After
- end
- end
-
- around_filter YieldingFilter, :only => :raises_after
-end
-
-class ControllerWithFilterInstance < PostsController
- class YieldingFilter < DefaultFilter
- def filter(controller)
- yield
- raise After
- end
- end
-
- around_filter YieldingFilter.new, :only => :raises_after
-end
-
-class ControllerWithFilterMethod < PostsController
- class YieldingFilter < DefaultFilter
- def filter(controller)
- yield
- raise After
- end
- end
-
- around_filter YieldingFilter.new.method(:filter), :only => :raises_after
-end
-
-class ControllerWithProcFilter < PostsController
- around_filter(:only => :no_raise) do |c,b|
- c.assigns['before'] = true
- b.call
- c.assigns['after'] = true
- end
-end
-
-class ControllerWithNestedFilters < ControllerWithSymbolAsFilter
- around_filter :raise_before, :raise_after, :without_exception, :only => :raises_both
-end
-
-class ControllerWithAllTypesOfFilters < PostsController
- before_filter :before
- around_filter :around
- after_filter :after
- around_filter :around_again
-
- private
- def before
- @ran_filter ||= []
- @ran_filter << 'before'
- end
-
- def around
- @ran_filter << 'around (before yield)'
- yield
- @ran_filter << 'around (after yield)'
- end
-
- def after
- @ran_filter << 'after'
- end
-
- def around_again
- @ran_filter << 'around_again (before yield)'
- yield
- @ran_filter << 'around_again (after yield)'
- end
-end
-
-class ControllerWithTwoLessFilters < ControllerWithAllTypesOfFilters
- skip_filter :around_again
- skip_filter :after
-end
-
-class YieldingAroundFiltersTest < Test::Unit::TestCase
- include PostsController::AroundExceptions
-
- def test_filters_registering
- assert_equal 1, ControllerWithFilterMethod.filter_chain.size
- assert_equal 1, ControllerWithFilterClass.filter_chain.size
- assert_equal 1, ControllerWithFilterInstance.filter_chain.size
- assert_equal 3, ControllerWithSymbolAsFilter.filter_chain.size
- assert_equal 6, ControllerWithNestedFilters.filter_chain.size
- assert_equal 4, ControllerWithAllTypesOfFilters.filter_chain.size
- end
-
- def test_base
- controller = PostsController
- assert_nothing_raised { test_process(controller,'no_raise') }
- assert_nothing_raised { test_process(controller,'raises_before') }
- assert_nothing_raised { test_process(controller,'raises_after') }
- assert_nothing_raised { test_process(controller,'no_filter') }
- end
-
- def test_with_symbol
- controller = ControllerWithSymbolAsFilter
- assert_nothing_raised { test_process(controller,'no_raise') }
- assert_raise(Before) { test_process(controller,'raises_before') }
- assert_raise(After) { test_process(controller,'raises_after') }
- assert_nothing_raised { test_process(controller,'no_raise') }
- end
-
- def test_with_class
- controller = ControllerWithFilterClass
- assert_nothing_raised { test_process(controller,'no_raise') }
- assert_raise(After) { test_process(controller,'raises_after') }
- end
-
- def test_with_instance
- controller = ControllerWithFilterInstance
- assert_nothing_raised { test_process(controller,'no_raise') }
- assert_raise(After) { test_process(controller,'raises_after') }
- end
-
- def test_with_method
- controller = ControllerWithFilterMethod
- assert_nothing_raised { test_process(controller,'no_raise') }
- assert_raise(After) { test_process(controller,'raises_after') }
- end
-
- def test_with_proc
- controller = test_process(ControllerWithProcFilter,'no_raise')
- assert controller.template.assigns['before']
- assert controller.template.assigns['after']
- end
-
- def test_nested_filters
- controller = ControllerWithNestedFilters
- assert_nothing_raised do
- begin
- test_process(controller,'raises_both')
- rescue Before, After
- end
- end
- assert_raise Before do
- begin
- test_process(controller,'raises_both')
- rescue After
- end
- end
- end
-
- def test_filter_order_with_all_filter_types
- controller = test_process(ControllerWithAllTypesOfFilters,'no_raise')
- assert_equal 'before around (before yield) around_again (before yield) around_again (after yield) around (after yield) after',controller.template.assigns['ran_filter'].join(' ')
- end
-
- def test_filter_order_with_skip_filter_method
- controller = test_process(ControllerWithTwoLessFilters,'no_raise')
- assert_equal 'before around (before yield) around (after yield)',controller.template.assigns['ran_filter'].join(' ')
- end
-
- def test_first_filter_in_multiple_before_filter_chain_halts
- controller = ::FilterTest::TestMultipleFiltersController.new
- response = test_process(controller, 'fail_1')
- assert_equal ' ', response.body
- assert_equal 1, controller.instance_variable_get(:@try)
- assert controller.instance_variable_get(:@before_filter_chain_aborted)
- end
-
- def test_second_filter_in_multiple_before_filter_chain_halts
- controller = ::FilterTest::TestMultipleFiltersController.new
- response = test_process(controller, 'fail_2')
- assert_equal ' ', response.body
- assert_equal 2, controller.instance_variable_get(:@try)
- assert controller.instance_variable_get(:@before_filter_chain_aborted)
- end
-
- def test_last_filter_in_multiple_before_filter_chain_halts
- controller = ::FilterTest::TestMultipleFiltersController.new
- response = test_process(controller, 'fail_3')
- assert_equal ' ', response.body
- assert_equal 3, controller.instance_variable_get(:@try)
- assert controller.instance_variable_get(:@before_filter_chain_aborted)
- end
-
- protected
- def test_process(controller, action = "show")
- request = ActionController::TestRequest.new
- request.action = action
- controller.process(request, ActionController::TestResponse.new)
- end
-end
diff --git a/vendor/rails/actionpack/test/controller/flash_test.rb b/vendor/rails/actionpack/test/controller/flash_test.rb
deleted file mode 100644
index e562531b..00000000
--- a/vendor/rails/actionpack/test/controller/flash_test.rb
+++ /dev/null
@@ -1,146 +0,0 @@
-require 'abstract_unit'
-
-class FlashTest < Test::Unit::TestCase
- class TestController < ActionController::Base
- def set_flash
- flash["that"] = "hello"
- render :inline => "hello"
- end
-
- def set_flash_now
- flash.now["that"] = "hello"
- flash.now["foo"] ||= "bar"
- flash.now["foo"] ||= "err"
- @flashy = flash.now["that"]
- @flash_copy = {}.update flash
- render :inline => "hello"
- end
-
- def attempt_to_use_flash_now
- @flash_copy = {}.update flash
- @flashy = flash["that"]
- render :inline => "hello"
- end
-
- def use_flash
- @flash_copy = {}.update flash
- @flashy = flash["that"]
- render :inline => "hello"
- end
-
- def use_flash_and_keep_it
- @flash_copy = {}.update flash
- @flashy = flash["that"]
- flash.keep
- render :inline => "hello"
- end
-
- def use_flash_and_update_it
- flash.update("this" => "hello again")
- @flash_copy = {}.update flash
- render :inline => "hello"
- end
-
- def use_flash_after_reset_session
- flash["that"] = "hello"
- @flashy_that = flash["that"]
- reset_session
- @flashy_that_reset = flash["that"]
- flash["this"] = "good-bye"
- @flashy_this = flash["this"]
- render :inline => "hello"
- end
-
- def rescue_action(e)
- raise unless ActionView::MissingTemplate === e
- end
-
- # methods for test_sweep_after_halted_filter_chain
- before_filter :halt_and_redir, :only => "filter_halting_action"
-
- def std_action
- @flash_copy = {}.update(flash)
- end
-
- def filter_halting_action
- @flash_copy = {}.update(flash)
- end
-
- def halt_and_redir
- flash["foo"] = "bar"
- redirect_to :action => "std_action"
- @flash_copy = {}.update(flash)
- end
- end
-
- def setup
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- @controller = TestController.new
- end
-
- def test_flash
- get :set_flash
-
- get :use_flash
- assert_equal "hello", @response.template.assigns["flash_copy"]["that"]
- assert_equal "hello", @response.template.assigns["flashy"]
-
- get :use_flash
- assert_nil @response.template.assigns["flash_copy"]["that"], "On second flash"
- end
-
- def test_keep_flash
- get :set_flash
-
- get :use_flash_and_keep_it
- assert_equal "hello", @response.template.assigns["flash_copy"]["that"]
- assert_equal "hello", @response.template.assigns["flashy"]
-
- get :use_flash
- assert_equal "hello", @response.template.assigns["flash_copy"]["that"], "On second flash"
-
- get :use_flash
- assert_nil @response.template.assigns["flash_copy"]["that"], "On third flash"
- end
-
- def test_flash_now
- get :set_flash_now
- assert_equal "hello", @response.template.assigns["flash_copy"]["that"]
- assert_equal "bar" , @response.template.assigns["flash_copy"]["foo"]
- assert_equal "hello", @response.template.assigns["flashy"]
-
- get :attempt_to_use_flash_now
- assert_nil @response.template.assigns["flash_copy"]["that"]
- assert_nil @response.template.assigns["flash_copy"]["foo"]
- assert_nil @response.template.assigns["flashy"]
- end
-
- def test_update_flash
- get :set_flash
- get :use_flash_and_update_it
- assert_equal "hello", @response.template.assigns["flash_copy"]["that"]
- assert_equal "hello again", @response.template.assigns["flash_copy"]["this"]
- get :use_flash
- assert_nil @response.template.assigns["flash_copy"]["that"], "On second flash"
- assert_equal "hello again", @response.template.assigns["flash_copy"]["this"], "On second flash"
- end
-
- def test_flash_after_reset_session
- get :use_flash_after_reset_session
- assert_equal "hello", @response.template.assigns["flashy_that"]
- assert_equal "good-bye", @response.template.assigns["flashy_this"]
- assert_nil @response.template.assigns["flashy_that_reset"]
- end
-
- def test_sweep_after_halted_filter_chain
- get :std_action
- assert_nil @response.template.assigns["flash_copy"]["foo"]
- get :filter_halting_action
- assert_equal "bar", @response.template.assigns["flash_copy"]["foo"]
- get :std_action # follow redirection
- assert_equal "bar", @response.template.assigns["flash_copy"]["foo"]
- get :std_action
- assert_nil @response.template.assigns["flash_copy"]["foo"]
- end
-end
diff --git a/vendor/rails/actionpack/test/controller/header_test.rb b/vendor/rails/actionpack/test/controller/header_test.rb
deleted file mode 100644
index 33c14a18..00000000
--- a/vendor/rails/actionpack/test/controller/header_test.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'abstract_unit'
-
-class HeaderTest < Test::Unit::TestCase
- def setup
- @headers = ActionController::Http::Headers.new("HTTP_CONTENT_TYPE"=>"text/plain")
- end
-
- def test_content_type_works
- assert_equal "text/plain", @headers["Content-Type"]
- assert_equal "text/plain", @headers["content-type"]
- assert_equal "text/plain", @headers["CONTENT_TYPE"]
- assert_equal "text/plain", @headers["HTTP_CONTENT_TYPE"]
- end
-end
diff --git a/vendor/rails/actionpack/test/controller/helper_test.rb b/vendor/rails/actionpack/test/controller/helper_test.rb
deleted file mode 100644
index 83e3b085..00000000
--- a/vendor/rails/actionpack/test/controller/helper_test.rb
+++ /dev/null
@@ -1,210 +0,0 @@
-require 'abstract_unit'
-
-ActionController::Helpers::HELPERS_DIR.replace File.dirname(__FILE__) + '/../fixtures/helpers'
-
-class TestController < ActionController::Base
- attr_accessor :delegate_attr
- def delegate_method() end
- def rescue_action(e) raise end
-end
-
-module Fun
- class GamesController < ActionController::Base
- def render_hello_world
- render :inline => "hello: <%= stratego %>"
- end
-
- def rescue_action(e) raise end
- end
-
- class PdfController < ActionController::Base
- def test
- render :inline => "test: <%= foobar %>"
- end
-
- def rescue_action(e) raise end
- end
-end
-
-class ApplicationController < ActionController::Base
- helper :all
-end
-
-module LocalAbcHelper
- def a() end
- def b() end
- def c() end
-end
-
-class HelperTest < Test::Unit::TestCase
- def setup
- # Increment symbol counter.
- @symbol = (@@counter ||= 'A0').succ!.dup
-
- # Generate new controller class.
- controller_class_name = "Helper#{@symbol}Controller"
- eval("class #{controller_class_name} < TestController; end")
- @controller_class = self.class.const_get(controller_class_name)
-
- # Set default test helper.
- self.test_helper = LocalAbcHelper
- end
-
- def test_deprecated_helper
- assert_equal expected_helper_methods, missing_methods
- assert_nothing_raised { @controller_class.helper TestHelper }
- assert_equal [], missing_methods
- end
-
- def test_declare_helper
- require 'abc_helper'
- self.test_helper = AbcHelper
- assert_equal expected_helper_methods, missing_methods
- assert_nothing_raised { @controller_class.helper :abc }
- assert_equal [], missing_methods
- end
-
- def test_declare_missing_helper
- assert_equal expected_helper_methods, missing_methods
- assert_raise(MissingSourceFile) { @controller_class.helper :missing }
- end
-
- def test_declare_missing_file_from_helper
- require 'broken_helper'
- rescue LoadError => e
- assert_nil(/\bbroken_helper\b/.match(e.to_s)[1])
- end
-
- def test_helper_block
- assert_nothing_raised {
- @controller_class.helper { def block_helper_method; end }
- }
- assert master_helper_methods.include?('block_helper_method')
- end
-
- def test_helper_block_include
- assert_equal expected_helper_methods, missing_methods
- assert_nothing_raised {
- @controller_class.helper { include HelperTest::TestHelper }
- }
- assert [], missing_methods
- end
-
- def test_helper_method
- assert_nothing_raised { @controller_class.helper_method :delegate_method }
- assert master_helper_methods.include?('delegate_method')
- end
-
- def test_helper_attr
- assert_nothing_raised { @controller_class.helper_attr :delegate_attr }
- assert master_helper_methods.include?('delegate_attr')
- assert master_helper_methods.include?('delegate_attr=')
- end
-
- def test_helper_for_nested_controller
- request = ActionController::TestRequest.new
- response = ActionController::TestResponse.new
- request.action = 'render_hello_world'
-
- assert_equal 'hello: Iz guuut!', Fun::GamesController.process(request, response).body
- end
-
- def test_helper_for_acronym_controller
- request = ActionController::TestRequest.new
- response = ActionController::TestResponse.new
- request.action = 'test'
-
- assert_equal 'test: baz', Fun::PdfController.process(request, response).body
- end
-
- def test_all_helpers
- methods = ApplicationController.master_helper_module.instance_methods.map(&:to_s)
-
- # abc_helper.rb
- assert methods.include?('bare_a')
-
- # fun/games_helper.rb
- assert methods.include?('stratego')
-
- # fun/pdf_helper.rb
- assert methods.include?('foobar')
- end
-
- def test_helper_proxy
- methods = ApplicationController.helpers.methods.map(&:to_s)
-
- # ActionView
- assert methods.include?('pluralize')
-
- # abc_helper.rb
- assert methods.include?('bare_a')
-
- # fun/games_helper.rb
- assert methods.include?('stratego')
-
- # fun/pdf_helper.rb
- assert methods.include?('foobar')
- end
-
- private
- def expected_helper_methods
- TestHelper.instance_methods.map(&:to_s)
- end
-
- def master_helper_methods
- @controller_class.master_helper_module.instance_methods.map(&:to_s)
- end
-
- def missing_methods
- expected_helper_methods - master_helper_methods
- end
-
- def test_helper=(helper_module)
- silence_warnings { self.class.const_set('TestHelper', helper_module) }
- end
-end
-
-
-class IsolatedHelpersTest < Test::Unit::TestCase
- class A < ActionController::Base
- def index
- render :inline => '<%= shout %>'
- end
-
- def rescue_action(e) raise end
- end
-
- class B < A
- helper { def shout; 'B' end }
-
- def index
- render :inline => '<%= shout %>'
- end
- end
-
- class C < A
- helper { def shout; 'C' end }
-
- def index
- render :inline => '<%= shout %>'
- end
- end
-
- def setup
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- @request.action = 'index'
- end
-
- def test_helper_in_a
- assert_raise(NameError) { A.process(@request, @response) }
- end
-
- def test_helper_in_b
- assert_equal 'B', B.process(@request, @response).body
- end
-
- def test_helper_in_c
- assert_equal 'C', C.process(@request, @response).body
- end
-end
diff --git a/vendor/rails/actionpack/test/controller/html-scanner/document_test.rb b/vendor/rails/actionpack/test/controller/html-scanner/document_test.rb
deleted file mode 100644
index 0519533d..00000000
--- a/vendor/rails/actionpack/test/controller/html-scanner/document_test.rb
+++ /dev/null
@@ -1,123 +0,0 @@
-require 'abstract_unit'
-
-class DocumentTest < Test::Unit::TestCase
- def test_handle_doctype
- doc = nil
- assert_nothing_raised do
- doc = HTML::Document.new <<-HTML.strip
-
-
-
- HTML
- end
- assert_equal 3, doc.root.children.length
- assert_equal %{}, doc.root.children[0].content
- assert_match %r{\s+}m, doc.root.children[1].content
- assert_equal "html", doc.root.children[2].name
- end
-
- def test_find_img
- doc = HTML::Document.new <<-HTML.strip
-
-
-
"))
- assert_equal("Weirdos", sanitizer.sanitize("Wei<a onclick='alert(document.cookie);'/>rdos"))
- assert_equal("This is a test.", sanitizer.sanitize("This is a test."))
- assert_equal(
- %{This is a test.\n\n\nIt no longer contains any HTML.\n}, sanitizer.sanitize(
- %{This is a test.\n\n\n\n
It no longer contains any HTML.
\n}))
- assert_equal "This has a here.", sanitizer.sanitize("This has a here.")
- [nil, '', ' '].each { |blank| assert_equal blank, sanitizer.sanitize(blank) }
- end
-
- def test_strip_links
- sanitizer = HTML::LinkSanitizer.new
- assert_equal "Dont touch me", sanitizer.sanitize("Dont touch me")
- assert_equal "on my mind\nall day long", sanitizer.sanitize("on my mind\nall day long")
- assert_equal "0wn3d", sanitizer.sanitize("0wn3d")
- assert_equal "Magic", sanitizer.sanitize("Magic")
- assert_equal "FrrFox", sanitizer.sanitize("FrrFox")
- assert_equal "My mind\nall day long", sanitizer.sanitize("My mind\nall day long")
- assert_equal "all day long", sanitizer.sanitize("<a href='hello'>all day long</a>")
-
- assert_equal "", ''
- end
-
- def test_sanitize_plaintext
- raw = "foo"
- assert_sanitized raw, "foo"
- end
-
- def test_sanitize_script
- assert_sanitized "a b cd e f", "a b cd e f"
- end
-
- # fucked
- def test_sanitize_js_handlers
- raw = %{onthis="do that" hello}
- assert_sanitized raw, %{onthis="do that" hello}
- end
-
- def test_sanitize_javascript_href
- raw = %{href="javascript:bang" foo, bar}
- assert_sanitized raw, %{href="javascript:bang" foo, bar}
- end
-
- def test_sanitize_image_src
- raw = %{src="javascript:bang" foo, bar}
- assert_sanitized raw, %{src="javascript:bang" foo, bar}
- end
-
- HTML::WhiteListSanitizer.allowed_tags.each do |tag_name|
- define_method "test_should_allow_#{tag_name}_tag" do
- assert_sanitized "start <#{tag_name} title=\"1\" onclick=\"foo\">foo bar baz#{tag_name}> end", %(start <#{tag_name} title="1">foo bar baz#{tag_name}> end)
- end
- end
-
- def test_should_allow_anchors
- assert_sanitized %(), %()
- end
-
- # RFC 3986, sec 4.2
- def test_allow_colons_in_path_component
- assert_sanitized("foo")
- end
-
- %w(src width height alt).each do |img_attr|
- define_method "test_should_allow_image_#{img_attr}_attribute" do
- assert_sanitized %(), %()
- end
- end
-
- def test_should_handle_non_html
- assert_sanitized 'abc'
- end
-
- def test_should_handle_blank_text
- assert_sanitized nil
- assert_sanitized ''
- end
-
- def test_should_allow_custom_tags
- text = "foo"
- sanitizer = HTML::WhiteListSanitizer.new
- assert_equal(text, sanitizer.sanitize(text, :tags => %w(u)))
- end
-
- def test_should_allow_only_custom_tags
- text = "foo with bar"
- sanitizer = HTML::WhiteListSanitizer.new
- assert_equal("foo with bar", sanitizer.sanitize(text, :tags => %w(u)))
- end
-
- def test_should_allow_custom_tags_with_attributes
- text = %(
foo
)
- sanitizer = HTML::WhiteListSanitizer.new
- assert_equal(text, sanitizer.sanitize(text))
- end
-
- def test_should_allow_custom_tags_with_custom_attributes
- text = %(
Lorem ipsum
)
- sanitizer = HTML::WhiteListSanitizer.new
- assert_equal(text, sanitizer.sanitize(text, :attributes => ['foo']))
- end
-
- [%w(img src), %w(a href)].each do |(tag, attr)|
- define_method "test_should_strip_#{attr}_attribute_in_#{tag}_with_bad_protocols" do
- assert_sanitized %(<#{tag} #{attr}="javascript:bang" title="1">boo#{tag}>), %(<#{tag} title="1">boo#{tag}>)
- end
- end
-
- def test_should_flag_bad_protocols
- sanitizer = HTML::WhiteListSanitizer.new
- %w(about chrome data disk hcp help javascript livescript lynxcgi lynxexec ms-help ms-its mhtml mocha opera res resource shell vbscript view-source vnd.ms.radio wysiwyg).each do |proto|
- assert sanitizer.send(:contains_bad_protocols?, 'src', "#{proto}://bad")
- end
- end
-
- def test_should_accept_good_protocols
- sanitizer = HTML::WhiteListSanitizer.new
- HTML::WhiteListSanitizer.allowed_protocols.each do |proto|
- assert !sanitizer.send(:contains_bad_protocols?, 'src', "#{proto}://good")
- end
- end
-
- def test_should_reject_hex_codes_in_protocol
- assert_sanitized %(1), "1"
- assert @sanitizer.send(:contains_bad_protocols?, 'src', "%6A%61%76%61%73%63%72%69%70%74%3A%61%6C%65%72%74%28%22%58%53%53%22%29")
- end
-
- def test_should_block_script_tag
- assert_sanitized %(), ""
- end
-
- [%(),
- %(),
- %(),
- %(">),
- %(),
- %(),
- %(),
- %(),
- %(),
- %(),
- %(),
- %(),
- %(),
- %(),
- %()].each_with_index do |img_hack, i|
- define_method "test_should_not_fall_for_xss_image_hack_#{i+1}" do
- assert_sanitized img_hack, ""
- end
- end
-
- def test_should_sanitize_tag_broken_up_by_null
- assert_sanitized %(alert(\"XSS\")), "alert(\"XSS\")"
- end
-
- def test_should_sanitize_invalid_script_tag
- assert_sanitized %(), ""
- end
-
- def test_should_sanitize_script_tag_with_multiple_open_brackets
- assert_sanitized %(<), "<"
- assert_sanitized %(}
- assert_end
- end
-
- def test_unterminated_comment
- tokenize %{hello \n\n
") { |url| truncate(url, 10) }
- end
-
- def test_cycle_class
- value = Cycle.new("one", 2, "3")
- assert_equal("one", value.to_s)
- assert_equal("2", value.to_s)
- assert_equal("3", value.to_s)
- assert_equal("one", value.to_s)
- value.reset
- assert_equal("one", value.to_s)
- assert_equal("2", value.to_s)
- assert_equal("3", value.to_s)
- end
-
- def test_cycle_class_with_no_arguments
- assert_raise(ArgumentError) { value = Cycle.new() }
- end
-
- def test_cycle
- assert_equal("one", cycle("one", 2, "3"))
- assert_equal("2", cycle("one", 2, "3"))
- assert_equal("3", cycle("one", 2, "3"))
- assert_equal("one", cycle("one", 2, "3"))
- assert_equal("2", cycle("one", 2, "3"))
- assert_equal("3", cycle("one", 2, "3"))
- end
-
- def test_cycle_with_no_arguments
- assert_raise(ArgumentError) { value = cycle() }
- end
-
- def test_cycle_resets_with_new_values
- assert_equal("even", cycle("even", "odd"))
- assert_equal("odd", cycle("even", "odd"))
- assert_equal("even", cycle("even", "odd"))
- assert_equal("1", cycle(1, 2, 3))
- assert_equal("2", cycle(1, 2, 3))
- assert_equal("3", cycle(1, 2, 3))
- assert_equal("1", cycle(1, 2, 3))
- end
-
- def test_named_cycles
- assert_equal("1", cycle(1, 2, 3, :name => "numbers"))
- assert_equal("red", cycle("red", "blue", :name => "colors"))
- assert_equal("2", cycle(1, 2, 3, :name => "numbers"))
- assert_equal("blue", cycle("red", "blue", :name => "colors"))
- assert_equal("3", cycle(1, 2, 3, :name => "numbers"))
- assert_equal("red", cycle("red", "blue", :name => "colors"))
- end
-
- def test_default_named_cycle
- assert_equal("1", cycle(1, 2, 3))
- assert_equal("2", cycle(1, 2, 3, :name => "default"))
- assert_equal("3", cycle(1, 2, 3))
- end
-
- def test_reset_cycle
- assert_equal("1", cycle(1, 2, 3))
- assert_equal("2", cycle(1, 2, 3))
- reset_cycle
- assert_equal("1", cycle(1, 2, 3))
- end
-
- def test_reset_unknown_cycle
- reset_cycle("colors")
- end
-
- def test_recet_named_cycle
- assert_equal("1", cycle(1, 2, 3, :name => "numbers"))
- assert_equal("red", cycle("red", "blue", :name => "colors"))
- reset_cycle("numbers")
- assert_equal("1", cycle(1, 2, 3, :name => "numbers"))
- assert_equal("blue", cycle("red", "blue", :name => "colors"))
- assert_equal("2", cycle(1, 2, 3, :name => "numbers"))
- assert_equal("red", cycle("red", "blue", :name => "colors"))
- end
-
- def test_cycle_no_instance_variable_clashes
- @cycles = %w{Specialized Fuji Giant}
- assert_equal("red", cycle("red", "blue"))
- assert_equal("blue", cycle("red", "blue"))
- assert_equal("red", cycle("red", "blue"))
- assert_equal(%w{Specialized Fuji Giant}, @cycles)
- end
-end
diff --git a/vendor/rails/actionpack/test/template/url_helper_test.rb b/vendor/rails/actionpack/test/template/url_helper_test.rb
deleted file mode 100644
index d45ea08a..00000000
--- a/vendor/rails/actionpack/test/template/url_helper_test.rb
+++ /dev/null
@@ -1,534 +0,0 @@
-require 'abstract_unit'
-
-RequestMock = Struct.new("Request", :request_uri, :protocol, :host_with_port, :env)
-
-class UrlHelperTest < ActionView::TestCase
- tests ActionView::Helpers::UrlHelper
-
- def setup
- @controller = Class.new do
- attr_accessor :url, :request
- def url_for(options)
- url
- end
- end
- @controller = @controller.new
- @controller.url = "http://www.example.com"
- end
-
- def test_url_for_escapes_urls
- @controller.url = "http://www.example.com?a=b&c=d"
- assert_equal "http://www.example.com?a=b&c=d", url_for(:a => 'b', :c => 'd')
- assert_equal "http://www.example.com?a=b&c=d", url_for(:a => 'b', :c => 'd', :escape => true)
- assert_equal "http://www.example.com?a=b&c=d", url_for(:a => 'b', :c => 'd', :escape => false)
- end
-
- def test_url_for_escapes_url_once
- @controller.url = "http://www.example.com?a=b&c=d"
- assert_equal "http://www.example.com?a=b&c=d", url_for("http://www.example.com?a=b&c=d")
- end
-
- # todo: missing test cases
- def test_button_to_with_straight_url
- assert_dom_equal "", button_to("Hello", "http://www.example.com")
- end
-
- def test_button_to_with_query
- assert_dom_equal "", button_to("Hello", "http://www.example.com/q1=v1&q2=v2")
- end
-
- def test_button_to_with_escaped_query
- assert_dom_equal "", button_to("Hello", "http://www.example.com/q1=v1&q2=v2")
- end
-
- def test_button_to_with_query_and_no_name
- assert_dom_equal "", button_to(nil, "http://www.example.com?q1=v1&q2=v2")
- end
-
- def test_button_to_with_javascript_confirm
- assert_dom_equal(
- "",
- button_to("Hello", "http://www.example.com", :confirm => "Are you sure?")
- )
- end
-
- def test_button_to_enabled_disabled
- assert_dom_equal(
- "",
- button_to("Hello", "http://www.example.com", :disabled => false)
- )
- assert_dom_equal(
- "",
- button_to("Hello", "http://www.example.com", :disabled => true)
- )
- end
-
- def test_button_to_with_method_delete
- assert_dom_equal(
- "",
- button_to("Hello", "http://www.example.com", :method => :delete)
- )
- end
-
- def test_button_to_with_method_get
- assert_dom_equal(
- "",
- button_to("Hello", "http://www.example.com", :method => :get)
- )
- end
-
- def test_link_tag_with_straight_url
- assert_dom_equal "Hello", link_to("Hello", "http://www.example.com")
- end
-
- def test_link_tag_without_host_option
- ActionController::Base.class_eval { attr_accessor :url }
- url = {:controller => 'weblog', :action => 'show'}
- @controller = ActionController::Base.new
- @controller.request = ActionController::TestRequest.new
- @controller.url = ActionController::UrlRewriter.new(@controller.request, url)
- assert_dom_equal(%q{Test Link}, link_to('Test Link', url))
- end
-
- def test_link_tag_with_host_option
- ActionController::Base.class_eval { attr_accessor :url }
- url = {:controller => 'weblog', :action => 'show', :host => 'www.example.com'}
- @controller = ActionController::Base.new
- @controller.request = ActionController::TestRequest.new
- @controller.url = ActionController::UrlRewriter.new(@controller.request, url)
- assert_dom_equal(%q{Test Link}, link_to('Test Link', url))
- end
-
- def test_link_tag_with_query
- assert_dom_equal "Hello", link_to("Hello", "http://www.example.com?q1=v1&q2=v2")
- end
-
- def test_link_tag_with_query_and_no_name
- assert_dom_equal "http://www.example.com?q1=v1&q2=v2", link_to(nil, "http://www.example.com?q1=v1&q2=v2")
- end
-
- def test_link_tag_with_back
- @controller.request = RequestMock.new("http://www.example.com/weblog/show", nil, nil, {'HTTP_REFERER' => 'http://www.example.com/referer'})
- assert_dom_equal "go back", link_to('go back', :back)
- end
-
- def test_link_tag_with_back_and_no_referer
- @controller.request = RequestMock.new("http://www.example.com/weblog/show", nil, nil, {})
- assert_dom_equal "go back", link_to('go back', :back)
- end
-
- def test_link_tag_with_back
- @controller.request = RequestMock.new("http://www.example.com/weblog/show", nil, nil, {'HTTP_REFERER' => 'http://www.example.com/referer'})
- assert_dom_equal "go back", link_to('go back', :back)
- end
-
- def test_link_tag_with_back_and_no_referer
- @controller.request = RequestMock.new("http://www.example.com/weblog/show", nil, nil, {})
- assert_dom_equal "go back", link_to('go back', :back)
- end
-
- def test_link_tag_with_img
- assert_dom_equal "", link_to("", "http://www.example.com")
- end
-
- def test_link_with_nil_html_options
- assert_dom_equal "Hello", link_to("Hello", {:action => 'myaction'}, nil)
- end
-
- def test_link_tag_with_custom_onclick
- assert_dom_equal "Hello", link_to("Hello", "http://www.example.com", :onclick => "alert('yay!')")
- end
-
- def test_link_tag_with_javascript_confirm
- assert_dom_equal(
- "Hello",
- link_to("Hello", "http://www.example.com", :confirm => "Are you sure?")
- )
- assert_dom_equal(
- "Hello",
- link_to("Hello", "http://www.example.com", :confirm => "You can't possibly be sure, can you?")
- )
- assert_dom_equal(
- "Hello",
- link_to("Hello", "http://www.example.com", :confirm => "You can't possibly be sure,\n can you?")
- )
- end
-
- def test_link_tag_with_popup
- assert_dom_equal(
- "Hello",
- link_to("Hello", "http://www.example.com", :popup => true)
- )
- assert_dom_equal(
- "Hello",
- link_to("Hello", "http://www.example.com", :popup => 'true')
- )
- assert_dom_equal(
- "Hello",
- link_to("Hello", "http://www.example.com", :popup => ['window_name', 'width=300,height=300'])
- )
- end
-
- def test_link_tag_with_popup_and_javascript_confirm
- assert_dom_equal(
- "Hello",
- link_to("Hello", "http://www.example.com", { :popup => true, :confirm => "Fo' sho'?" })
- )
- assert_dom_equal(
- "Hello",
- link_to("Hello", "http://www.example.com", { :popup => ['window_name', 'width=300,height=300'], :confirm => "Are you serious?" })
- )
- end
-
- def test_link_tag_using_post_javascript
- assert_dom_equal(
- "Hello",
- link_to("Hello", "http://www.example.com", :method => :post)
- )
- end
-
- def test_link_tag_using_delete_javascript
- assert_dom_equal(
- "Destroy",
- link_to("Destroy", "http://www.example.com", :method => :delete)
- )
- end
-
- def test_link_tag_using_delete_javascript_and_href
- assert_dom_equal(
- "Destroy",
- link_to("Destroy", "http://www.example.com", :method => :delete, :href => '#')
- )
- end
-
- def test_link_tag_using_post_javascript_and_confirm
- assert_dom_equal(
- "Hello",
- link_to("Hello", "http://www.example.com", :method => :post, :confirm => "Are you serious?")
- )
- end
-
- def test_link_tag_using_post_javascript_and_popup
- assert_raises(ActionView::ActionViewError) { link_to("Hello", "http://www.example.com", :popup => true, :method => :post, :confirm => "Are you serious?") }
- end
-
- def test_link_to_unless
- assert_equal "Showing", link_to_unless(true, "Showing", :action => "show", :controller => "weblog")
- assert_dom_equal "Listing", link_to_unless(false, "Listing", :action => "list", :controller => "weblog")
- assert_equal "Showing", link_to_unless(true, "Showing", :action => "show", :controller => "weblog", :id => 1)
- assert_equal "Showing", link_to_unless(true, "Showing", :action => "show", :controller => "weblog", :id => 1) { |name, options, html_options|
- "#{name}"
- }
- assert_equal "Showing", link_to_unless(true, "Showing", :action => "show", :controller => "weblog", :id => 1) { |name|
- "#{name}"
- }
- assert_equal "test", link_to_unless(true, "Showing", :action => "show", :controller => "weblog", :id => 1) {
- "test"
- }
- end
-
- def test_link_to_if
- assert_equal "Showing", link_to_if(false, "Showing", :action => "show", :controller => "weblog")
- assert_dom_equal "Listing", link_to_if(true, "Listing", :action => "list", :controller => "weblog")
- assert_equal "Showing", link_to_if(false, "Showing", :action => "show", :controller => "weblog", :id => 1)
- end
-
- def test_link_unless_current
- @controller.request = RequestMock.new("http://www.example.com/weblog/show")
- @controller.url = "http://www.example.com/weblog/show"
- assert_equal "Showing", link_to_unless_current("Showing", { :action => "show", :controller => "weblog" })
- assert_equal "Showing", link_to_unless_current("Showing", "http://www.example.com/weblog/show")
-
- @controller.request = RequestMock.new("http://www.example.com/weblog/show")
- @controller.url = "http://www.example.com/weblog/list"
- assert_equal "Listing",
- link_to_unless_current("Listing", :action => "list", :controller => "weblog")
- assert_equal "Listing",
- link_to_unless_current("Listing", "http://www.example.com/weblog/list")
- end
-
- def test_mail_to
- assert_dom_equal "david@loudthinking.com", mail_to("david@loudthinking.com")
- assert_dom_equal "David Heinemeier Hansson", mail_to("david@loudthinking.com", "David Heinemeier Hansson")
- assert_dom_equal(
- "David Heinemeier Hansson",
- mail_to("david@loudthinking.com", "David Heinemeier Hansson", "class" => "admin")
- )
- assert_equal mail_to("david@loudthinking.com", "David Heinemeier Hansson", "class" => "admin"),
- mail_to("david@loudthinking.com", "David Heinemeier Hansson", :class => "admin")
- end
-
- def test_mail_to_with_javascript
- assert_dom_equal "", mail_to("me@domain.com", "My email", :encode => "javascript")
- end
-
- def test_mail_with_options
- assert_dom_equal(
- %(My email),
- mail_to("me@example.com", "My email", :cc => "ccaddress@example.com", :bcc => "bccaddress@example.com", :subject => "This is an example email", :body => "This is the body of the message.")
- )
- end
-
- def test_mail_to_with_img
- assert_dom_equal %(), mail_to('feedback@example.com', '')
- end
-
- def test_mail_to_with_hex
- assert_dom_equal "My email", mail_to("me@domain.com", "My email", :encode => "hex")
- assert_dom_equal "me@domain.com", mail_to("me@domain.com", nil, :encode => "hex")
- end
-
- def test_mail_to_with_replace_options
- assert_dom_equal "wolfgang(at)stufenlos(dot)net", mail_to("wolfgang@stufenlos.net", nil, :replace_at => "(at)", :replace_dot => "(dot)")
- assert_dom_equal "me(at)domain.com", mail_to("me@domain.com", nil, :encode => "hex", :replace_at => "(at)")
- assert_dom_equal "My email", mail_to("me@domain.com", "My email", :encode => "hex", :replace_at => "(at)")
- assert_dom_equal "me(at)domain(dot)com", mail_to("me@domain.com", nil, :encode => "hex", :replace_at => "(at)", :replace_dot => "(dot)")
- assert_dom_equal "", mail_to("me@domain.com", "My email", :encode => "javascript", :replace_at => "(at)", :replace_dot => "(dot)")
- end
-
- def protect_against_forgery?
- false
- end
-end
-
-class UrlHelperWithControllerTest < ActionView::TestCase
- class UrlHelperController < ActionController::Base
- self.view_paths = [ "#{File.dirname(__FILE__)}/../fixtures/" ]
-
- def self.controller_path; 'url_helper_with_controller' end
-
- def show_url_for
- render :inline => "<%= url_for :controller => 'url_helper_with_controller', :action => 'show_url_for' %>"
- end
-
- def show_named_route
- render :inline => "<%= show_named_route_#{params[:kind]} %>"
- end
-
- def rescue_action(e) raise e end
- end
-
- tests ActionView::Helpers::UrlHelper
-
- def setup
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- @controller = UrlHelperController.new
- end
-
- def test_url_for_shows_only_path
- get :show_url_for
- assert_equal '/url_helper_with_controller/show_url_for', @response.body
- end
-
- def test_named_route_shows_host_and_path
- with_url_helper_routing do
- get :show_named_route, :kind => 'url'
- assert_equal 'http://test.host/url_helper_with_controller/show_named_route', @response.body
- end
- end
-
- def test_named_route_path_shows_only_path
- with_url_helper_routing do
- get :show_named_route, :kind => 'path'
- assert_equal '/url_helper_with_controller/show_named_route', @response.body
- end
- end
-
- protected
- def with_url_helper_routing
- with_routing do |set|
- set.draw do |map|
- map.show_named_route 'url_helper_with_controller/show_named_route', :controller => 'url_helper_with_controller', :action => 'show_named_route'
- end
- yield
- end
- end
-end
-
-class LinkToUnlessCurrentWithControllerTest < ActionView::TestCase
- class TasksController < ActionController::Base
- self.view_paths = ["#{File.dirname(__FILE__)}/../fixtures/"]
-
- def self.controller_path; 'tasks' end
-
- def index
- render_default
- end
-
- def show
- render_default
- end
-
- def rescue_action(e) raise e end
-
- protected
- def render_default
- render :inline =>
- "<%= link_to_unless_current(\"tasks\", tasks_path) %>\n" +
- "<%= link_to_unless_current(\"tasks\", tasks_url) %>"
- end
- end
-
- tests ActionView::Helpers::UrlHelper
-
- def setup
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- @controller = TasksController.new
- end
-
- def test_link_to_unless_current_to_current
- with_restful_routing do
- get :index
- assert_equal "tasks\ntasks", @response.body
- end
- end
-
- def test_link_to_unless_current_shows_link
- with_restful_routing do
- get :show, :id => 1
- assert_equal "tasks\n" +
- "tasks",
- @response.body
- end
- end
-
- protected
- def with_restful_routing
- with_routing do |set|
- set.draw do |map|
- map.resources :tasks
- end
- yield
- end
- end
-end
-
-
-class Workshop
- attr_accessor :id, :new_record
-
- def initialize(id, new_record)
- @id, @new_record = id, new_record
- end
-
- def new_record?
- @new_record
- end
-
- def to_s
- id.to_s
- end
-end
-
-class Session
- attr_accessor :id, :workshop_id, :new_record
-
- def initialize(id, new_record)
- @id, @new_record = id, new_record
- end
-
- def new_record?
- @new_record
- end
-
- def to_s
- id.to_s
- end
-end
-
-class PolymorphicControllerTest < ActionView::TestCase
- class WorkshopsController < ActionController::Base
- self.view_paths = ["#{File.dirname(__FILE__)}/../fixtures/"]
-
- def self.controller_path; 'workshops' end
-
- def index
- @workshop = Workshop.new(1, true)
- render :inline => "<%= url_for(@workshop) %>\n<%= link_to('Workshop', @workshop) %>"
- end
-
- def show
- @workshop = Workshop.new(params[:id], false)
- render :inline => "<%= url_for(@workshop) %>\n<%= link_to('Workshop', @workshop) %>"
- end
-
- def rescue_action(e) raise e end
- end
-
- class SessionsController < ActionController::Base
- self.view_paths = ["#{File.dirname(__FILE__)}/../fixtures/"]
-
- def self.controller_path; 'sessions' end
-
- def index
- @workshop = Workshop.new(params[:workshop_id], false)
- @session = Session.new(1, true)
- render :inline => "<%= url_for([@workshop, @session]) %>\n<%= link_to('Session', [@workshop, @session]) %>"
- end
-
- def show
- @workshop = Workshop.new(params[:workshop_id], false)
- @session = Session.new(params[:id], false)
- render :inline => "<%= url_for([@workshop, @session]) %>\n<%= link_to('Session', [@workshop, @session]) %>"
- end
-
- def rescue_action(e) raise e end
- end
-
- tests ActionView::Helpers::UrlHelper
-
- def setup
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- end
-
- def test_new_resource
- @controller = WorkshopsController.new
-
- with_restful_routing do
- get :index
- assert_equal "/workshops\nWorkshop", @response.body
- end
- end
-
- def test_existing_resource
- @controller = WorkshopsController.new
-
- with_restful_routing do
- get :show, :id => 1
- assert_equal "/workshops/1\nWorkshop", @response.body
- end
- end
-
- def test_new_nested_resource
- @controller = SessionsController.new
-
- with_restful_routing do
- get :index, :workshop_id => 1
- assert_equal "/workshops/1/sessions\nSession", @response.body
- end
- end
-
- def test_existing_nested_resource
- @controller = SessionsController.new
-
- with_restful_routing do
- get :show, :workshop_id => 1, :id => 1
- assert_equal "/workshops/1/sessions/1\nSession", @response.body
- end
- end
-
- protected
- def with_restful_routing
- with_routing do |set|
- set.draw do |map|
- map.resources :workshops do |w|
- w.resources :sessions
- end
- end
- yield
- end
- end
-end
diff --git a/vendor/rails/actionpack/test/testing_sandbox.rb b/vendor/rails/actionpack/test/testing_sandbox.rb
deleted file mode 100644
index c3658510..00000000
--- a/vendor/rails/actionpack/test/testing_sandbox.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-module TestingSandbox
- # Temporarily replaces KCODE for the block
- def with_kcode(kcode)
- if RUBY_VERSION < '1.9'
- old_kcode, $KCODE = $KCODE, kcode
- begin
- yield
- ensure
- $KCODE = old_kcode
- end
- else
- yield
- end
- end
-end
diff --git a/vendor/rails/actionwebservice/CHANGELOG b/vendor/rails/actionwebservice/CHANGELOG
deleted file mode 100644
index bb528035..00000000
--- a/vendor/rails/actionwebservice/CHANGELOG
+++ /dev/null
@@ -1,265 +0,0 @@
-*SVN*
-
-* Documentation for ActionWebService::API::Base. Closes #7275. [zackchandler]
-
-* Allow action_web_service to handle various HTTP methods including GET. Closes #7011. [zackchandler]
-
-* Ensure that DispatcherError is being thrown when a malformed request is received. [Kent Sibilev]
-
-* Added support for decimal types. Closes #6676. [Kent Sibilev]
-
-* Removed deprecated end_form_tag helper. [Kent Sibilev]
-
-* Removed deprecated @request and @response usages. [Kent Sibilev]
-
-* Removed invocation of deprecated before_action and around_action filter methods. Corresponding before_invocation and after_invocation methods should be used instead. #6275 [Kent Sibilev]
-
-* Provide access to the underlying SOAP driver. #6212 [bmilekic, Kent Sibilev]
-
-* Deprecation: update docs. #5998 [jakob@mentalized.net, Kevin Clark]
-
-* ActionWebService WSDL generation ignores HTTP_X_FORWARDED_HOST [Paul Butcher ]
-
-* Tighten rescue clauses. #5985 [james@grayproductions.net]
-
-* Fixed XMLRPC multicall when one of the called methods returns a struct object. [Kent Sibilev]
-
-* Replace Reloadable with Reloadable::Deprecated. [Nicholas Seckar]
-
-* Fix invoke_layered since api_method didn't declare :expects. Closes #4720. [Kevin Ballard , Kent Sibilev]
-
-* Replace alias method chaining with Module#alias_method_chain. [Marcel Molina Jr.]
-
-* Replace Ruby's deprecated append_features in favor of included. [Marcel Molina Jr.]
-
-* Fix test database name typo. [Marcel Molina Jr.]
-
-*1.1.2* (April 9th, 2006)
-
-* Rely on Active Record 1.14.2
-
-
-*1.1.1* (April 6th, 2006)
-
-* Do not convert driver options to strings (#4499)
-
-
-*1.1.0* (March 27th, 2006)
-
-* Make ActiveWebService::Struct type reloadable
-
-* Fix scaffolding action when one of the members of a structural type has date or time type
-
-* Remove extra index hash when generating scaffold html for parameters of structural type #4374 [joe@mjg2.com]
-
-* Fix Scaffold Fails with Struct as a Parameter #4363 [joe@mjg2.com]
-
-* Fix soap type registration of multidimensional arrays (#4232)
-
-* Fix that marshaler couldn't handle ActiveRecord models defined in a different namespace (#2392).
-
-* Fix that marshaler couldn't handle structs with members of ActiveRecord type (#1889).
-
-* Fix that marshaler couldn't handle nil values for inner structs (#3576).
-
-* Fix that changes to ActiveWebService::API::Base required restarting of the server (#2390).
-
-* Fix scaffolding for signatures with :date, :time and :base64 types (#3321, #2769, #2078).
-
-* Fix for incorrect casting of TrueClass/FalseClass instances (#2633, #3421).
-
-* Fix for incompatibility problems with SOAP4R 1.5.5 (#2553) [Kent Sibilev]
-
-
-*1.0.0* (December 13th, 2005)
-
-* Become part of Rails 1.0
-
-*0.9.4* (December 7th, 2005)
-
-* Update from LGPL to MIT license as per Minero Aoki's permission. [Marcel Molina Jr.]
-
-* Rename Version constant to VERSION. #2802 [Marcel Molina Jr.]
-
-* Fix that XML-RPC date/time values did not have well-defined behaviour (#2516, #2534). This fix has one caveat, in that we can't support pre-1970 dates from XML-RPC clients.
-
-*0.9.3* (November 7th, 2005)
-
-* Upgraded to Action Pack 1.11.0 and Active Record 1.13.0
-
-
-*0.9.2* (October 26th, 2005)
-
-* Upgraded to Action Pack 1.10.2 and Active Record 1.12.2
-
-
-*0.9.1* (October 19th, 2005)
-
-* Upgraded to Action Pack 1.10.1 and Active Record 1.12.1
-
-
-*0.9.0* (October 16th, 2005)
-
-* Fix invalid XML request generation bug in test_invoke [Ken Barker]
-
-* Add XML-RPC 'system.multicall' support #1941 [jbonnar]
-
-* Fix duplicate XSD entries for custom types shared across delegated/layered services #1729 [Tyler Kovacs]
-
-* Allow multiple invocations in the same test method #1720 [dkhawk]
-
-* Added ActionWebService::API::Base.soap_client and ActionWebService::API::Base.xmlrpc_client helper methods to create the internal clients for an API, useful for testing from ./script/console
-
-* ActionWebService now always returns UTF-8 responses.
-
-
-*0.8.1* (11 July, 2005)
-
-* Fix scaffolding for Action Pack controller changes
-
-
-*0.8.0* (6 July, 2005)
-
-* Fix WSDL generation by aliasing #inherited instead of trying to overwrite it, or the WSDL action may end up not being defined in the controller
-
-* Add ActionController::Base.wsdl_namespace option, to allow overriding of the namespace used in generated WSDL and SOAP messages. This is equivalent to the [WebService(Namespace = "Value")] attribute in .NET.
-
-* Add workaround for Ruby 1.8.3's SOAP4R changing the return value of SOAP::Mapping::Registry#find_mapped_soap_class #1414 [Shugo Maeda]
-
-* Fix moduled controller URLs in WSDL, and add unit test to verify the generated URL #1428
-
-* Fix scaffolding template paths, it was broken on Win32
-
-* Fix that functional testing of :layered controllers failed when using the SOAP protocol
-
-* Allow invocation filters in :direct controllers as well, as they have access to more information regarding the web service request than ActionPack filters
-
-* Add support for a :base64 signature type #1272 [Shugo Maeda]
-
-* Fix that boolean fields were not rendered correctly in scaffolding
-
-* Fix that scaffolding was not working for :delegated dispatching
-
-* Add support for structured types as input parameters to scaffolding, this should let one test the blogging APIs using scaffolding as well
-
-* Fix that generated WSDL was not using relative_url_root for base URI #1210 [Shugo Maeda]
-
-* Use UTF-8 encoding by default for SOAP responses, but if an encoding is supplied by caller, use that for the response #1211 [Shugo Maeda, NAKAMURA Hiroshi]
-
-* If the WSDL was retrieved over HTTPS, use HTTPS URLs in the WSDL too
-
-* Fix that casting change in 0.7.0 would convert nil values to the default value for the type instead of leaving it as nil
-
-
-*0.7.1* (20th April, 2005)
-
-* Depend on Active Record 1.10.1 and Action Pack 1.8.1
-
-
-*0.7.0* (19th April, 2005)
-
-* When casting structured types, don't try to send obj.name= unless obj responds to it, causes casting to be less likely to fail for XML-RPC
-
-* Add scaffolding via ActionController::Base.web_service_scaffold for quick testing using a web browser
-
-* ActionWebService::API::Base#api_methods now returns a hash containing ActionWebService::API::Method objects instead of hashes. However, ActionWebService::API::Method defines a #[]() backwards compatibility method so any existing code utilizing this will still work.
-
-* The :layered dispatching mode can now be used with SOAP as well, allowing you to support SOAP and XML-RPC clients for APIs like the metaWeblog API
-
-* Remove ActiveRecordSoapMarshallable workaround, see #912 for details
-
-* Generalize casting code to be used by both SOAP and XML-RPC (previously, it was only XML-RPC)
-
-* Ensure return value is properly cast as well, fixes XML-RPC interoperability with Ecto and possibly other clients
-
-* Include backtraces in 500 error responses for failed request parsing, and remove "rescue nil" statements obscuring real errors for XML-RPC
-
-* Perform casting of struct members even if the structure is already of the correct type, so that the type we specify for the struct member is always the type of the value seen by the API implementation
-
-
-*0.6.2* (27th March, 2005)
-
-* Allow method declarations for direct dispatching to declare parameters as well. We treat an arity of < 0 or > 0 as an indication that we should send through parameters. Closes #939.
-
-
-*0.6.1* (22th March, 2005)
-
-* Fix that method response QNames mismatched with that declared in the WSDL, makes SOAP::WSDLDriverFactory work against AWS again
-
-* Fix that @request.env was being modified, instead, dup the value gotten from env
-
-* Fix XML-RPC example to use :layered mode, so it works again
-
-* Support casting '0' or 0 into false, and '1' or 1 into true, when expecting a boolean value
-
-* Fix that SOAP fault response fault code values were not QName's #804
-
-
-*0.6.0* (7th March, 2005)
-
-* Add action_controller/test_invoke, used for integrating AWS with the Rails testing infrastructure
-
-* Allow passing through options to the SOAP RPC driver for the SOAP client
-
-* Make the SOAP WS marshaler use #columns to decide which fields to marshal as well, avoids providing attributes brought in by associations
-
-* Add ActionWebService::API::Base.allow_active_record_expects option, with a default of false. Setting this to true will allow specifying ActiveRecord::Base model classes in :expects. API writers should take care to validate the received ActiveRecord model objects when turning it on, and/or have an authentication mechanism in place to reduce the security risk.
-
-* Improve error message reporting. Bugs in either AWS or the web service itself will send back a protocol-specific error report message if possible, otherwise, provide as much detail as possible.
-
-* Removed type checking of received parameters, and perform casting for XML-RPC if possible, but fallback to the received parameters if casting fails, closes #677
-
-* Refactored SOAP and XML-RPC marshaling and encoding into a small library devoted exclusively to protocol specifics, also cleaned up the SOAP marshaling approach, so that array and custom type marshaling should be a bit faster.
-
-* Add namespaced XML-RPC method name support, closes #678
-
-* Replace '::' with '..' in fully qualified type names for marshaling and WSDL. This improves interoperability with .NET, and closes #676.
-
-
-*0.5.0* (24th February, 2005)
-
- * lib/action_service/dispatcher*: replace "router" fragments with
- one file for Action Controllers, moves dispatching work out of
- the container
- * lib/*,test/*,examples/*: rename project to
- ActionWebService. prefix all generic "service" type names with web_.
- update all using code as well as the RDoc.
- * lib/action_service/router/wsdl.rb: ensure that #wsdl is
- defined in the final container class, or the new ActionPack
- filtering will exclude it
- * lib/action_service/struct.rb,test/struct_test.rb: create a
- default #initialize on inherit that accepts a Hash containing
- the default member values
- * lib/action_service/api/action_controller.rb: add support and
- tests for #client_api in controller
- * test/router_wsdl_test.rb: add tests to ensure declared
- service names don't contain ':', as ':' causes interoperability
- issues
- * lib/*, test/*: rename "interface" concept to "api", and change all
- related uses to reflect this change. update all uses of Inflector
- to call the method on String instead.
- * test/api_test.rb: add test to ensure API definition not
- instantiatable
- * lib/action_service/invocation.rb: change @invocation_params to
- @method_params
- * lib/*: update RDoc
- * lib/action_service/struct.rb: update to support base types
- * lib/action_service/support/signature.rb: support the notion of
- "base types" in signatures, with well-known unambiguous names such as :int,
- :bool, etc, which map to the correct Ruby class. accept the same names
- used by ActiveRecord as well as longer versions of each, as aliases.
- * examples/*: update for seperate API definition updates
- * lib/action_service/*, test/*: extensive refactoring: define API methods in
- a seperate class, and specify it wherever used with 'service_api'.
- this makes writing a client API for accessing defined API methods
- with ActionWebService really easy.
- * lib/action_service/container.rb: fix a bug in default call
- handling for direct dispatching, and add ActionController filter
- support for direct dispatching.
- * test/router_action_controller_test.rb: add tests to ensure
- ActionController filters are actually called.
- * test/protocol_soap_test.rb: add more tests for direct dispatching.
-
-0.3.0
-
- * First public release
diff --git a/vendor/rails/actionwebservice/MIT-LICENSE b/vendor/rails/actionwebservice/MIT-LICENSE
deleted file mode 100644
index 528941e8..00000000
--- a/vendor/rails/actionwebservice/MIT-LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-Copyright (C) 2005 Leon Breedt
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
diff --git a/vendor/rails/actionwebservice/README b/vendor/rails/actionwebservice/README
deleted file mode 100644
index 178baa7c..00000000
--- a/vendor/rails/actionwebservice/README
+++ /dev/null
@@ -1,381 +0,0 @@
-= Action Web Service -- Serving APIs on rails
-
-Action Web Service provides a way to publish interoperable web service APIs with
-Rails without spending a lot of time delving into protocol details.
-
-
-== Features
-
-* SOAP RPC protocol support
-* Dynamic WSDL generation for APIs
-* XML-RPC protocol support
-* Clients that use the same API definitions as the server for
- easy interoperability with other Action Web Service based applications
-* Type signature hints to improve interoperability with static languages
-* Active Record model class support in signatures
-
-
-== Defining your APIs
-
-You specify the methods you want to make available as API methods in an
-ActionWebService::API::Base derivative, and then specify this API
-definition class wherever you want to use that API.
-
-The implementation of the methods is done separately from the API
-specification.
-
-
-==== Method name inflection
-
-Action Web Service will camelcase the method names according to Rails Inflector
-rules for the API visible to public callers. What this means, for example,
-is that the method names in generated WSDL will be camelcased, and callers will
-have to supply the camelcased name in their requests for the request to
-succeed.
-
-If you do not desire this behaviour, you can turn it off with the
-ActionWebService::API::Base +inflect_names+ option.
-
-
-==== Inflection examples
-
- :add => Add
- :find_all => FindAll
-
-
-==== Disabling inflection
-
- class PersonAPI < ActionWebService::API::Base
- inflect_names false
- end
-
-
-==== API definition example
-
- class PersonAPI < ActionWebService::API::Base
- api_method :add, :expects => [:string, :string, :bool], :returns => [:int]
- api_method :remove, :expects => [:int], :returns => [:bool]
- end
-
-==== API usage example
-
- class PersonController < ActionController::Base
- web_service_api PersonAPI
-
- def add
- end
-
- def remove
- end
- end
-
-
-== Publishing your APIs
-
-Action Web Service uses Action Pack to process protocol requests. There are two
-modes of dispatching protocol requests, _Direct_, and _Delegated_.
-
-
-=== Direct dispatching
-
-This is the default mode. In this mode, public controller instance methods
-implement the API methods, and parameters are passed through to the methods in
-accordance with the API specification.
-
-The return value of the method is sent back as the return value to the
-caller.
-
-In this mode, a special api action is generated in the target
-controller to unwrap the protocol request, forward it on to the relevant method
-and send back the wrapped return value. This action must not be
-overridden.
-
-==== Direct dispatching example
-
- class PersonController < ApplicationController
- web_service_api PersonAPI
-
- def add
- end
-
- def remove
- end
- end
-
- class PersonAPI < ActionWebService::API::Base
- ...
- end
-
-
-For this example, protocol requests for +Add+ and +Remove+ methods sent to
-/person/api will be routed to the controller methods +add+ and +remove+.
-
-
-=== Delegated dispatching
-
-This mode can be turned on by setting the +web_service_dispatching_mode+ option
-in a controller to :delegated.
-
-In this mode, the controller contains one or more web service objects (objects
-that implement an ActionWebService::API::Base definition). These web service
-objects are each mapped onto one controller action only.
-
-==== Delegated dispatching example
-
- class ApiController < ApplicationController
- web_service_dispatching_mode :delegated
-
- web_service :person, PersonService.new
- end
-
- class PersonService < ActionWebService::Base
- web_service_api PersonAPI
-
- def add
- end
-
- def remove
- end
- end
-
- class PersonAPI < ActionWebService::API::Base
- ...
- end
-
-
-For this example, all protocol requests for +PersonService+ are
-sent to the /api/person action.
-
-The /api/person action is generated when the +web_service+
-method is called. This action must not be overridden.
-
-Other controller actions (actions that aren't the target of a +web_service+ call)
-are ignored for ActionWebService purposes, and can do normal action tasks.
-
-
-=== Layered dispatching
-
-This mode can be turned on by setting the +web_service_dispatching_mode+ option
-in a controller to :layered.
-
-This mode is similar to _delegated_ mode, in that multiple web service objects
-can be attached to one controller, however, all protocol requests are sent to a
-single endpoint.
-
-Use this mode when you want to share code between XML-RPC and SOAP clients,
-for APIs where the XML-RPC method names have prefixes. An example of such
-a method name would be blogger.newPost.
-
-
-==== Layered dispatching example
-
-
- class ApiController < ApplicationController
- web_service_dispatching_mode :layered
-
- web_service :mt, MovableTypeService.new
- web_service :blogger, BloggerService.new
- web_service :metaWeblog, MetaWeblogService.new
- end
-
- class MovableTypeService < ActionWebService::Base
- ...
- end
-
- class BloggerService < ActionWebService::Base
- ...
- end
-
- class MetaWeblogService < ActionWebService::API::Base
- ...
- end
-
-
-For this example, an XML-RPC call for a method with a name like
-mt.getCategories will be sent to the getCategories
-method on the :mt service.
-
-
-== Customizing WSDL generation
-
-You can customize the names used for the SOAP bindings in the generated
-WSDL by using the wsdl_service_name option in a controller:
-
- class WsController < ApplicationController
- wsdl_service_name 'MyApp'
- end
-
-You can also customize the namespace used in the generated WSDL for
-custom types and message definition types:
-
- class WsController < ApplicationController
- wsdl_namespace 'http://my.company.com/app/wsapi'
- end
-
-The default namespace used is 'urn:ActionWebService', if you don't supply
-one.
-
-
-== ActionWebService and UTF-8
-
-If you're going to be sending back strings containing non-ASCII UTF-8
-characters using the :string data type, you need to make sure that
-Ruby is using UTF-8 as the default encoding for its strings.
-
-The default in Ruby is to use US-ASCII encoding for strings, which causes a string
-validation check in the Ruby SOAP library to fail and your string to be sent
-back as a Base-64 value, which may confuse clients that expected strings
-because of the WSDL.
-
-Two ways of setting the default string encoding are:
-
-* Start Ruby using the -Ku command-line option to the Ruby executable
-* Set the $KCODE flag in config/environment.rb to the
- string 'UTF8'
-
-
-== Testing your APIs
-
-
-=== Functional testing
-
-You can perform testing of your APIs by creating a functional test for the
-controller dispatching the API, and calling #invoke in the test case to
-perform the invocation.
-
-Example:
-
- class PersonApiControllerTest < Test::Unit::TestCase
- def setup
- @controller = PersonController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- end
-
- def test_add
- result = invoke :remove, 1
- assert_equal true, result
- end
- end
-
-This example invokes the API method test, defined on
-the PersonController, and returns the result.
-
-If you're not using SOAP (or you're having serialisation difficulties),
-you can test XMLRPC like this:
-
- class PersonApiControllerTest < Test::Unit::TestCase
- def setup
- @controller = PersonController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
-
- @protocol = :xmlrpc # can also be :soap, the default
- end
-
- def test_add
- result = invoke :remove, 1 # no change here
- assert_equal true, result
- end
- end
-
-=== Scaffolding
-
-You can also test your APIs with a web browser by attaching scaffolding
-to the controller.
-
-Example:
-
- class PersonController
- web_service_scaffold :invocation
- end
-
-This creates an action named invocation on the PersonController.
-
-Navigating to this action lets you select the method to invoke, supply the parameters,
-and view the result of the invocation.
-
-
-== Using the client support
-
-Action Web Service includes client classes that can use the same API
-definition as the server. The advantage of this approach is that your client
-will have the same support for Active Record and structured types as the
-server, and can just use them directly, and rely on the marshaling to Do The
-Right Thing.
-
-*Note*: The client support is intended for communication between Ruby on Rails
-applications that both use Action Web Service. It may work with other servers, but
-that is not its intended use, and interoperability can't be guaranteed, especially
-not for .NET web services.
-
-Web services protocol specifications are complex, and Action Web Service client
-support can only be guaranteed to work with a subset.
-
-
-==== Factory created client example
-
- class BlogManagerController < ApplicationController
- web_client_api :blogger, :xmlrpc, 'http://url/to/blog/api/RPC2', :handler_name => 'blogger'
- end
-
- class SearchingController < ApplicationController
- web_client_api :google, :soap, 'http://url/to/blog/api/beta', :service_name => 'GoogleSearch'
- end
-
-See ActionWebService::API::ActionController::ClassMethods for more details.
-
-==== Manually created client example
-
- class PersonAPI < ActionWebService::API::Base
- api_method :find_all, :returns => [[Person]]
- end
-
- soap_client = ActionWebService::Client::Soap.new(PersonAPI, "http://...")
- persons = soap_client.find_all
-
- class BloggerAPI < ActionWebService::API::Base
- inflect_names false
- api_method :getRecentPosts, :returns => [[Blog::Post]]
- end
-
- blog = ActionWebService::Client::XmlRpc.new(BloggerAPI, "http://.../xmlrpc", :handler_name => "blogger")
- posts = blog.getRecentPosts
-
-
-See ActionWebService::Client::Soap and ActionWebService::Client::XmlRpc for more details.
-
-== Dependencies
-
-Action Web Service requires that the Action Pack and Active Record are either
-available to be required immediately or are accessible as GEMs.
-
-It also requires a version of Ruby that includes SOAP support in the standard
-library. At least version 1.8.2 final (2004-12-25) of Ruby is recommended; this
-is the version tested against.
-
-
-== Download
-
-The latest Action Web Service version can be downloaded from
-http://rubyforge.org/projects/actionservice
-
-
-== Installation
-
-You can install Action Web Service with the following command.
-
- % [sudo] ruby setup.rb
-
-
-== License
-
-Action Web Service is released under the MIT license.
-
-
-== Support
-
-The Ruby on Rails mailing list
-
-Or, to contact the author, send mail to bitserf@gmail.com
-
diff --git a/vendor/rails/actionwebservice/Rakefile b/vendor/rails/actionwebservice/Rakefile
deleted file mode 100644
index ad2ad223..00000000
--- a/vendor/rails/actionwebservice/Rakefile
+++ /dev/null
@@ -1,172 +0,0 @@
-require 'rubygems'
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-require 'rake/packagetask'
-require 'rake/gempackagetask'
-require 'rake/contrib/rubyforgepublisher'
-require 'fileutils'
-require File.join(File.dirname(__FILE__), 'lib', 'action_web_service', 'version')
-
-PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
-PKG_NAME = 'actionwebservice'
-PKG_VERSION = ActionWebService::VERSION::STRING + PKG_BUILD
-PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
-PKG_DESTINATION = ENV["RAILS_PKG_DESTINATION"] || "../#{PKG_NAME}"
-
-RELEASE_NAME = "REL #{PKG_VERSION}"
-
-RUBY_FORGE_PROJECT = "aws"
-RUBY_FORGE_USER = "webster132"
-
-desc "Default Task"
-task :default => [ :test ]
-
-
-# Run the unit tests
-Rake::TestTask.new { |t|
- t.libs << "test"
- t.test_files = Dir['test/*_test.rb']
- t.verbose = true
-}
-
-SCHEMA_PATH = File.join(File.dirname(__FILE__), *%w(test fixtures db_definitions))
-
-desc 'Build the MySQL test database'
-task :build_database do
- %x( mysqladmin create actionwebservice_unittest )
- %x( mysql actionwebservice_unittest < #{File.join(SCHEMA_PATH, 'mysql.sql')} )
-end
-
-
-# Generate the RDoc documentation
-Rake::RDocTask.new { |rdoc|
- rdoc.rdoc_dir = 'doc'
- rdoc.title = "Action Web Service -- Web services for Action Pack"
- rdoc.options << '--line-numbers' << '--inline-source'
- rdoc.options << '--charset' << 'utf-8'
- rdoc.template = "#{ENV['template']}.rb" if ENV['template']
- rdoc.rdoc_files.include('README')
- rdoc.rdoc_files.include('CHANGELOG')
- rdoc.rdoc_files.include('lib/action_web_service.rb')
- rdoc.rdoc_files.include('lib/action_web_service/*.rb')
- rdoc.rdoc_files.include('lib/action_web_service/api/*.rb')
- rdoc.rdoc_files.include('lib/action_web_service/client/*.rb')
- rdoc.rdoc_files.include('lib/action_web_service/container/*.rb')
- rdoc.rdoc_files.include('lib/action_web_service/dispatcher/*.rb')
- rdoc.rdoc_files.include('lib/action_web_service/protocol/*.rb')
- rdoc.rdoc_files.include('lib/action_web_service/support/*.rb')
-}
-
-
-# Create compressed packages
-spec = Gem::Specification.new do |s|
- s.platform = Gem::Platform::RUBY
- s.name = PKG_NAME
- s.summary = "Web service support for Action Pack."
- s.description = %q{Adds WSDL/SOAP and XML-RPC web service support to Action Pack}
- s.version = PKG_VERSION
-
- s.author = "Leon Breedt"
- s.email = "bitserf@gmail.com"
- s.rubyforge_project = "aws"
- s.homepage = "http://www.rubyonrails.org"
-
- s.add_dependency('actionpack', '= 1.13.5' + PKG_BUILD)
- s.add_dependency('activerecord', '= 1.15.5' + PKG_BUILD)
-
- s.has_rdoc = true
- s.requirements << 'none'
- s.require_path = 'lib'
- s.autorequire = 'action_web_service'
-
- s.files = [ "Rakefile", "setup.rb", "README", "TODO", "CHANGELOG", "MIT-LICENSE" ]
- s.files = s.files + Dir.glob( "examples/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
- s.files = s.files + Dir.glob( "lib/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
- s.files = s.files + Dir.glob( "test/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
-end
-Rake::GemPackageTask.new(spec) do |p|
- p.gem_spec = spec
- p.need_tar = true
- p.need_zip = true
-end
-
-
-# Publish beta gem
-desc "Publish the API documentation"
-task :pgem => [:package] do
- Rake::SshFilePublisher.new("davidhh@wrath.rubyonrails.org", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
- `ssh davidhh@wrath.rubyonrails.org './gemupdate.sh'`
-end
-
-# Publish documentation
-desc "Publish the API documentation"
-task :pdoc => [:rdoc] do
- Rake::SshDirPublisher.new("davidhh@wrath.rubyonrails.org", "public_html/aws", "doc").upload
-end
-
-
-def each_source_file(*args)
- prefix, includes, excludes, open_file = args
- prefix ||= File.dirname(__FILE__)
- open_file = true if open_file.nil?
- includes ||= %w[lib\/action_web_service\.rb$ lib\/action_web_service\/.*\.rb$]
- excludes ||= %w[lib\/action_web_service\/vendor]
- Find.find(prefix) do |file_name|
- next if file_name =~ /\.svn/
- file_name.gsub!(/^\.\//, '')
- continue = false
- includes.each do |inc|
- if file_name.match(/#{inc}/)
- continue = true
- break
- end
- end
- next unless continue
- excludes.each do |exc|
- if file_name.match(/#{exc}/)
- continue = false
- break
- end
- end
- next unless continue
- if open_file
- File.open(file_name) do |f|
- yield file_name, f
- end
- else
- yield file_name
- end
- end
-end
-
-desc "Count lines of the AWS source code"
-task :lines do
- total_lines = total_loc = 0
- puts "Per File:"
- each_source_file do |file_name, f|
- file_lines = file_loc = 0
- while line = f.gets
- file_lines += 1
- next if line =~ /^\s*$/
- next if line =~ /^\s*#/
- file_loc += 1
- end
- puts " #{file_name}: Lines #{file_lines}, LOC #{file_loc}"
- total_lines += file_lines
- total_loc += file_loc
- end
- puts "Total:"
- puts " Lines #{total_lines}, LOC #{total_loc}"
-end
-
-desc "Publish the release files to RubyForge."
-task :release => [ :package ] do
- require 'rubyforge'
-
- packages = %w( gem tgz zip ).collect{ |ext| "pkg/#{PKG_NAME}-#{PKG_VERSION}.#{ext}" }
-
- rubyforge = RubyForge.new
- rubyforge.login
- rubyforge.add_release(PKG_NAME, PKG_NAME, "REL #{PKG_VERSION}", *packages)
-end
diff --git a/vendor/rails/actionwebservice/TODO b/vendor/rails/actionwebservice/TODO
deleted file mode 100644
index 7c022c14..00000000
--- a/vendor/rails/actionwebservice/TODO
+++ /dev/null
@@ -1,32 +0,0 @@
-= Post-1.0
- - Document/Literal SOAP support
- - URL-based dispatching, URL identifies method
-
- - Add :rest dispatching mode, a.l.a. Backpack API. Clean up dispatching
- in general. Support vanilla XML-format as a "Rails" protocol?
- XML::Simple deserialization into params?
-
- web_service_dispatching_mode :rest
-
- def method1(params)
- end
-
- def method2(params)
- end
-
-
- /ws/method1
-
- /ws/method2
-
-
- - Allow locking down a controller to only accept messages for a particular
- protocol. This will allow us to generate fully conformant error messages
- in cases where we currently fudge it if we don't know the protocol.
-
- - Allow AWS user to participate in typecasting, so they can centralize
- workarounds for buggy input in one place
-
-= Refactoring
- - Don't have clean way to go from SOAP Class object to the xsd:NAME type
- string -- NaHi possibly looking at remedying this situation
diff --git a/vendor/rails/actionwebservice/examples/googlesearch/README b/vendor/rails/actionwebservice/examples/googlesearch/README
deleted file mode 100644
index 25ccbd23..00000000
--- a/vendor/rails/actionwebservice/examples/googlesearch/README
+++ /dev/null
@@ -1,143 +0,0 @@
-= Google Service example
-
-This example shows how one would implement an API like Google
-Search that uses lots of structured types.
-
-There are examples for "Direct" and "Delegated" dispatching
-modes.
-
-There is also an example for API definition file autoloading.
-
-
-= Running the examples
-
- 1. Add the files to an Action Web Service enabled Rails project.
-
- "Direct" example:
-
- * Copy direct/search_controller.rb to "app/controllers"
- in a Rails project.
- * Copy direct/google_search_api.rb to "app/apis"
- in a Rails project
-
- "Delegated" example:
-
- * Copy delegated/search_controller.rb to "app/controllers"
- in a Rails project.
- * Copy delegated/google_search_service.rb to "lib"
- in a Rails project.
-
- "Autoloading" example:
-
- * Copy autoloading/google_search_api.rb to "app/apis" (create the directory
- if it doesn't exist) in a Rails project.
-
- * Copy autoloading/google_search_controller.rb "app/controllers"
- in a Rails project.
-
-
- 2. Go to the WSDL url in a browser, and check that it looks correct.
-
- "Direct" and "Delegated" examples:
- http://url_to_project/search/wsdl
-
- "Autoloading" example:
- http://url_to_project/google_search/wsdl
-
- You can compare it to Google's hand-coded WSDL at http://api.google.com/GoogleSearch.wsdl
- and see how close (or not) the generated version is.
-
- Note that I used GoogleSearch as the canonical "best practice"
- interoperable example when implementing WSDL/SOAP support, which might
- explain extreme similarities :)
-
-
- 3. Test that it works with .NET (Mono in this example):
-
- $ wget WSDL_URL
- $ mv wsdl GoogleSearch.wsdl
- $ wsdl -out:GoogleSearch.cs GoogleSearch.wsdl
-
- Add these lines to the GoogleSearchService class body (be mindful of the
- wrapping):
-
- public static void Main(string[] args)
- {
- GoogleSearchResult result;
- GoogleSearchService service;
-
- service = new GoogleSearchService();
- result = service.doGoogleSearch("myApiKey", "my query", 10, 30, true, "restrict", false, "lr", "ie", "oe");
- System.Console.WriteLine("documentFiltering: {0}", result.documentFiltering);
- System.Console.WriteLine("searchComments: {0}", result.searchComments);
- System.Console.WriteLine("estimatedTotalResultsCount: {0}", result.estimatedTotalResultsCount);
- System.Console.WriteLine("estimateIsExact: {0}", result.estimateIsExact);
- System.Console.WriteLine("resultElements:");
- foreach (ResultElement element in result.resultElements) {
- System.Console.WriteLine("\tsummary: {0}", element.summary);
- System.Console.WriteLine("\tURL: {0}", element.URL);
- System.Console.WriteLine("\tsnippet: {0}", element.snippet);
- System.Console.WriteLine("\ttitle: {0}", element.title);
- System.Console.WriteLine("\tcachedSize: {0}", element.cachedSize);
- System.Console.WriteLine("\trelatedInformationPresent: {0}", element.relatedInformationPresent);
- System.Console.WriteLine("\thostName: {0}", element.hostName);
- System.Console.WriteLine("\tdirectoryCategory: {0}", element.directoryCategory.fullViewableName);
- System.Console.WriteLine("\tdirectoryTitle: {0}", element.directoryTitle);
- }
- System.Console.WriteLine("searchQuery: {0}", result.searchQuery);
- System.Console.WriteLine("startIndex: {0}", result.startIndex);
- System.Console.WriteLine("endIndex: {0}", result.endIndex);
- System.Console.WriteLine("searchTips: {0}", result.searchTips);
- System.Console.WriteLine("directoryCategories:");
- foreach (DirectoryCategory cat in result.directoryCategories) {
- System.Console.WriteLine("\t{0} ({1})", cat.fullViewableName, cat.specialEncoding);
- }
- System.Console.WriteLine("searchTime: {0}", result.searchTime);
- }
-
- Now compile and run:
-
- $ mcs -reference:System.Web.Services GoogleSearch.cs
- $ mono GoogleSearch.exe
-
-
- If you had the application running (on the same host you got
- the WSDL from), you should see something like this:
-
-
- documentFiltering: True
- searchComments:
- estimatedTotalResultsCount: 322000
- estimateIsExact: False
- resultElements:
- summary: ONlamp.com: Rolling with Ruby on Rails
- URL: http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html
- snippet: Curt Hibbs shows off Ruby on Rails by building a simple ...
- title: Teh Railz0r
- cachedSize: Almost no lines of code!
- relatedInformationPresent: True
- hostName: rubyonrails.com
- directoryCategory: Web Development
- directoryTitle:
- searchQuery: http://www.google.com/search?q=ruby+on+rails
- startIndex: 10
- endIndex: 40
- searchTips: "on" is a very common word and was not included in your search [details]
- directoryCategories:
- Web Development (UTF-8)
- Programming (US-ASCII)
- searchTime: 1E-06
-
-
- Also, if an API method throws an exception, it will be sent back to the
- caller in the protocol's exception format, so they should get an exception
- thrown on their side with a meaningful error message.
-
- If you don't like this behaviour, you can do:
-
- class MyController < ActionController::Base
- web_service_exception_reporting false
- end
-
- 4. Crack open a beer. Publishing APIs for working with the same model as
- your Rails web app should be easy from now on :)
diff --git a/vendor/rails/actionwebservice/examples/googlesearch/autoloading/google_search_api.rb b/vendor/rails/actionwebservice/examples/googlesearch/autoloading/google_search_api.rb
deleted file mode 100644
index ed69fed7..00000000
--- a/vendor/rails/actionwebservice/examples/googlesearch/autoloading/google_search_api.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-class DirectoryCategory < ActionWebService::Struct
- member :fullViewableName, :string
- member :specialEncoding, :string
-end
-
-class ResultElement < ActionWebService::Struct
- member :summary, :string
- member :URL, :string
- member :snippet, :string
- member :title, :string
- member :cachedSize, :string
- member :relatedInformationPresent, :bool
- member :hostName, :string
- member :directoryCategory, DirectoryCategory
- member :directoryTitle, :string
-end
-
-class GoogleSearchResult < ActionWebService::Struct
- member :documentFiltering, :bool
- member :searchComments, :string
- member :estimatedTotalResultsCount, :int
- member :estimateIsExact, :bool
- member :resultElements, [ResultElement]
- member :searchQuery, :string
- member :startIndex, :int
- member :endIndex, :int
- member :searchTips, :string
- member :directoryCategories, [DirectoryCategory]
- member :searchTime, :float
-end
-
-class GoogleSearchAPI < ActionWebService::API::Base
- inflect_names false
-
- api_method :doGetCachedPage, :returns => [:string], :expects => [{:key=>:string}, {:url=>:string}]
- api_method :doGetSpellingSuggestion, :returns => [:string], :expects => [{:key=>:string}, {:phrase=>:string}]
-
- api_method :doGoogleSearch, :returns => [GoogleSearchResult], :expects => [
- {:key=>:string},
- {:q=>:string},
- {:start=>:int},
- {:maxResults=>:int},
- {:filter=>:bool},
- {:restrict=>:string},
- {:safeSearch=>:bool},
- {:lr=>:string},
- {:ie=>:string},
- {:oe=>:string}
- ]
-end
diff --git a/vendor/rails/actionwebservice/examples/googlesearch/autoloading/google_search_controller.rb b/vendor/rails/actionwebservice/examples/googlesearch/autoloading/google_search_controller.rb
deleted file mode 100644
index c62e869d..00000000
--- a/vendor/rails/actionwebservice/examples/googlesearch/autoloading/google_search_controller.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-class GoogleSearchController < ApplicationController
- wsdl_service_name 'GoogleSearch'
-
- def doGetCachedPage
- "i am a cached page. my key was %s, url was %s" % [@params['key'], @params['url']]
- end
-
- def doSpellingSuggestion
- "%s: Did you mean '%s'?" % [@params['key'], @params['phrase']]
- end
-
- def doGoogleSearch
- resultElement = ResultElement.new
- resultElement.summary = "ONlamp.com: Rolling with Ruby on Rails"
- resultElement.URL = "http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html"
- resultElement.snippet = "Curt Hibbs shows off Ruby on Rails by building a simple application that requires " +
- "almost no Ruby experience. ... Rolling with Ruby on Rails. ..."
- resultElement.title = "Teh Railz0r"
- resultElement.cachedSize = "Almost no lines of code!"
- resultElement.relatedInformationPresent = true
- resultElement.hostName = "rubyonrails.com"
- resultElement.directoryCategory = category("Web Development", "UTF-8")
-
- result = GoogleSearchResult.new
- result.documentFiltering = @params['filter']
- result.searchComments = ""
- result.estimatedTotalResultsCount = 322000
- result.estimateIsExact = false
- result.resultElements = [resultElement]
- result.searchQuery = "http://www.google.com/search?q=ruby+on+rails"
- result.startIndex = @params['start']
- result.endIndex = @params['start'] + @params['maxResults']
- result.searchTips = "\"on\" is a very common word and was not included in your search [details]"
- result.searchTime = 0.000001
-
- # For Mono, we have to clone objects if they're referenced by more than one place, otherwise
- # the Ruby SOAP collapses them into one instance and uses references all over the
- # place, confusing Mono.
- #
- # This has recently been fixed:
- # http://bugzilla.ximian.com/show_bug.cgi?id=72265
- result.directoryCategories = [
- category("Web Development", "UTF-8"),
- category("Programming", "US-ASCII"),
- ]
-
- result
- end
-
- private
- def category(name, encoding)
- cat = DirectoryCategory.new
- cat.fullViewableName = name.dup
- cat.specialEncoding = encoding.dup
- cat
- end
-end
diff --git a/vendor/rails/actionwebservice/examples/googlesearch/delegated/google_search_service.rb b/vendor/rails/actionwebservice/examples/googlesearch/delegated/google_search_service.rb
deleted file mode 100644
index ade354d8..00000000
--- a/vendor/rails/actionwebservice/examples/googlesearch/delegated/google_search_service.rb
+++ /dev/null
@@ -1,108 +0,0 @@
-class DirectoryCategory < ActionWebService::Struct
- member :fullViewableName, :string
- member :specialEncoding, :string
-end
-
-class ResultElement < ActionWebService::Struct
- member :summary, :string
- member :URL, :string
- member :snippet, :string
- member :title, :string
- member :cachedSize, :string
- member :relatedInformationPresent, :bool
- member :hostName, :string
- member :directoryCategory, DirectoryCategory
- member :directoryTitle, :string
-end
-
-class GoogleSearchResult < ActionWebService::Struct
- member :documentFiltering, :bool
- member :searchComments, :string
- member :estimatedTotalResultsCount, :int
- member :estimateIsExact, :bool
- member :resultElements, [ResultElement]
- member :searchQuery, :string
- member :startIndex, :int
- member :endIndex, :int
- member :searchTips, :string
- member :directoryCategories, [DirectoryCategory]
- member :searchTime, :float
-end
-
-class GoogleSearchAPI < ActionWebService::API::Base
- inflect_names false
-
- api_method :doGetCachedPage, :returns => [:string], :expects => [{:key=>:string}, {:url=>:string}]
- api_method :doGetSpellingSuggestion, :returns => [:string], :expects => [{:key=>:string}, {:phrase=>:string}]
-
- api_method :doGoogleSearch, :returns => [GoogleSearchResult], :expects => [
- {:key=>:string},
- {:q=>:string},
- {:start=>:int},
- {:maxResults=>:int},
- {:filter=>:bool},
- {:restrict=>:string},
- {:safeSearch=>:bool},
- {:lr=>:string},
- {:ie=>:string},
- {:oe=>:string}
- ]
-end
-
-class GoogleSearchService < ActionWebService::Base
- web_service_api GoogleSearchAPI
-
- def doGetCachedPage(key, url)
- "i am a cached page"
- end
-
- def doSpellingSuggestion(key, phrase)
- "Did you mean 'teh'?"
- end
-
- def doGoogleSearch(key, q, start, maxResults, filter, restrict, safeSearch, lr, ie, oe)
- resultElement = ResultElement.new
- resultElement.summary = "ONlamp.com: Rolling with Ruby on Rails"
- resultElement.URL = "http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html"
- resultElement.snippet = "Curt Hibbs shows off Ruby on Rails by building a simple application that requires " +
- "almost no Ruby experience. ... Rolling with Ruby on Rails. ..."
- resultElement.title = "Teh Railz0r"
- resultElement.cachedSize = "Almost no lines of code!"
- resultElement.relatedInformationPresent = true
- resultElement.hostName = "rubyonrails.com"
- resultElement.directoryCategory = category("Web Development", "UTF-8")
-
- result = GoogleSearchResult.new
- result.documentFiltering = filter
- result.searchComments = ""
- result.estimatedTotalResultsCount = 322000
- result.estimateIsExact = false
- result.resultElements = [resultElement]
- result.searchQuery = "http://www.google.com/search?q=ruby+on+rails"
- result.startIndex = start
- result.endIndex = start + maxResults
- result.searchTips = "\"on\" is a very common word and was not included in your search [details]"
- result.searchTime = 0.000001
-
- # For Mono, we have to clone objects if they're referenced by more than one place, otherwise
- # the Ruby SOAP collapses them into one instance and uses references all over the
- # place, confusing Mono.
- #
- # This has recently been fixed:
- # http://bugzilla.ximian.com/show_bug.cgi?id=72265
- result.directoryCategories = [
- category("Web Development", "UTF-8"),
- category("Programming", "US-ASCII"),
- ]
-
- result
- end
-
- private
- def category(name, encoding)
- cat = DirectoryCategory.new
- cat.fullViewableName = name.dup
- cat.specialEncoding = encoding.dup
- cat
- end
-end
diff --git a/vendor/rails/actionwebservice/examples/googlesearch/delegated/search_controller.rb b/vendor/rails/actionwebservice/examples/googlesearch/delegated/search_controller.rb
deleted file mode 100644
index 6525921b..00000000
--- a/vendor/rails/actionwebservice/examples/googlesearch/delegated/search_controller.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require 'google_search_service'
-
-class SearchController < ApplicationController
- wsdl_service_name 'GoogleSearch'
- web_service_dispatching_mode :delegated
- web_service :beta3, GoogleSearchService.new
-end
diff --git a/vendor/rails/actionwebservice/examples/googlesearch/direct/google_search_api.rb b/vendor/rails/actionwebservice/examples/googlesearch/direct/google_search_api.rb
deleted file mode 100644
index ed69fed7..00000000
--- a/vendor/rails/actionwebservice/examples/googlesearch/direct/google_search_api.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-class DirectoryCategory < ActionWebService::Struct
- member :fullViewableName, :string
- member :specialEncoding, :string
-end
-
-class ResultElement < ActionWebService::Struct
- member :summary, :string
- member :URL, :string
- member :snippet, :string
- member :title, :string
- member :cachedSize, :string
- member :relatedInformationPresent, :bool
- member :hostName, :string
- member :directoryCategory, DirectoryCategory
- member :directoryTitle, :string
-end
-
-class GoogleSearchResult < ActionWebService::Struct
- member :documentFiltering, :bool
- member :searchComments, :string
- member :estimatedTotalResultsCount, :int
- member :estimateIsExact, :bool
- member :resultElements, [ResultElement]
- member :searchQuery, :string
- member :startIndex, :int
- member :endIndex, :int
- member :searchTips, :string
- member :directoryCategories, [DirectoryCategory]
- member :searchTime, :float
-end
-
-class GoogleSearchAPI < ActionWebService::API::Base
- inflect_names false
-
- api_method :doGetCachedPage, :returns => [:string], :expects => [{:key=>:string}, {:url=>:string}]
- api_method :doGetSpellingSuggestion, :returns => [:string], :expects => [{:key=>:string}, {:phrase=>:string}]
-
- api_method :doGoogleSearch, :returns => [GoogleSearchResult], :expects => [
- {:key=>:string},
- {:q=>:string},
- {:start=>:int},
- {:maxResults=>:int},
- {:filter=>:bool},
- {:restrict=>:string},
- {:safeSearch=>:bool},
- {:lr=>:string},
- {:ie=>:string},
- {:oe=>:string}
- ]
-end
diff --git a/vendor/rails/actionwebservice/examples/googlesearch/direct/search_controller.rb b/vendor/rails/actionwebservice/examples/googlesearch/direct/search_controller.rb
deleted file mode 100644
index 7c69f022..00000000
--- a/vendor/rails/actionwebservice/examples/googlesearch/direct/search_controller.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-class SearchController < ApplicationController
- web_service_api :google_search
- wsdl_service_name 'GoogleSearch'
-
- def doGetCachedPage
- "i am a cached page. my key was %s, url was %s" % [@params['key'], @params['url']]
- end
-
- def doSpellingSuggestion
- "%s: Did you mean '%s'?" % [@params['key'], @params['phrase']]
- end
-
- def doGoogleSearch
- resultElement = ResultElement.new
- resultElement.summary = "ONlamp.com: Rolling with Ruby on Rails"
- resultElement.URL = "http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html"
- resultElement.snippet = "Curt Hibbs shows off Ruby on Rails by building a simple application that requires " +
- "almost no Ruby experience. ... Rolling with Ruby on Rails. ..."
- resultElement.title = "Teh Railz0r"
- resultElement.cachedSize = "Almost no lines of code!"
- resultElement.relatedInformationPresent = true
- resultElement.hostName = "rubyonrails.com"
- resultElement.directoryCategory = category("Web Development", "UTF-8")
-
- result = GoogleSearchResult.new
- result.documentFiltering = @params['filter']
- result.searchComments = ""
- result.estimatedTotalResultsCount = 322000
- result.estimateIsExact = false
- result.resultElements = [resultElement]
- result.searchQuery = "http://www.google.com/search?q=ruby+on+rails"
- result.startIndex = @params['start']
- result.endIndex = @params['start'] + @params['maxResults']
- result.searchTips = "\"on\" is a very common word and was not included in your search [details]"
- result.searchTime = 0.000001
-
- # For Mono, we have to clone objects if they're referenced by more than one place, otherwise
- # the Ruby SOAP collapses them into one instance and uses references all over the
- # place, confusing Mono.
- #
- # This has recently been fixed:
- # http://bugzilla.ximian.com/show_bug.cgi?id=72265
- result.directoryCategories = [
- category("Web Development", "UTF-8"),
- category("Programming", "US-ASCII"),
- ]
-
- result
- end
-
- private
- def category(name, encoding)
- cat = DirectoryCategory.new
- cat.fullViewableName = name.dup
- cat.specialEncoding = encoding.dup
- cat
- end
-end
diff --git a/vendor/rails/actionwebservice/examples/metaWeblog/README b/vendor/rails/actionwebservice/examples/metaWeblog/README
deleted file mode 100644
index f66f5677..00000000
--- a/vendor/rails/actionwebservice/examples/metaWeblog/README
+++ /dev/null
@@ -1,17 +0,0 @@
-= metaWeblog example
-
-This example shows how one might begin to go about adding metaWeblog
-(http://www.xmlrpc.com/metaWeblogApi) API support to a Rails-based
-blogging application.
-
-The example APIs are more verbose than you may want to make them, for documentation
-reasons.
-
-= Running
-
- 1. Copy the "apis" directory and its files into "app" in a Rails project.
-
- 2. Copy the "controllers" directory and its files into "app" in a Rails project
-
- 3. Fire up a desktop blogging application (such as w.bloggar, MarsEdit, or BloGTK),
- point it at http://localhost:3000/xmlrpc/api, and try creating or editing blog posts.
diff --git a/vendor/rails/actionwebservice/examples/metaWeblog/apis/blogger_api.rb b/vendor/rails/actionwebservice/examples/metaWeblog/apis/blogger_api.rb
deleted file mode 100644
index 9f85a239..00000000
--- a/vendor/rails/actionwebservice/examples/metaWeblog/apis/blogger_api.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# see the blogger API spec at http://www.blogger.com/developers/api/1_docs/
-# note that the method signatures are subtly different to metaWeblog, they
-# are not identical. take care to ensure you handle the different semantics
-# properly if you want to support blogger API too, to get maximum compatibility.
-#
-
-module Blog
- class Blog < ActionWebService::Struct
- member :url, :string
- member :blogid, :string
- member :blogName, :string
- end
-
- class User < ActionWebService::Struct
- member :nickname, :string
- member :userid, :string
- member :url, :string
- member :email, :string
- member :lastname, :string
- member :firstname, :string
- end
-end
-
-#
-# blogger
-#
-class BloggerAPI < ActionWebService::API::Base
- inflect_names false
-
- api_method :newPost, :returns => [:string], :expects => [
- {:appkey=>:string},
- {:blogid=>:string},
- {:username=>:string},
- {:password=>:string},
- {:content=>:string},
- {:publish=>:bool}
- ]
-
- api_method :editPost, :returns => [:bool], :expects => [
- {:appkey=>:string},
- {:postid=>:string},
- {:username=>:string},
- {:password=>:string},
- {:content=>:string},
- {:publish=>:bool}
- ]
-
- api_method :getUsersBlogs, :returns => [[Blog::Blog]], :expects => [
- {:appkey=>:string},
- {:username=>:string},
- {:password=>:string}
- ]
-
- api_method :getUserInfo, :returns => [Blog::User], :expects => [
- {:appkey=>:string},
- {:username=>:string},
- {:password=>:string}
- ]
-end
diff --git a/vendor/rails/actionwebservice/examples/metaWeblog/apis/blogger_service.rb b/vendor/rails/actionwebservice/examples/metaWeblog/apis/blogger_service.rb
deleted file mode 100644
index b79b53e6..00000000
--- a/vendor/rails/actionwebservice/examples/metaWeblog/apis/blogger_service.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-require 'blogger_api'
-
-class BloggerService < ActionWebService::Base
- web_service_api BloggerAPI
-
- def initialize
- @postid = 0
- end
-
- def newPost(key, id, user, pw, content, publish)
- $stderr.puts "id=#{id} user=#{user} pw=#{pw}, content=#{content.inspect} [#{publish}]"
- (@postid += 1).to_s
- end
-
- def editPost(key, post_id, user, pw, content, publish)
- $stderr.puts "id=#{post_id} user=#{user} pw=#{pw} content=#{content.inspect} [#{publish}]"
- true
- end
-
- def getUsersBlogs(key, user, pw)
- $stderr.puts "getting blogs for #{user}"
- blog = Blog::Blog.new(
- :url =>'http://blog',
- :blogid => 'myblog',
- :blogName => 'My Blog'
- )
- [blog]
- end
-
- def getUserInfo(key, user, pw)
- $stderr.puts "getting user info for #{user}"
- Blog::User.new(:nickname => 'user', :email => 'user@test.com')
- end
-end
diff --git a/vendor/rails/actionwebservice/examples/metaWeblog/apis/meta_weblog_api.rb b/vendor/rails/actionwebservice/examples/metaWeblog/apis/meta_weblog_api.rb
deleted file mode 100644
index adef12a2..00000000
--- a/vendor/rails/actionwebservice/examples/metaWeblog/apis/meta_weblog_api.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-#
-# here lie structures, cousins of those on http://www.xmlrpc.com/metaWeblog
-# but they don't necessarily the real world reflect
-# so if you do, find that your client complains:
-# please tell, of problems you suffered through
-#
-
-module Blog
- class Post < ActionWebService::Struct
- member :title, :string
- member :link, :string
- member :description, :string
- member :author, :string
- member :category, :string
- member :comments, :string
- member :guid, :string
- member :pubDate, :string
- end
-
- class Category < ActionWebService::Struct
- member :description, :string
- member :htmlUrl, :string
- member :rssUrl, :string
- end
-end
-
-#
-# metaWeblog
-#
-class MetaWeblogAPI < ActionWebService::API::Base
- inflect_names false
-
- api_method :newPost, :returns => [:string], :expects => [
- {:blogid=>:string},
- {:username=>:string},
- {:password=>:string},
- {:struct=>Blog::Post},
- {:publish=>:bool}
- ]
-
- api_method :editPost, :returns => [:bool], :expects => [
- {:postid=>:string},
- {:username=>:string},
- {:password=>:string},
- {:struct=>Blog::Post},
- {:publish=>:bool},
- ]
-
- api_method :getPost, :returns => [Blog::Post], :expects => [
- {:postid=>:string},
- {:username=>:string},
- {:password=>:string},
- ]
-
- api_method :getCategories, :returns => [[Blog::Category]], :expects => [
- {:blogid=>:string},
- {:username=>:string},
- {:password=>:string},
- ]
-
- api_method :getRecentPosts, :returns => [[Blog::Post]], :expects => [
- {:blogid=>:string},
- {:username=>:string},
- {:password=>:string},
- {:numberOfPosts=>:int},
- ]
-end
diff --git a/vendor/rails/actionwebservice/examples/metaWeblog/apis/meta_weblog_service.rb b/vendor/rails/actionwebservice/examples/metaWeblog/apis/meta_weblog_service.rb
deleted file mode 100644
index 9c66558f..00000000
--- a/vendor/rails/actionwebservice/examples/metaWeblog/apis/meta_weblog_service.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-require 'meta_weblog_api'
-
-class MetaWeblogService < ActionWebService::Base
- web_service_api MetaWeblogAPI
-
- def initialize
- @postid = 0
- end
-
- def newPost(id, user, pw, struct, publish)
- $stderr.puts "id=#{id} user=#{user} pw=#{pw}, struct=#{struct.inspect} [#{publish}]"
- (@postid += 1).to_s
- end
-
- def editPost(post_id, user, pw, struct, publish)
- $stderr.puts "id=#{post_id} user=#{user} pw=#{pw} struct=#{struct.inspect} [#{publish}]"
- true
- end
-
- def getPost(post_id, user, pw)
- $stderr.puts "get post #{post_id}"
- Blog::Post.new(:title => 'hello world', :description => 'first post!')
- end
-
- def getCategories(id, user, pw)
- $stderr.puts "categories for #{user}"
- cat = Blog::Category.new(
- :description => 'Tech',
- :htmlUrl => 'http://blog/tech',
- :rssUrl => 'http://blog/tech.rss')
- [cat]
- end
-
- def getRecentPosts(id, user, pw, num)
- $stderr.puts "recent #{num} posts for #{user} on blog #{id}"
- post1 = Blog::Post.new(
- :title => 'first post!',
- :link => 'http://blog.xeraph.org/testOne.html',
- :description => 'this is the first post'
- )
- post2 = Blog::Post.new(
- :title => 'second post!',
- :link => 'http://blog.xeraph.org/testTwo.html',
- :description => 'this is the second post'
- )
- [post1, post2]
- end
-end
diff --git a/vendor/rails/actionwebservice/examples/metaWeblog/controllers/xmlrpc_controller.rb b/vendor/rails/actionwebservice/examples/metaWeblog/controllers/xmlrpc_controller.rb
deleted file mode 100644
index 7486402d..00000000
--- a/vendor/rails/actionwebservice/examples/metaWeblog/controllers/xmlrpc_controller.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# example controller implementing both blogger and metaWeblog APIs
-# in a way that should be compatible with clients supporting both/either.
-#
-# test by pointing your client at http://URL/xmlrpc/api
-#
-
-require 'meta_weblog_service'
-require 'blogger_service'
-
-class XmlrpcController < ApplicationController
- web_service_dispatching_mode :layered
-
- web_service :metaWeblog, MetaWeblogService.new
- web_service :blogger, BloggerService.new
-end
diff --git a/vendor/rails/actionwebservice/install.rb b/vendor/rails/actionwebservice/install.rb
deleted file mode 100644
index da08bf5f..00000000
--- a/vendor/rails/actionwebservice/install.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-require 'rbconfig'
-require 'find'
-require 'ftools'
-
-include Config
-
-# this was adapted from rdoc's install.rb by way of Log4r
-
-$sitedir = CONFIG["sitelibdir"]
-unless $sitedir
- version = CONFIG["MAJOR"] + "." + CONFIG["MINOR"]
- $libdir = File.join(CONFIG["libdir"], "ruby", version)
- $sitedir = $:.find {|x| x =~ /site_ruby/ }
- if !$sitedir
- $sitedir = File.join($libdir, "site_ruby")
- elsif $sitedir !~ Regexp.quote(version)
- $sitedir = File.join($sitedir, version)
- end
-end
-
-# the actual gruntwork
-Dir.chdir("lib")
-
-Find.find("action_web_service", "action_web_service.rb") { |f|
- if f[-3..-1] == ".rb"
- File::install(f, File.join($sitedir, *f.split(/\//)), 0644, true)
- else
- File::makedirs(File.join($sitedir, *f.split(/\//)))
- end
-}
diff --git a/vendor/rails/actionwebservice/lib/action_web_service.rb b/vendor/rails/actionwebservice/lib/action_web_service.rb
deleted file mode 100644
index 0632dd1e..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-#--
-# Copyright (C) 2005 Leon Breedt
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#++
-
-begin
- require 'active_support'
- require 'action_controller'
- require 'active_record'
-rescue LoadError
- require 'rubygems'
- gem 'activesupport', '>= 1.0.2'
- gem 'actionpack', '>= 1.6.0'
- gem 'activerecord', '>= 1.9.0'
-end
-
-$:.unshift(File.dirname(__FILE__) + "/action_web_service/vendor/")
-
-require 'action_web_service/support/class_inheritable_options'
-require 'action_web_service/support/signature_types'
-require 'action_web_service/base'
-require 'action_web_service/client'
-require 'action_web_service/invocation'
-require 'action_web_service/api'
-require 'action_web_service/casting'
-require 'action_web_service/struct'
-require 'action_web_service/container'
-require 'action_web_service/protocol'
-require 'action_web_service/dispatcher'
-require 'action_web_service/scaffolding'
-
-ActionWebService::Base.class_eval do
- include ActionWebService::Container::Direct
- include ActionWebService::Invocation
-end
-
-ActionController::Base.class_eval do
- include ActionWebService::Protocol::Discovery
- include ActionWebService::Protocol::Soap
- include ActionWebService::Protocol::XmlRpc
- include ActionWebService::Container::Direct
- include ActionWebService::Container::Delegated
- include ActionWebService::Container::ActionController
- include ActionWebService::Invocation
- include ActionWebService::Dispatcher
- include ActionWebService::Dispatcher::ActionController
- include ActionWebService::Scaffolding
-end
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/api.rb b/vendor/rails/actionwebservice/lib/action_web_service/api.rb
deleted file mode 100644
index d16dc420..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/api.rb
+++ /dev/null
@@ -1,297 +0,0 @@
-module ActionWebService # :nodoc:
- module API # :nodoc:
- # A web service API class specifies the methods that will be available for
- # invocation for an API. It also contains metadata such as the method type
- # signature hints.
- #
- # It is not intended to be instantiated.
- #
- # It is attached to web service implementation classes like
- # ActionWebService::Base and ActionController::Base derivatives by using
- # container.web_service_api, where container is an
- # ActionController::Base or a ActionWebService::Base.
- #
- # See ActionWebService::Container::Direct::ClassMethods for an example
- # of use.
- class Base
- # Whether to transform the public API method names into camel-cased names
- class_inheritable_option :inflect_names, true
-
- # By default only HTTP POST requests are processed
- class_inheritable_option :allowed_http_methods, [ :post ]
-
- # Whether to allow ActiveRecord::Base models in :expects.
- # The default is +false+; you should be aware of the security implications
- # of allowing this, and ensure that you don't allow remote callers to
- # easily overwrite data they should not have access to.
- class_inheritable_option :allow_active_record_expects, false
-
- # If present, the name of a method to call when the remote caller
- # tried to call a nonexistent method. Semantically equivalent to
- # +method_missing+.
- class_inheritable_option :default_api_method
-
- # Disallow instantiation
- private_class_method :new, :allocate
-
- class << self
- include ActionWebService::SignatureTypes
-
- # API methods have a +name+, which must be the Ruby method name to use when
- # performing the invocation on the web service object.
- #
- # The signatures for the method input parameters and return value can
- # by specified in +options+.
- #
- # A signature is an array of one or more parameter specifiers.
- # A parameter specifier can be one of the following:
- #
- # * A symbol or string representing one of the Action Web Service base types.
- # See ActionWebService::SignatureTypes for a canonical list of the base types.
- # * The Class object of the parameter type
- # * A single-element Array containing one of the two preceding items. This
- # will cause Action Web Service to treat the parameter at that position
- # as an array containing only values of the given type.
- # * A Hash containing as key the name of the parameter, and as value
- # one of the three preceding items
- #
- # If no method input parameter or method return value signatures are given,
- # the method is assumed to take no parameters and/or return no values of
- # interest, and any values that are received by the server will be
- # discarded and ignored.
- #
- # Valid options:
- # [:expects] Signature for the method input parameters
- # [:returns] Signature for the method return value
- # [:expects_and_returns] Signature for both input parameters and return value
- def api_method(name, options={})
- unless options.is_a?(Hash)
- raise(ActionWebServiceError, "Expected a Hash for options")
- end
- validate_options([:expects, :returns, :expects_and_returns], options.keys)
- if options[:expects_and_returns]
- expects = options[:expects_and_returns]
- returns = options[:expects_and_returns]
- else
- expects = options[:expects]
- returns = options[:returns]
- end
- expects = canonical_signature(expects)
- returns = canonical_signature(returns)
- if expects
- expects.each do |type|
- type = type.element_type if type.is_a?(ArrayType)
- if type.type_class.ancestors.include?(ActiveRecord::Base) && !allow_active_record_expects
- raise(ActionWebServiceError, "ActiveRecord model classes not allowed in :expects")
- end
- end
- end
- name = name.to_sym
- public_name = public_api_method_name(name)
- method = Method.new(name, public_name, expects, returns)
- write_inheritable_hash("api_methods", name => method)
- write_inheritable_hash("api_public_method_names", public_name => name)
- end
-
- # Whether the given method name is a service method on this API
- #
- # class ProjectsApi < ActionWebService::API::Base
- # api_method :getCount, :returns => [:int]
- # end
- #
- # ProjectsApi.has_api_method?('GetCount') #=> false
- # ProjectsApi.has_api_method?(:getCount) #=> true
- def has_api_method?(name)
- api_methods.has_key?(name)
- end
-
- # Whether the given public method name has a corresponding service method
- # on this API
- #
- # class ProjectsApi < ActionWebService::API::Base
- # api_method :getCount, :returns => [:int]
- # end
- #
- # ProjectsApi.has_api_method?(:getCount) #=> false
- # ProjectsApi.has_api_method?('GetCount') #=> true
- def has_public_api_method?(public_name)
- api_public_method_names.has_key?(public_name)
- end
-
- # The corresponding public method name for the given service method name
- #
- # ProjectsApi.public_api_method_name('GetCount') #=> "GetCount"
- # ProjectsApi.public_api_method_name(:getCount) #=> "GetCount"
- def public_api_method_name(name)
- if inflect_names
- name.to_s.camelize
- else
- name.to_s
- end
- end
-
- # The corresponding service method name for the given public method name
- #
- # class ProjectsApi < ActionWebService::API::Base
- # api_method :getCount, :returns => [:int]
- # end
- #
- # ProjectsApi.api_method_name('GetCount') #=> :getCount
- def api_method_name(public_name)
- api_public_method_names[public_name]
- end
-
- # A Hash containing all service methods on this API, and their
- # associated metadata.
- #
- # class ProjectsApi < ActionWebService::API::Base
- # api_method :getCount, :returns => [:int]
- # api_method :getCompletedCount, :returns => [:int]
- # end
- #
- # ProjectsApi.api_methods #=>
- # {:getCount=>#,
- # :getCompletedCount=>#}
- # ProjectsApi.api_methods[:getCount].public_name #=> "GetCount"
- def api_methods
- read_inheritable_attribute("api_methods") || {}
- end
-
- # The Method instance for the given public API method name, if any
- #
- # class ProjectsApi < ActionWebService::API::Base
- # api_method :getCount, :returns => [:int]
- # api_method :getCompletedCount, :returns => [:int]
- # end
- #
- # ProjectsApi.public_api_method_instance('GetCount') #=> <#
- # ProjectsApi.public_api_method_instance(:getCount) #=> nil
- def public_api_method_instance(public_method_name)
- api_method_instance(api_method_name(public_method_name))
- end
-
- # The Method instance for the given API method name, if any
- #
- # class ProjectsApi < ActionWebService::API::Base
- # api_method :getCount, :returns => [:int]
- # api_method :getCompletedCount, :returns => [:int]
- # end
- #
- # ProjectsApi.api_method_instance(:getCount) #=>
- # ProjectsApi.api_method_instance('GetCount') #=>
- def api_method_instance(method_name)
- api_methods[method_name]
- end
-
- # The Method instance for the default API method, if any
- def default_api_method_instance
- return nil unless name = default_api_method
- instance = read_inheritable_attribute("default_api_method_instance")
- if instance && instance.name == name
- return instance
- end
- instance = Method.new(name, public_api_method_name(name), nil, nil)
- write_inheritable_attribute("default_api_method_instance", instance)
- instance
- end
-
- private
- def api_public_method_names
- read_inheritable_attribute("api_public_method_names") || {}
- end
-
- def validate_options(valid_option_keys, supplied_option_keys)
- unknown_option_keys = supplied_option_keys - valid_option_keys
- unless unknown_option_keys.empty?
- raise(ActionWebServiceError, "Unknown options: #{unknown_option_keys}")
- end
- end
- end
- end
-
- # Represents an API method and its associated metadata, and provides functionality
- # to assist in commonly performed API method tasks.
- class Method
- attr :name
- attr :public_name
- attr :expects
- attr :returns
-
- def initialize(name, public_name, expects, returns)
- @name = name
- @public_name = public_name
- @expects = expects
- @returns = returns
- @caster = ActionWebService::Casting::BaseCaster.new(self)
- end
-
- # The list of parameter names for this method
- def param_names
- return [] unless @expects
- @expects.map{ |type| type.name }
- end
-
- # Casts a set of Ruby values into the expected Ruby values
- def cast_expects(params)
- @caster.cast_expects(params)
- end
-
- # Cast a Ruby return value into the expected Ruby value
- def cast_returns(return_value)
- @caster.cast_returns(return_value)
- end
-
- # Returns the index of the first expected parameter
- # with the given name
- def expects_index_of(param_name)
- return -1 if @expects.nil?
- (0..(@expects.length-1)).each do |i|
- return i if @expects[i].name.to_s == param_name.to_s
- end
- -1
- end
-
- # Returns a hash keyed by parameter name for the given
- # parameter list
- def expects_to_hash(params)
- return {} if @expects.nil?
- h = {}
- @expects.zip(params){ |type, param| h[type.name] = param }
- h
- end
-
- # Backwards compatibility with previous API
- def [](sig_type)
- case sig_type
- when :expects
- @expects.map{|x| compat_signature_entry(x)}
- when :returns
- @returns.map{|x| compat_signature_entry(x)}
- end
- end
-
- # String representation of this method
- def to_s
- fqn = ""
- fqn << (@returns ? (@returns[0].human_name(false) + " ") : "void ")
- fqn << "#{@public_name}("
- fqn << @expects.map{ |p| p.human_name }.join(", ") if @expects
- fqn << ")"
- fqn
- end
-
- private
- def compat_signature_entry(entry)
- if entry.array?
- [compat_signature_entry(entry.element_type)]
- else
- if entry.spec.is_a?(Hash)
- {entry.spec.keys.first => entry.type_class}
- else
- entry.type_class
- end
- end
- end
- end
- end
-end
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/base.rb b/vendor/rails/actionwebservice/lib/action_web_service/base.rb
deleted file mode 100644
index 6282061d..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/base.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-module ActionWebService # :nodoc:
- class ActionWebServiceError < StandardError # :nodoc:
- end
-
- # An Action Web Service object implements a specified API.
- #
- # Used by controllers operating in _Delegated_ dispatching mode.
- #
- # ==== Example
- #
- # class PersonService < ActionWebService::Base
- # web_service_api PersonAPI
- #
- # def find_person(criteria)
- # Person.find(:all) [...]
- # end
- #
- # def delete_person(id)
- # Person.find_by_id(id).destroy
- # end
- # end
- #
- # class PersonAPI < ActionWebService::API::Base
- # api_method :find_person, :expects => [SearchCriteria], :returns => [[Person]]
- # api_method :delete_person, :expects => [:int]
- # end
- #
- # class SearchCriteria < ActionWebService::Struct
- # member :firstname, :string
- # member :lastname, :string
- # member :email, :string
- # end
- class Base
- # Whether to report exceptions back to the caller in the protocol's exception
- # format
- class_inheritable_option :web_service_exception_reporting, true
- end
-end
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/casting.rb b/vendor/rails/actionwebservice/lib/action_web_service/casting.rb
deleted file mode 100644
index 71f422ea..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/casting.rb
+++ /dev/null
@@ -1,138 +0,0 @@
-require 'time'
-require 'date'
-require 'xmlrpc/datetime'
-
-module ActionWebService # :nodoc:
- module Casting # :nodoc:
- class CastingError < ActionWebServiceError # :nodoc:
- end
-
- # Performs casting of arbitrary values into the correct types for the signature
- class BaseCaster # :nodoc:
- def initialize(api_method)
- @api_method = api_method
- end
-
- # Coerces the parameters in +params+ (an Enumerable) into the types
- # this method expects
- def cast_expects(params)
- self.class.cast_expects(@api_method, params)
- end
-
- # Coerces the given +return_value+ into the type returned by this
- # method
- def cast_returns(return_value)
- self.class.cast_returns(@api_method, return_value)
- end
-
- class << self
- include ActionWebService::SignatureTypes
-
- def cast_expects(api_method, params) # :nodoc:
- return [] if api_method.expects.nil?
- api_method.expects.zip(params).map{ |type, param| cast(param, type) }
- end
-
- def cast_returns(api_method, return_value) # :nodoc:
- return nil if api_method.returns.nil?
- cast(return_value, api_method.returns[0])
- end
-
- def cast(value, signature_type) # :nodoc:
- return value if signature_type.nil? # signature.length != params.length
- return nil if value.nil?
- # XMLRPC protocol doesn't support nil values. It uses false instead.
- # It should never happen for SOAP.
- if signature_type.structured? && value.equal?(false)
- return nil
- end
- unless signature_type.array? || signature_type.structured?
- return value if canonical_type(value.class) == signature_type.type
- end
- if signature_type.array?
- unless value.respond_to?(:entries) && !value.is_a?(String)
- raise CastingError, "Don't know how to cast #{value.class} into #{signature_type.type.inspect}"
- end
- value.entries.map do |entry|
- cast(entry, signature_type.element_type)
- end
- elsif signature_type.structured?
- cast_to_structured_type(value, signature_type)
- elsif !signature_type.custom?
- cast_base_type(value, signature_type)
- end
- end
-
- def cast_base_type(value, signature_type) # :nodoc:
- # This is a work-around for the fact that XML-RPC special-cases DateTime values into its own DateTime type
- # in order to support iso8601 dates. This doesn't work too well for us, so we'll convert it into a Time,
- # with the caveat that we won't be able to handle pre-1970 dates that are sent to us.
- #
- # See http://dev.rubyonrails.com/ticket/2516
- value = value.to_time if value.is_a?(XMLRPC::DateTime)
-
- case signature_type.type
- when :int
- Integer(value)
- when :string
- value.to_s
- when :base64
- if value.is_a?(ActionWebService::Base64)
- value
- else
- ActionWebService::Base64.new(value.to_s)
- end
- when :bool
- return false if value.nil?
- return value if value == true || value == false
- case value.to_s.downcase
- when '1', 'true', 'y', 'yes'
- true
- when '0', 'false', 'n', 'no'
- false
- else
- raise CastingError, "Don't know how to cast #{value.class} into Boolean"
- end
- when :float
- Float(value)
- when :decimal
- BigDecimal(value.to_s)
- when :time
- value = "%s/%s/%s %s:%s:%s" % value.values_at(*%w[2 3 1 4 5 6]) if value.kind_of?(Hash)
- value.kind_of?(Time) ? value : Time.parse(value.to_s)
- when :date
- value = "%s/%s/%s" % value.values_at(*%w[2 3 1]) if value.kind_of?(Hash)
- value.kind_of?(Date) ? value : Date.parse(value.to_s)
- when :datetime
- value = "%s/%s/%s %s:%s:%s" % value.values_at(*%w[2 3 1 4 5 6]) if value.kind_of?(Hash)
- value.kind_of?(DateTime) ? value : DateTime.parse(value.to_s)
- end
- end
-
- def cast_to_structured_type(value, signature_type) # :nodoc:
- obj = nil
- obj = value if canonical_type(value.class) == canonical_type(signature_type.type)
- obj ||= signature_type.type_class.new
- if value.respond_to?(:each_pair)
- klass = signature_type.type_class
- value.each_pair do |name, val|
- type = klass.respond_to?(:member_type) ? klass.member_type(name) : nil
- val = cast(val, type) if type
- # See http://dev.rubyonrails.com/ticket/3567
- val = val.to_time if val.is_a?(XMLRPC::DateTime)
- obj.__send__("#{name}=", val) if obj.respond_to?(name)
- end
- elsif value.respond_to?(:attributes)
- signature_type.each_member do |name, type|
- val = value.__send__(name)
- obj.__send__("#{name}=", cast(val, type)) if obj.respond_to?(name)
- end
- else
- raise CastingError, "Don't know how to cast #{value.class} to #{signature_type.type_class}"
- end
- obj
- end
- end
- end
- end
-end
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/client.rb b/vendor/rails/actionwebservice/lib/action_web_service/client.rb
deleted file mode 100644
index 2a1e3305..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/client.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-require 'action_web_service/client/base'
-require 'action_web_service/client/soap_client'
-require 'action_web_service/client/xmlrpc_client'
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/client/base.rb b/vendor/rails/actionwebservice/lib/action_web_service/client/base.rb
deleted file mode 100644
index 9dada7bf..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/client/base.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-module ActionWebService # :nodoc:
- module Client # :nodoc:
- class ClientError < StandardError # :nodoc:
- end
-
- class Base # :nodoc:
- def initialize(api, endpoint_uri)
- @api = api
- @endpoint_uri = endpoint_uri
- end
-
- def method_missing(name, *args) # :nodoc:
- call_name = method_name(name)
- return super(name, *args) if call_name.nil?
- self.perform_invocation(call_name, args)
- end
-
- private
- def method_name(name)
- if @api.has_api_method?(name.to_sym)
- name.to_s
- elsif @api.has_public_api_method?(name.to_s)
- @api.api_method_name(name.to_s).to_s
- end
- end
- end
- end
-end
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/client/soap_client.rb b/vendor/rails/actionwebservice/lib/action_web_service/client/soap_client.rb
deleted file mode 100644
index ebabd8ea..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/client/soap_client.rb
+++ /dev/null
@@ -1,113 +0,0 @@
-require 'soap/rpc/driver'
-require 'uri'
-
-module ActionWebService # :nodoc:
- module Client # :nodoc:
-
- # Implements SOAP client support (using RPC encoding for the messages).
- #
- # ==== Example Usage
- #
- # class PersonAPI < ActionWebService::API::Base
- # api_method :find_all, :returns => [[Person]]
- # end
- #
- # soap_client = ActionWebService::Client::Soap.new(PersonAPI, "http://...")
- # persons = soap_client.find_all
- #
- class Soap < Base
- # provides access to the underlying soap driver
- attr_reader :driver
-
- # Creates a new web service client using the SOAP RPC protocol.
- #
- # +api+ must be an ActionWebService::API::Base derivative, and
- # +endpoint_uri+ must point at the relevant URL to which protocol requests
- # will be sent with HTTP POST.
- #
- # Valid options:
- # [:namespace] If the remote server has used a custom namespace to
- # declare its custom types, you can specify it here. This would
- # be the namespace declared with a [WebService(Namespace = "http://namespace")] attribute
- # in .NET, for example.
- # [:driver_options] If you want to supply any custom SOAP RPC driver
- # options, you can provide them as a Hash here
- #
- # The :driver_options option can be used to configure the backend SOAP
- # RPC driver. An example of configuring the SOAP backend to do
- # client-certificate authenticated SSL connections to the server:
- #
- # opts = {}
- # opts['protocol.http.ssl_config.verify_mode'] = 'OpenSSL::SSL::VERIFY_PEER'
- # opts['protocol.http.ssl_config.client_cert'] = client_cert_file_path
- # opts['protocol.http.ssl_config.client_key'] = client_key_file_path
- # opts['protocol.http.ssl_config.ca_file'] = ca_cert_file_path
- # client = ActionWebService::Client::Soap.new(api, 'https://some/service', :driver_options => opts)
- def initialize(api, endpoint_uri, options={})
- super(api, endpoint_uri)
- @namespace = options[:namespace] || 'urn:ActionWebService'
- @driver_options = options[:driver_options] || {}
- @protocol = ActionWebService::Protocol::Soap::SoapProtocol.new @namespace
- @soap_action_base = options[:soap_action_base]
- @soap_action_base ||= URI.parse(endpoint_uri).path
- @driver = create_soap_rpc_driver(api, endpoint_uri)
- @driver_options.each do |name, value|
- @driver.options[name.to_s] = value
- end
- end
-
- protected
- def perform_invocation(method_name, args)
- method = @api.api_methods[method_name.to_sym]
- args = method.cast_expects(args.dup) rescue args
- return_value = @driver.send(method_name, *args)
- method.cast_returns(return_value.dup) rescue return_value
- end
-
- def soap_action(method_name)
- "#{@soap_action_base}/#{method_name}"
- end
-
- private
- def create_soap_rpc_driver(api, endpoint_uri)
- @protocol.register_api(api)
- driver = SoapDriver.new(endpoint_uri, nil)
- driver.mapping_registry = @protocol.marshaler.registry
- api.api_methods.each do |name, method|
- qname = XSD::QName.new(@namespace, method.public_name)
- action = soap_action(method.public_name)
- expects = method.expects
- returns = method.returns
- param_def = []
- if expects
- expects.each do |type|
- type_binding = @protocol.marshaler.lookup_type(type)
- if SOAP::Version >= "1.5.5"
- param_def << ['in', type.name.to_s, [type_binding.type.type_class.to_s]]
- else
- param_def << ['in', type.name, type_binding.mapping]
- end
- end
- end
- if returns
- type_binding = @protocol.marshaler.lookup_type(returns[0])
- if SOAP::Version >= "1.5.5"
- param_def << ['retval', 'return', [type_binding.type.type_class.to_s]]
- else
- param_def << ['retval', 'return', type_binding.mapping]
- end
- end
- driver.add_method(qname, action, method.name.to_s, param_def)
- end
- driver
- end
-
- class SoapDriver < SOAP::RPC::Driver # :nodoc:
- def add_method(qname, soapaction, name, param_def)
- @proxy.add_rpc_method(qname, soapaction, name, param_def)
- add_rpc_method_interface(name, param_def)
- end
- end
- end
- end
-end
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/client/xmlrpc_client.rb b/vendor/rails/actionwebservice/lib/action_web_service/client/xmlrpc_client.rb
deleted file mode 100644
index 42b5c5d4..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/client/xmlrpc_client.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-require 'uri'
-require 'xmlrpc/client'
-
-module ActionWebService # :nodoc:
- module Client # :nodoc:
-
- # Implements XML-RPC client support
- #
- # ==== Example Usage
- #
- # class BloggerAPI < ActionWebService::API::Base
- # inflect_names false
- # api_method :getRecentPosts, :returns => [[Blog::Post]]
- # end
- #
- # blog = ActionWebService::Client::XmlRpc.new(BloggerAPI, "http://.../RPC", :handler_name => "blogger")
- # posts = blog.getRecentPosts
- class XmlRpc < Base
-
- # Creates a new web service client using the XML-RPC protocol.
- #
- # +api+ must be an ActionWebService::API::Base derivative, and
- # +endpoint_uri+ must point at the relevant URL to which protocol requests
- # will be sent with HTTP POST.
- #
- # Valid options:
- # [:handler_name] If the remote server defines its services inside special
- # handler (the Blogger API uses a "blogger" handler name for example),
- # provide it here, or your method calls will fail
- def initialize(api, endpoint_uri, options={})
- @api = api
- @handler_name = options[:handler_name]
- @protocol = ActionWebService::Protocol::XmlRpc::XmlRpcProtocol.new
- @client = XMLRPC::Client.new2(endpoint_uri, options[:proxy], options[:timeout])
- end
-
- protected
- def perform_invocation(method_name, args)
- method = @api.api_methods[method_name.to_sym]
- if method.expects && method.expects.length != args.length
- raise(ArgumentError, "#{method.public_name}: wrong number of arguments (#{args.length} for #{method.expects.length})")
- end
- args = method.cast_expects(args.dup) rescue args
- if method.expects
- method.expects.each_with_index{ |type, i| args[i] = @protocol.value_to_xmlrpc_wire_format(args[i], type) }
- end
- ok, return_value = @client.call2(public_name(method_name), *args)
- return (method.cast_returns(return_value.dup) rescue return_value) if ok
- raise(ClientError, "#{return_value.faultCode}: #{return_value.faultString}")
- end
-
- def public_name(method_name)
- public_name = @api.public_api_method_name(method_name)
- @handler_name ? "#{@handler_name}.#{public_name}" : public_name
- end
- end
- end
-end
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/container.rb b/vendor/rails/actionwebservice/lib/action_web_service/container.rb
deleted file mode 100644
index 13d9d8ab..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/container.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-require 'action_web_service/container/direct_container'
-require 'action_web_service/container/delegated_container'
-require 'action_web_service/container/action_controller_container'
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/container/action_controller_container.rb b/vendor/rails/actionwebservice/lib/action_web_service/container/action_controller_container.rb
deleted file mode 100644
index bbc28083..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/container/action_controller_container.rb
+++ /dev/null
@@ -1,93 +0,0 @@
-module ActionWebService # :nodoc:
- module Container # :nodoc:
- module ActionController # :nodoc:
- def self.included(base) # :nodoc:
- class << base
- include ClassMethods
- alias_method_chain :inherited, :api
- alias_method_chain :web_service_api, :require
- end
- end
-
- module ClassMethods
- # Creates a client for accessing remote web services, using the
- # given +protocol+ to communicate with the +endpoint_uri+.
- #
- # ==== Example
- #
- # class MyController < ActionController::Base
- # web_client_api :blogger, :xmlrpc, "http://blogger.com/myblog/api/RPC2", :handler_name => 'blogger'
- # end
- #
- # In this example, a protected method named blogger will
- # now exist on the controller, and calling it will return the
- # XML-RPC client object for working with that remote service.
- #
- # +options+ is the set of protocol client specific options (see
- # a protocol client class for details).
- #
- # If your API definition does not exist on the load path with the
- # correct rules for it to be found using +name+, you can pass in
- # the API definition class via +options+, using a key of :api
- def web_client_api(name, protocol, endpoint_uri, options={})
- unless method_defined?(name)
- api_klass = options.delete(:api) || require_web_service_api(name)
- class_eval do
- define_method(name) do
- create_web_service_client(api_klass, protocol, endpoint_uri, options)
- end
- protected name
- end
- end
- end
-
- def web_service_api_with_require(definition=nil) # :nodoc:
- return web_service_api_without_require if definition.nil?
- case definition
- when String, Symbol
- klass = require_web_service_api(definition)
- else
- klass = definition
- end
- web_service_api_without_require(klass)
- end
-
- def require_web_service_api(name) # :nodoc:
- case name
- when String, Symbol
- file_name = name.to_s.underscore + "_api"
- class_name = file_name.camelize
- class_names = [class_name, class_name.sub(/Api$/, 'API')]
- begin
- require_dependency(file_name)
- rescue LoadError => load_error
- requiree = / -- (.*?)(\.rb)?$/.match(load_error).to_a[1]
- msg = requiree == file_name ? "Missing API definition file in apis/#{file_name}.rb" : "Can't load file: #{requiree}"
- raise LoadError.new(msg).copy_blame!(load_error)
- end
- klass = nil
- class_names.each do |name|
- klass = name.constantize rescue nil
- break unless klass.nil?
- end
- unless klass
- raise(NameError, "neither #{class_names[0]} or #{class_names[1]} found")
- end
- klass
- else
- raise(ArgumentError, "expected String or Symbol argument")
- end
- end
-
- private
- def inherited_with_api(child)
- inherited_without_api(child)
- begin child.web_service_api(child.controller_path)
- rescue MissingSourceFile => e
- raise unless e.is_missing?("apis/#{child.controller_path}_api")
- end
- end
- end
- end
- end
-end
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/container/delegated_container.rb b/vendor/rails/actionwebservice/lib/action_web_service/container/delegated_container.rb
deleted file mode 100644
index 5477f8d1..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/container/delegated_container.rb
+++ /dev/null
@@ -1,86 +0,0 @@
-module ActionWebService # :nodoc:
- module Container # :nodoc:
- module Delegated # :nodoc:
- class ContainerError < ActionWebServiceError # :nodoc:
- end
-
- def self.included(base) # :nodoc:
- base.extend(ClassMethods)
- base.send(:include, ActionWebService::Container::Delegated::InstanceMethods)
- end
-
- module ClassMethods
- # Declares a web service that will provide access to the API of the given
- # +object+. +object+ must be an ActionWebService::Base derivative.
- #
- # Web service object creation can either be _immediate_, where the object
- # instance is given at class definition time, or _deferred_, where
- # object instantiation is delayed until request time.
- #
- # ==== Immediate web service object example
- #
- # class ApiController < ApplicationController
- # web_service_dispatching_mode :delegated
- #
- # web_service :person, PersonService.new
- # end
- #
- # For deferred instantiation, a block should be given instead of an
- # object instance. This block will be executed in controller instance
- # context, so it can rely on controller instance variables being present.
- #
- # ==== Deferred web service object example
- #
- # class ApiController < ApplicationController
- # web_service_dispatching_mode :delegated
- #
- # web_service(:person) { PersonService.new(request.env) }
- # end
- def web_service(name, object=nil, &block)
- if (object && block_given?) || (object.nil? && block.nil?)
- raise(ContainerError, "either service, or a block must be given")
- end
- name = name.to_sym
- if block_given?
- info = { name => { :block => block } }
- else
- info = { name => { :object => object } }
- end
- write_inheritable_hash("web_services", info)
- call_web_service_definition_callbacks(self, name, info)
- end
-
- # Whether this service contains a service with the given +name+
- def has_web_service?(name)
- web_services.has_key?(name.to_sym)
- end
-
- def web_services # :nodoc:
- read_inheritable_attribute("web_services") || {}
- end
-
- def add_web_service_definition_callback(&block) # :nodoc:
- write_inheritable_array("web_service_definition_callbacks", [block])
- end
-
- private
- def call_web_service_definition_callbacks(container_class, web_service_name, service_info)
- (read_inheritable_attribute("web_service_definition_callbacks") || []).each do |block|
- block.call(container_class, web_service_name, service_info)
- end
- end
- end
-
- module InstanceMethods # :nodoc:
- def web_service_object(web_service_name)
- info = self.class.web_services[web_service_name.to_sym]
- unless info
- raise(ContainerError, "no such web service '#{web_service_name}'")
- end
- service = info[:block]
- service ? self.instance_eval(&service) : info[:object]
- end
- end
- end
- end
-end
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/container/direct_container.rb b/vendor/rails/actionwebservice/lib/action_web_service/container/direct_container.rb
deleted file mode 100644
index 8818d8f4..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/container/direct_container.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-module ActionWebService # :nodoc:
- module Container # :nodoc:
- module Direct # :nodoc:
- class ContainerError < ActionWebServiceError # :nodoc:
- end
-
- def self.included(base) # :nodoc:
- base.extend(ClassMethods)
- end
-
- module ClassMethods
- # Attaches ActionWebService API +definition+ to the calling class.
- #
- # Action Controllers can have a default associated API, removing the need
- # to call this method if you follow the Action Web Service naming conventions.
- #
- # A controller with a class name of GoogleSearchController will
- # implicitly load app/apis/google_search_api.rb, and expect the
- # API definition class to be named GoogleSearchAPI or
- # GoogleSearchApi.
- #
- # ==== Service class example
- #
- # class MyService < ActionWebService::Base
- # web_service_api MyAPI
- # end
- #
- # class MyAPI < ActionWebService::API::Base
- # ...
- # end
- #
- # ==== Controller class example
- #
- # class MyController < ActionController::Base
- # web_service_api MyAPI
- # end
- #
- # class MyAPI < ActionWebService::API::Base
- # ...
- # end
- def web_service_api(definition=nil)
- if definition.nil?
- read_inheritable_attribute("web_service_api")
- else
- if definition.is_a?(Symbol)
- raise(ContainerError, "symbols can only be used for #web_service_api inside of a controller")
- end
- unless definition.respond_to?(:ancestors) && definition.ancestors.include?(ActionWebService::API::Base)
- raise(ContainerError, "#{definition.to_s} is not a valid API definition")
- end
- write_inheritable_attribute("web_service_api", definition)
- call_web_service_api_callbacks(self, definition)
- end
- end
-
- def add_web_service_api_callback(&block) # :nodoc:
- write_inheritable_array("web_service_api_callbacks", [block])
- end
-
- private
- def call_web_service_api_callbacks(container_class, definition)
- (read_inheritable_attribute("web_service_api_callbacks") || []).each do |block|
- block.call(container_class, definition)
- end
- end
- end
- end
- end
-end
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/dispatcher.rb b/vendor/rails/actionwebservice/lib/action_web_service/dispatcher.rb
deleted file mode 100644
index 601d8313..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/dispatcher.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-require 'action_web_service/dispatcher/abstract'
-require 'action_web_service/dispatcher/action_controller_dispatcher'
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/dispatcher/abstract.rb b/vendor/rails/actionwebservice/lib/action_web_service/dispatcher/abstract.rb
deleted file mode 100644
index cb94d649..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/dispatcher/abstract.rb
+++ /dev/null
@@ -1,207 +0,0 @@
-require 'benchmark'
-
-module ActionWebService # :nodoc:
- module Dispatcher # :nodoc:
- class DispatcherError < ActionWebService::ActionWebServiceError # :nodoc:
- def initialize(*args)
- super
- set_backtrace(caller)
- end
- end
-
- def self.included(base) # :nodoc:
- base.class_inheritable_option(:web_service_dispatching_mode, :direct)
- base.class_inheritable_option(:web_service_exception_reporting, true)
- base.send(:include, ActionWebService::Dispatcher::InstanceMethods)
- end
-
- module InstanceMethods # :nodoc:
- private
- def invoke_web_service_request(protocol_request)
- invocation = web_service_invocation(protocol_request)
- if invocation.is_a?(Array) && protocol_request.protocol.is_a?(Protocol::XmlRpc::XmlRpcProtocol)
- xmlrpc_multicall_invoke(invocation)
- else
- web_service_invoke(invocation)
- end
- end
-
- def web_service_direct_invoke(invocation)
- @method_params = invocation.method_ordered_params
- arity = method(invocation.api_method.name).arity rescue 0
- if arity < 0 || arity > 0
- params = @method_params
- else
- params = []
- end
- web_service_filtered_invoke(invocation, params)
- end
-
- def web_service_delegated_invoke(invocation)
- web_service_filtered_invoke(invocation, invocation.method_ordered_params)
- end
-
- def web_service_filtered_invoke(invocation, params)
- cancellation_reason = nil
- return_value = invocation.service.perform_invocation(invocation.api_method.name, params) do |x|
- cancellation_reason = x
- end
- if cancellation_reason
- raise(DispatcherError, "request canceled: #{cancellation_reason}")
- end
- return_value
- end
-
- def web_service_invoke(invocation)
- case web_service_dispatching_mode
- when :direct
- return_value = web_service_direct_invoke(invocation)
- when :delegated, :layered
- return_value = web_service_delegated_invoke(invocation)
- end
- web_service_create_response(invocation.protocol, invocation.protocol_options, invocation.api, invocation.api_method, return_value)
- end
-
- def xmlrpc_multicall_invoke(invocations)
- responses = []
- invocations.each do |invocation|
- if invocation.is_a?(Hash)
- responses << [invocation, nil]
- next
- end
- begin
- case web_service_dispatching_mode
- when :direct
- return_value = web_service_direct_invoke(invocation)
- when :delegated, :layered
- return_value = web_service_delegated_invoke(invocation)
- end
- api_method = invocation.api_method
- if invocation.api.has_api_method?(api_method.name)
- response_type = (api_method.returns ? api_method.returns[0] : nil)
- return_value = api_method.cast_returns(return_value)
- else
- response_type = ActionWebService::SignatureTypes.canonical_signature_entry(return_value.class, 0)
- end
- responses << [return_value, response_type]
- rescue Exception => e
- responses << [{ 'faultCode' => 3, 'faultString' => e.message }, nil]
- end
- end
- invocation = invocations[0]
- invocation.protocol.encode_multicall_response(responses, invocation.protocol_options)
- end
-
- def web_service_invocation(request, level = 0)
- public_method_name = request.method_name
- invocation = Invocation.new
- invocation.protocol = request.protocol
- invocation.protocol_options = request.protocol_options
- invocation.service_name = request.service_name
- if web_service_dispatching_mode == :layered
- case invocation.protocol
- when Protocol::Soap::SoapProtocol
- soap_action = request.protocol_options[:soap_action]
- if soap_action && soap_action =~ /^\/\w+\/(\w+)\//
- invocation.service_name = $1
- end
- when Protocol::XmlRpc::XmlRpcProtocol
- if request.method_name =~ /^([^\.]+)\.(.*)$/
- public_method_name = $2
- invocation.service_name = $1
- end
- end
- end
- if invocation.protocol.is_a? Protocol::XmlRpc::XmlRpcProtocol
- if public_method_name == 'multicall' && invocation.service_name == 'system'
- if level > 0
- raise(DispatcherError, "Recursive system.multicall invocations not allowed")
- end
- multicall = request.method_params.dup
- unless multicall.is_a?(Array) && multicall[0].is_a?(Array)
- raise(DispatcherError, "Malformed multicall (expected array of Hash elements)")
- end
- multicall = multicall[0]
- return multicall.map do |item|
- raise(DispatcherError, "Multicall elements must be Hash") unless item.is_a?(Hash)
- raise(DispatcherError, "Multicall elements must contain a 'methodName' key") unless item.has_key?('methodName')
- method_name = item['methodName']
- params = item.has_key?('params') ? item['params'] : []
- multicall_request = request.dup
- multicall_request.method_name = method_name
- multicall_request.method_params = params
- begin
- web_service_invocation(multicall_request, level + 1)
- rescue Exception => e
- {'faultCode' => 4, 'faultMessage' => e.message}
- end
- end
- end
- end
- case web_service_dispatching_mode
- when :direct
- invocation.api = self.class.web_service_api
- invocation.service = self
- when :delegated, :layered
- invocation.service = web_service_object(invocation.service_name)
- invocation.api = invocation.service.class.web_service_api
- end
- if invocation.api.nil?
- raise(DispatcherError, "no API attached to #{invocation.service.class}")
- end
- invocation.protocol.register_api(invocation.api)
- request.api = invocation.api
- if invocation.api.has_public_api_method?(public_method_name)
- invocation.api_method = invocation.api.public_api_method_instance(public_method_name)
- else
- if invocation.api.default_api_method.nil?
- raise(DispatcherError, "no such method '#{public_method_name}' on API #{invocation.api}")
- else
- invocation.api_method = invocation.api.default_api_method_instance
- end
- end
- if invocation.service.nil?
- raise(DispatcherError, "no service available for service name #{invocation.service_name}")
- end
- unless invocation.service.respond_to?(invocation.api_method.name)
- raise(DispatcherError, "no such method '#{public_method_name}' on API #{invocation.api} (#{invocation.api_method.name})")
- end
- request.api_method = invocation.api_method
- begin
- invocation.method_ordered_params = invocation.api_method.cast_expects(request.method_params.dup)
- rescue
- logger.warn "Casting of method parameters failed" unless logger.nil?
- invocation.method_ordered_params = request.method_params
- end
- request.method_params = invocation.method_ordered_params
- invocation.method_named_params = {}
- invocation.api_method.param_names.inject(0) do |m, n|
- invocation.method_named_params[n] = invocation.method_ordered_params[m]
- m + 1
- end
- invocation
- end
-
- def web_service_create_response(protocol, protocol_options, api, api_method, return_value)
- if api.has_api_method?(api_method.name)
- return_type = api_method.returns ? api_method.returns[0] : nil
- return_value = api_method.cast_returns(return_value)
- else
- return_type = ActionWebService::SignatureTypes.canonical_signature_entry(return_value.class, 0)
- end
- protocol.encode_response(api_method.public_name + 'Response', return_value, return_type, protocol_options)
- end
-
- class Invocation # :nodoc:
- attr_accessor :protocol
- attr_accessor :protocol_options
- attr_accessor :service_name
- attr_accessor :api
- attr_accessor :api_method
- attr_accessor :method_ordered_params
- attr_accessor :method_named_params
- attr_accessor :service
- end
- end
- end
-end
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb b/vendor/rails/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb
deleted file mode 100644
index f9995197..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb
+++ /dev/null
@@ -1,379 +0,0 @@
-require 'benchmark'
-require 'builder/xmlmarkup'
-
-module ActionWebService # :nodoc:
- module Dispatcher # :nodoc:
- module ActionController # :nodoc:
- def self.included(base) # :nodoc:
- class << base
- include ClassMethods
- alias_method_chain :inherited, :action_controller
- end
- base.class_eval do
- alias_method :web_service_direct_invoke_without_controller, :web_service_direct_invoke
- end
- base.add_web_service_api_callback do |klass, api|
- if klass.web_service_dispatching_mode == :direct
- klass.class_eval 'def api; dispatch_web_service_request; end'
- end
- end
- base.add_web_service_definition_callback do |klass, name, info|
- if klass.web_service_dispatching_mode == :delegated
- klass.class_eval "def #{name}; dispatch_web_service_request; end"
- elsif klass.web_service_dispatching_mode == :layered
- klass.class_eval 'def api; dispatch_web_service_request; end'
- end
- end
- base.send(:include, ActionWebService::Dispatcher::ActionController::InstanceMethods)
- end
-
- module ClassMethods # :nodoc:
- def inherited_with_action_controller(child)
- inherited_without_action_controller(child)
- child.send(:include, ActionWebService::Dispatcher::ActionController::WsdlAction)
- end
- end
-
- module InstanceMethods # :nodoc:
- private
- def dispatch_web_service_request
- method = request.method.to_s.upcase
- allowed_methods = self.class.web_service_api ? (self.class.web_service_api.allowed_http_methods || []) : [ :post ]
- allowed_methods = allowed_methods.map{|m| m.to_s.upcase }
- if !allowed_methods.include?(method)
- render :text => "#{method} not supported", :status=>500
- return
- end
- exception = nil
- begin
- ws_request = discover_web_service_request(request)
- rescue Exception => e
- exception = e
- end
- if ws_request
- ws_response = nil
- exception = nil
- bm = Benchmark.measure do
- begin
- ws_response = invoke_web_service_request(ws_request)
- rescue Exception => e
- exception = e
- end
- end
- log_request(ws_request, request.raw_post)
- if exception
- log_error(exception) unless logger.nil?
- send_web_service_error_response(ws_request, exception)
- else
- send_web_service_response(ws_response, bm.real)
- end
- else
- exception ||= DispatcherError.new("Malformed SOAP or XML-RPC protocol message")
- log_error(exception) unless logger.nil?
- send_web_service_error_response(ws_request, exception)
- end
- rescue Exception => e
- log_error(e) unless logger.nil?
- send_web_service_error_response(ws_request, e)
- end
-
- def send_web_service_response(ws_response, elapsed=nil)
- log_response(ws_response, elapsed)
- options = { :type => ws_response.content_type, :disposition => 'inline' }
- send_data(ws_response.body, options)
- end
-
- def send_web_service_error_response(ws_request, exception)
- if ws_request
- unless self.class.web_service_exception_reporting
- exception = DispatcherError.new("Internal server error (exception raised)")
- end
- api_method = ws_request.api_method
- public_method_name = api_method ? api_method.public_name : ws_request.method_name
- return_type = ActionWebService::SignatureTypes.canonical_signature_entry(Exception, 0)
- ws_response = ws_request.protocol.encode_response(public_method_name + 'Response', exception, return_type, ws_request.protocol_options)
- send_web_service_response(ws_response)
- else
- if self.class.web_service_exception_reporting
- message = exception.message
- backtrace = "\nBacktrace:\n#{exception.backtrace.join("\n")}"
- else
- message = "Exception raised"
- backtrace = ""
- end
- render :text => "Internal protocol error: #{message}#{backtrace}", :status => 500
- end
- end
-
- def web_service_direct_invoke(invocation)
- invocation.method_named_params.each do |name, value|
- params[name] = value
- end
- web_service_direct_invoke_without_controller(invocation)
- end
-
- def log_request(ws_request, body)
- unless logger.nil?
- name = ws_request.method_name
- api_method = ws_request.api_method
- params = ws_request.method_params
- if api_method && api_method.expects
- params = api_method.expects.zip(params).map{ |type, param| "#{type.name}=>#{param.inspect}" }
- else
- params = params.map{ |param| param.inspect }
- end
- service = ws_request.service_name
- logger.debug("\nWeb Service Request: #{name}(#{params.join(", ")}) Entrypoint: #{service}")
- logger.debug(indent(body))
- end
- end
-
- def log_response(ws_response, elapsed=nil)
- unless logger.nil?
- elapsed = (elapsed ? " (%f):" % elapsed : ":")
- logger.debug("\nWeb Service Response" + elapsed + " => #{ws_response.return_value.inspect}")
- logger.debug(indent(ws_response.body))
- end
- end
-
- def indent(body)
- body.split(/\n/).map{|x| " #{x}"}.join("\n")
- end
- end
-
- module WsdlAction # :nodoc:
- XsdNs = 'http://www.w3.org/2001/XMLSchema'
- WsdlNs = 'http://schemas.xmlsoap.org/wsdl/'
- SoapNs = 'http://schemas.xmlsoap.org/wsdl/soap/'
- SoapEncodingNs = 'http://schemas.xmlsoap.org/soap/encoding/'
- SoapHttpTransport = 'http://schemas.xmlsoap.org/soap/http'
-
- def wsdl
- case request.method
- when :get
- begin
- options = { :type => 'text/xml', :disposition => 'inline' }
- send_data(to_wsdl, options)
- rescue Exception => e
- log_error(e) unless logger.nil?
- end
- when :post
- render :text => 'POST not supported', :status => 500
- end
- end
-
- private
- def base_uri
- host = request.host_with_port
- relative_url_root = request.relative_url_root
- scheme = request.ssl? ? 'https' : 'http'
- '%s://%s%s/%s/' % [scheme, host, relative_url_root, self.class.controller_path]
- end
-
- def to_wsdl
- xml = ''
- dispatching_mode = web_service_dispatching_mode
- global_service_name = wsdl_service_name
- namespace = wsdl_namespace || 'urn:ActionWebService'
- soap_action_base = "/#{controller_name}"
-
- marshaler = ActionWebService::Protocol::Soap::SoapMarshaler.new(namespace)
- apis = {}
- case dispatching_mode
- when :direct
- api = self.class.web_service_api
- web_service_name = controller_class_name.sub(/Controller$/, '').underscore
- apis[web_service_name] = [api, register_api(api, marshaler)]
- when :delegated, :layered
- self.class.web_services.each do |web_service_name, info|
- service = web_service_object(web_service_name)
- api = service.class.web_service_api
- apis[web_service_name] = [api, register_api(api, marshaler)]
- end
- end
- custom_types = []
- apis.values.each do |api, bindings|
- bindings.each do |b|
- custom_types << b unless custom_types.include?(b)
- end
- end
-
- xm = Builder::XmlMarkup.new(:target => xml, :indent => 2)
- xm.instruct!
- xm.definitions('name' => wsdl_service_name,
- 'targetNamespace' => namespace,
- 'xmlns:typens' => namespace,
- 'xmlns:xsd' => XsdNs,
- 'xmlns:soap' => SoapNs,
- 'xmlns:soapenc' => SoapEncodingNs,
- 'xmlns:wsdl' => WsdlNs,
- 'xmlns' => WsdlNs) do
- # Generate XSD
- if custom_types.size > 0
- xm.types do
- xm.xsd(:schema, 'xmlns' => XsdNs, 'targetNamespace' => namespace) do
- custom_types.each do |binding|
- case
- when binding.type.array?
- xm.xsd(:complexType, 'name' => binding.type_name) do
- xm.xsd(:complexContent) do
- xm.xsd(:restriction, 'base' => 'soapenc:Array') do
- xm.xsd(:attribute, 'ref' => 'soapenc:arrayType',
- 'wsdl:arrayType' => binding.element_binding.qualified_type_name('typens') + '[]')
- end
- end
- end
- when binding.type.structured?
- xm.xsd(:complexType, 'name' => binding.type_name) do
- xm.xsd(:all) do
- binding.type.each_member do |name, type|
- b = marshaler.register_type(type)
- xm.xsd(:element, 'name' => name, 'type' => b.qualified_type_name('typens'))
- end
- end
- end
- end
- end
- end
- end
- end
-
- # APIs
- apis.each do |api_name, values|
- api = values[0]
- api.api_methods.each do |name, method|
- gen = lambda do |msg_name, direction|
- xm.message('name' => message_name_for(api_name, msg_name)) do
- sym = nil
- if direction == :out
- returns = method.returns
- if returns
- binding = marshaler.register_type(returns[0])
- xm.part('name' => 'return', 'type' => binding.qualified_type_name('typens'))
- end
- else
- expects = method.expects
- expects.each do |type|
- binding = marshaler.register_type(type)
- xm.part('name' => type.name, 'type' => binding.qualified_type_name('typens'))
- end if expects
- end
- end
- end
- public_name = method.public_name
- gen.call(public_name, :in)
- gen.call("#{public_name}Response", :out)
- end
-
- # Port
- port_name = port_name_for(global_service_name, api_name)
- xm.portType('name' => port_name) do
- api.api_methods.each do |name, method|
- xm.operation('name' => method.public_name) do
- xm.input('message' => "typens:" + message_name_for(api_name, method.public_name))
- xm.output('message' => "typens:" + message_name_for(api_name, "#{method.public_name}Response"))
- end
- end
- end
-
- # Bind it
- binding_name = binding_name_for(global_service_name, api_name)
- xm.binding('name' => binding_name, 'type' => "typens:#{port_name}") do
- xm.soap(:binding, 'style' => 'rpc', 'transport' => SoapHttpTransport)
- api.api_methods.each do |name, method|
- xm.operation('name' => method.public_name) do
- case web_service_dispatching_mode
- when :direct
- soap_action = soap_action_base + "/api/" + method.public_name
- when :delegated, :layered
- soap_action = soap_action_base \
- + "/" + api_name.to_s \
- + "/" + method.public_name
- end
- xm.soap(:operation, 'soapAction' => soap_action)
- xm.input do
- xm.soap(:body,
- 'use' => 'encoded',
- 'namespace' => namespace,
- 'encodingStyle' => SoapEncodingNs)
- end
- xm.output do
- xm.soap(:body,
- 'use' => 'encoded',
- 'namespace' => namespace,
- 'encodingStyle' => SoapEncodingNs)
- end
- end
- end
- end
- end
-
- # Define it
- xm.service('name' => "#{global_service_name}Service") do
- apis.each do |api_name, values|
- port_name = port_name_for(global_service_name, api_name)
- binding_name = binding_name_for(global_service_name, api_name)
- case web_service_dispatching_mode
- when :direct, :layered
- binding_target = 'api'
- when :delegated
- binding_target = api_name.to_s
- end
- xm.port('name' => port_name, 'binding' => "typens:#{binding_name}") do
- xm.soap(:address, 'location' => "#{base_uri}#{binding_target}")
- end
- end
- end
- end
- end
-
- def port_name_for(global_service, service)
- "#{global_service}#{service.to_s.camelize}Port"
- end
-
- def binding_name_for(global_service, service)
- "#{global_service}#{service.to_s.camelize}Binding"
- end
-
- def message_name_for(api_name, message_name)
- mode = web_service_dispatching_mode
- if mode == :layered || mode == :delegated
- api_name.to_s + '-' + message_name
- else
- message_name
- end
- end
-
- def register_api(api, marshaler)
- bindings = {}
- traverse_custom_types(api, marshaler, bindings) do |binding|
- bindings[binding] = nil unless bindings.has_key?(binding)
- element_binding = binding.element_binding
- bindings[element_binding] = nil if element_binding && !bindings.has_key?(element_binding)
- end
- bindings.keys
- end
-
- def traverse_custom_types(api, marshaler, bindings, &block)
- api.api_methods.each do |name, method|
- expects, returns = method.expects, method.returns
- expects.each{ |type| traverse_type(marshaler, type, bindings, &block) if type.custom? } if expects
- returns.each{ |type| traverse_type(marshaler, type, bindings, &block) if type.custom? } if returns
- end
- end
-
- def traverse_type(marshaler, type, bindings, &block)
- binding = marshaler.register_type(type)
- return if bindings.has_key?(binding)
- bindings[binding] = nil
- yield binding
- if type.array?
- yield marshaler.register_type(type.element_type)
- type = type.element_type
- end
- type.each_member{ |name, type| traverse_type(marshaler, type, bindings, &block) } if type.structured?
- end
- end
- end
- end
-end
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/invocation.rb b/vendor/rails/actionwebservice/lib/action_web_service/invocation.rb
deleted file mode 100644
index 2a9121ee..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/invocation.rb
+++ /dev/null
@@ -1,202 +0,0 @@
-module ActionWebService # :nodoc:
- module Invocation # :nodoc:
- class InvocationError < ActionWebService::ActionWebServiceError # :nodoc:
- end
-
- def self.included(base) # :nodoc:
- base.extend(ClassMethods)
- base.send(:include, ActionWebService::Invocation::InstanceMethods)
- end
-
- # Invocation interceptors provide a means to execute custom code before
- # and after method invocations on ActionWebService::Base objects.
- #
- # When running in _Direct_ dispatching mode, ActionController filters
- # should be used for this functionality instead.
- #
- # The semantics of invocation interceptors are the same as ActionController
- # filters, and accept the same parameters and options.
- #
- # A _before_ interceptor can also cancel execution by returning +false+,
- # or returning a [false, "cancel reason"] array if it wishes to supply
- # a reason for canceling the request.
- #
- # === Example
- #
- # class CustomService < ActionWebService::Base
- # before_invocation :intercept_add, :only => [:add]
- #
- # def add(a, b)
- # a + b
- # end
- #
- # private
- # def intercept_add
- # return [false, "permission denied"] # cancel it
- # end
- # end
- #
- # Options:
- # [:except] A list of methods for which the interceptor will NOT be called
- # [:only] A list of methods for which the interceptor WILL be called
- module ClassMethods
- # Appends the given +interceptors+ to be called
- # _before_ method invocation.
- def append_before_invocation(*interceptors, &block)
- conditions = extract_conditions!(interceptors)
- interceptors << block if block_given?
- add_interception_conditions(interceptors, conditions)
- append_interceptors_to_chain("before", interceptors)
- end
-
- # Prepends the given +interceptors+ to be called
- # _before_ method invocation.
- def prepend_before_invocation(*interceptors, &block)
- conditions = extract_conditions!(interceptors)
- interceptors << block if block_given?
- add_interception_conditions(interceptors, conditions)
- prepend_interceptors_to_chain("before", interceptors)
- end
-
- alias :before_invocation :append_before_invocation
-
- # Appends the given +interceptors+ to be called
- # _after_ method invocation.
- def append_after_invocation(*interceptors, &block)
- conditions = extract_conditions!(interceptors)
- interceptors << block if block_given?
- add_interception_conditions(interceptors, conditions)
- append_interceptors_to_chain("after", interceptors)
- end
-
- # Prepends the given +interceptors+ to be called
- # _after_ method invocation.
- def prepend_after_invocation(*interceptors, &block)
- conditions = extract_conditions!(interceptors)
- interceptors << block if block_given?
- add_interception_conditions(interceptors, conditions)
- prepend_interceptors_to_chain("after", interceptors)
- end
-
- alias :after_invocation :append_after_invocation
-
- def before_invocation_interceptors # :nodoc:
- read_inheritable_attribute("before_invocation_interceptors")
- end
-
- def after_invocation_interceptors # :nodoc:
- read_inheritable_attribute("after_invocation_interceptors")
- end
-
- def included_intercepted_methods # :nodoc:
- read_inheritable_attribute("included_intercepted_methods") || {}
- end
-
- def excluded_intercepted_methods # :nodoc:
- read_inheritable_attribute("excluded_intercepted_methods") || {}
- end
-
- private
- def append_interceptors_to_chain(condition, interceptors)
- write_inheritable_array("#{condition}_invocation_interceptors", interceptors)
- end
-
- def prepend_interceptors_to_chain(condition, interceptors)
- interceptors = interceptors + read_inheritable_attribute("#{condition}_invocation_interceptors")
- write_inheritable_attribute("#{condition}_invocation_interceptors", interceptors)
- end
-
- def extract_conditions!(interceptors)
- return nil unless interceptors.last.is_a? Hash
- interceptors.pop
- end
-
- def add_interception_conditions(interceptors, conditions)
- return unless conditions
- included, excluded = conditions[:only], conditions[:except]
- write_inheritable_hash("included_intercepted_methods", condition_hash(interceptors, included)) && return if included
- write_inheritable_hash("excluded_intercepted_methods", condition_hash(interceptors, excluded)) if excluded
- end
-
- def condition_hash(interceptors, *methods)
- interceptors.inject({}) {|hash, interceptor| hash.merge(interceptor => methods.flatten.map {|method| method.to_s})}
- end
- end
-
- module InstanceMethods # :nodoc:
- def self.included(base)
- base.class_eval do
- alias_method_chain :perform_invocation, :interception
- end
- end
-
- def perform_invocation_with_interception(method_name, params, &block)
- return if before_invocation(method_name, params, &block) == false
- return_value = perform_invocation_without_interception(method_name, params)
- after_invocation(method_name, params, return_value)
- return_value
- end
-
- def perform_invocation(method_name, params)
- send(method_name, *params)
- end
-
- def before_invocation(name, args, &block)
- call_interceptors(self.class.before_invocation_interceptors, [name, args], &block)
- end
-
- def after_invocation(name, args, result)
- call_interceptors(self.class.after_invocation_interceptors, [name, args, result])
- end
-
- private
-
- def call_interceptors(interceptors, interceptor_args, &block)
- if interceptors and not interceptors.empty?
- interceptors.each do |interceptor|
- next if method_exempted?(interceptor, interceptor_args[0].to_s)
- result = case
- when interceptor.is_a?(Symbol)
- self.send(interceptor, *interceptor_args)
- when interceptor_block?(interceptor)
- interceptor.call(self, *interceptor_args)
- when interceptor_class?(interceptor)
- interceptor.intercept(self, *interceptor_args)
- else
- raise(
- InvocationError,
- "Interceptors need to be either a symbol, proc/method, or a class implementing a static intercept method"
- )
- end
- reason = nil
- if result.is_a?(Array)
- reason = result[1] if result[1]
- result = result[0]
- end
- if result == false
- block.call(reason) if block && reason
- return false
- end
- end
- end
- end
-
- def interceptor_block?(interceptor)
- interceptor.respond_to?("call") && (interceptor.arity == 3 || interceptor.arity == -1)
- end
-
- def interceptor_class?(interceptor)
- interceptor.respond_to?("intercept")
- end
-
- def method_exempted?(interceptor, method_name)
- case
- when self.class.included_intercepted_methods[interceptor]
- !self.class.included_intercepted_methods[interceptor].include?(method_name)
- when self.class.excluded_intercepted_methods[interceptor]
- self.class.excluded_intercepted_methods[interceptor].include?(method_name)
- end
- end
- end
- end
-end
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/protocol.rb b/vendor/rails/actionwebservice/lib/action_web_service/protocol.rb
deleted file mode 100644
index 053e9cb4..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/protocol.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require 'action_web_service/protocol/abstract'
-require 'action_web_service/protocol/discovery'
-require 'action_web_service/protocol/soap_protocol'
-require 'action_web_service/protocol/xmlrpc_protocol'
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/protocol/abstract.rb b/vendor/rails/actionwebservice/lib/action_web_service/protocol/abstract.rb
deleted file mode 100644
index fff5f622..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/protocol/abstract.rb
+++ /dev/null
@@ -1,112 +0,0 @@
-module ActionWebService # :nodoc:
- module Protocol # :nodoc:
- class ProtocolError < ActionWebServiceError # :nodoc:
- end
-
- class AbstractProtocol # :nodoc:
- def setup(controller)
- end
-
- def decode_action_pack_request(action_pack_request)
- end
-
- def encode_action_pack_request(service_name, public_method_name, raw_body, options={})
- klass = options[:request_class] || SimpleActionPackRequest
- request = klass.new
- request.request_parameters['action'] = service_name.to_s
- request.env['RAW_POST_DATA'] = raw_body
- request.env['REQUEST_METHOD'] = 'POST'
- request.env['HTTP_CONTENT_TYPE'] = 'text/xml'
- request
- end
-
- def decode_request(raw_request, service_name, protocol_options={})
- end
-
- def encode_request(method_name, params, param_types)
- end
-
- def decode_response(raw_response)
- end
-
- def encode_response(method_name, return_value, return_type, protocol_options={})
- end
-
- def protocol_client(api, protocol_name, endpoint_uri, options)
- end
-
- def register_api(api)
- end
- end
-
- class Request # :nodoc:
- attr :protocol
- attr_accessor :method_name
- attr_accessor :method_params
- attr :service_name
- attr_accessor :api
- attr_accessor :api_method
- attr :protocol_options
-
- def initialize(protocol, method_name, method_params, service_name, api=nil, api_method=nil, protocol_options=nil)
- @protocol = protocol
- @method_name = method_name
- @method_params = method_params
- @service_name = service_name
- @api = api
- @api_method = api_method
- @protocol_options = protocol_options || {}
- end
- end
-
- class Response # :nodoc:
- attr :body
- attr :content_type
- attr :return_value
-
- def initialize(body, content_type, return_value)
- @body = body
- @content_type = content_type
- @return_value = return_value
- end
- end
-
- class SimpleActionPackRequest < ActionController::AbstractRequest # :nodoc:
- def initialize
- @env = {}
- @qparams = {}
- @rparams = {}
- @cookies = {}
- reset_session
- end
-
- def query_parameters
- @qparams
- end
-
- def request_parameters
- @rparams
- end
-
- def env
- @env
- end
-
- def host
- ''
- end
-
- def cookies
- @cookies
- end
-
- def session
- @session
- end
-
- def reset_session
- @session = {}
- end
- end
- end
-end
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/protocol/discovery.rb b/vendor/rails/actionwebservice/lib/action_web_service/protocol/discovery.rb
deleted file mode 100644
index 3d4e0818..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/protocol/discovery.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-module ActionWebService # :nodoc:
- module Protocol # :nodoc:
- module Discovery # :nodoc:
- def self.included(base)
- base.extend(ClassMethods)
- base.send(:include, ActionWebService::Protocol::Discovery::InstanceMethods)
- end
-
- module ClassMethods # :nodoc:
- def register_protocol(klass)
- write_inheritable_array("web_service_protocols", [klass])
- end
- end
-
- module InstanceMethods # :nodoc:
- private
- def discover_web_service_request(action_pack_request)
- (self.class.read_inheritable_attribute("web_service_protocols") || []).each do |protocol|
- protocol = protocol.create(self)
- request = protocol.decode_action_pack_request(action_pack_request)
- return request unless request.nil?
- end
- nil
- end
-
- def create_web_service_client(api, protocol_name, endpoint_uri, options)
- (self.class.read_inheritable_attribute("web_service_protocols") || []).each do |protocol|
- protocol = protocol.create(self)
- client = protocol.protocol_client(api, protocol_name, endpoint_uri, options)
- return client unless client.nil?
- end
- nil
- end
- end
- end
- end
-end
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/protocol/soap_protocol.rb b/vendor/rails/actionwebservice/lib/action_web_service/protocol/soap_protocol.rb
deleted file mode 100644
index 1bce496a..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/protocol/soap_protocol.rb
+++ /dev/null
@@ -1,176 +0,0 @@
-require 'action_web_service/protocol/soap_protocol/marshaler'
-require 'soap/streamHandler'
-require 'action_web_service/client/soap_client'
-
-module ActionWebService # :nodoc:
- module API # :nodoc:
- class Base # :nodoc:
- def self.soap_client(endpoint_uri, options={})
- ActionWebService::Client::Soap.new self, endpoint_uri, options
- end
- end
- end
-
- module Protocol # :nodoc:
- module Soap # :nodoc:
- def self.included(base)
- base.register_protocol(SoapProtocol)
- base.class_inheritable_option(:wsdl_service_name)
- base.class_inheritable_option(:wsdl_namespace)
- end
-
- class SoapProtocol < AbstractProtocol # :nodoc:
- AWSEncoding = 'UTF-8'
- XSDEncoding = 'UTF8'
-
- attr :marshaler
-
- def initialize(namespace=nil)
- namespace ||= 'urn:ActionWebService'
- @marshaler = SoapMarshaler.new namespace
- end
-
- def self.create(controller)
- SoapProtocol.new(controller.wsdl_namespace)
- end
-
- def decode_action_pack_request(action_pack_request)
- return nil unless soap_action = has_valid_soap_action?(action_pack_request)
- service_name = action_pack_request.parameters['action']
- input_encoding = parse_charset(action_pack_request.env['HTTP_CONTENT_TYPE'])
- protocol_options = {
- :soap_action => soap_action,
- :charset => input_encoding
- }
- decode_request(action_pack_request.raw_post, service_name, protocol_options)
- end
-
- def encode_action_pack_request(service_name, public_method_name, raw_body, options={})
- request = super
- request.env['HTTP_SOAPACTION'] = '/soap/%s/%s' % [service_name, public_method_name]
- request
- end
-
- def decode_request(raw_request, service_name, protocol_options={})
- envelope = SOAP::Processor.unmarshal(raw_request, :charset => protocol_options[:charset])
- unless envelope
- raise ProtocolError, "Failed to parse SOAP request message"
- end
- request = envelope.body.request
- method_name = request.elename.name
- params = request.collect{ |k, v| marshaler.soap_to_ruby(request[k]) }
- Request.new(self, method_name, params, service_name, nil, nil, protocol_options)
- end
-
- def encode_request(method_name, params, param_types)
- param_types.each{ |type| marshaler.register_type(type) } if param_types
- qname = XSD::QName.new(marshaler.namespace, method_name)
- param_def = []
- if param_types
- params = param_types.zip(params).map do |type, param|
- param_def << ['in', type.name, marshaler.lookup_type(type).mapping]
- [type.name, marshaler.ruby_to_soap(param)]
- end
- else
- params = []
- end
- request = SOAP::RPC::SOAPMethodRequest.new(qname, param_def)
- request.set_param(params)
- envelope = create_soap_envelope(request)
- SOAP::Processor.marshal(envelope)
- end
-
- def decode_response(raw_response)
- envelope = SOAP::Processor.unmarshal(raw_response)
- unless envelope
- raise ProtocolError, "Failed to parse SOAP request message"
- end
- method_name = envelope.body.request.elename.name
- return_value = envelope.body.response
- return_value = marshaler.soap_to_ruby(return_value) unless return_value.nil?
- [method_name, return_value]
- end
-
- def encode_response(method_name, return_value, return_type, protocol_options={})
- if return_type
- return_binding = marshaler.register_type(return_type)
- marshaler.annotate_arrays(return_binding, return_value)
- end
- qname = XSD::QName.new(marshaler.namespace, method_name)
- if return_value.nil?
- response = SOAP::RPC::SOAPMethodResponse.new(qname, nil)
- else
- if return_value.is_a?(Exception)
- detail = SOAP::Mapping::SOAPException.new(return_value)
- response = SOAP::SOAPFault.new(
- SOAP::SOAPQName.new('%s:%s' % [SOAP::SOAPNamespaceTag, 'Server']),
- SOAP::SOAPString.new(return_value.to_s),
- SOAP::SOAPString.new(self.class.name),
- marshaler.ruby_to_soap(detail))
- else
- if return_type
- param_def = [['retval', 'return', marshaler.lookup_type(return_type).mapping]]
- response = SOAP::RPC::SOAPMethodResponse.new(qname, param_def)
- response.retval = marshaler.ruby_to_soap(return_value)
- else
- response = SOAP::RPC::SOAPMethodResponse.new(qname, nil)
- end
- end
- end
- envelope = create_soap_envelope(response)
-
- # FIXME: This is not thread-safe, but StringFactory_ in SOAP4R only
- # reads target encoding from the XSD::Charset.encoding variable.
- # This is required to ensure $KCODE strings are converted
- # correctly to UTF-8 for any values of $KCODE.
- previous_encoding = XSD::Charset.encoding
- XSD::Charset.encoding = XSDEncoding
- response_body = SOAP::Processor.marshal(envelope, :charset => AWSEncoding)
- XSD::Charset.encoding = previous_encoding
-
- Response.new(response_body, "text/xml; charset=#{AWSEncoding}", return_value)
- end
-
- def protocol_client(api, protocol_name, endpoint_uri, options={})
- return nil unless protocol_name == :soap
- ActionWebService::Client::Soap.new(api, endpoint_uri, options)
- end
-
- def register_api(api)
- api.api_methods.each do |name, method|
- method.expects.each{ |type| marshaler.register_type(type) } if method.expects
- method.returns.each{ |type| marshaler.register_type(type) } if method.returns
- end
- end
-
- private
- def has_valid_soap_action?(request)
- return nil unless request.method == :post
- soap_action = request.env['HTTP_SOAPACTION']
- return nil unless soap_action
- soap_action = soap_action.dup
- soap_action.gsub!(/^"/, '')
- soap_action.gsub!(/"$/, '')
- soap_action.strip!
- return nil if soap_action.empty?
- soap_action
- end
-
- def create_soap_envelope(body)
- header = SOAP::SOAPHeader.new
- body = SOAP::SOAPBody.new(body)
- SOAP::SOAPEnvelope.new(header, body)
- end
-
- def parse_charset(content_type)
- return AWSEncoding if content_type.nil?
- if /^text\/xml(?:\s*;\s*charset=([^"]+|"[^"]+"))$/i =~ content_type
- $1
- else
- AWSEncoding
- end
- end
- end
- end
- end
-end
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/protocol/soap_protocol/marshaler.rb b/vendor/rails/actionwebservice/lib/action_web_service/protocol/soap_protocol/marshaler.rb
deleted file mode 100644
index 18733962..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/protocol/soap_protocol/marshaler.rb
+++ /dev/null
@@ -1,235 +0,0 @@
-require 'soap/mapping'
-
-module ActionWebService
- module Protocol
- module Soap
- # Workaround for SOAP4R return values changing
- class Registry < SOAP::Mapping::Registry
- if SOAP::Version >= "1.5.4"
- def find_mapped_soap_class(obj_class)
- return @map.instance_eval { @obj2soap[obj_class][0] }
- end
-
- def find_mapped_obj_class(soap_class)
- return @map.instance_eval { @soap2obj[soap_class][0] }
- end
- end
- end
-
- class SoapMarshaler
- attr :namespace
- attr :registry
-
- def initialize(namespace=nil)
- @namespace = namespace || 'urn:ActionWebService'
- @registry = Registry.new
- @type2binding = {}
- register_static_factories
- end
-
- def soap_to_ruby(obj)
- SOAP::Mapping.soap2obj(obj, @registry)
- end
-
- def ruby_to_soap(obj)
- soap = SOAP::Mapping.obj2soap(obj, @registry)
- soap.elename = XSD::QName.new if SOAP::Version >= "1.5.5" && soap.elename == XSD::QName::EMPTY
- soap
- end
-
- def register_type(type)
- return @type2binding[type] if @type2binding.has_key?(type)
-
- if type.array?
- array_mapping = @registry.find_mapped_soap_class(Array)
- qname = XSD::QName.new(@namespace, soap_type_name(type.element_type.type_class.name) + 'Array')
- element_type_binding = register_type(type.element_type)
- @type2binding[type] = SoapBinding.new(self, qname, type, array_mapping, element_type_binding)
- elsif (mapping = @registry.find_mapped_soap_class(type.type_class) rescue nil)
- qname = mapping[2] ? mapping[2][:type] : nil
- qname ||= soap_base_type_name(mapping[0])
- @type2binding[type] = SoapBinding.new(self, qname, type, mapping)
- else
- qname = XSD::QName.new(@namespace, soap_type_name(type.type_class.name))
- @registry.add(type.type_class,
- SOAP::SOAPStruct,
- typed_struct_factory(type.type_class),
- { :type => qname })
- mapping = @registry.find_mapped_soap_class(type.type_class)
- @type2binding[type] = SoapBinding.new(self, qname, type, mapping)
- end
-
- if type.structured?
- type.each_member do |m_name, m_type|
- register_type(m_type)
- end
- end
-
- @type2binding[type]
- end
- alias :lookup_type :register_type
-
- def annotate_arrays(binding, value)
- if value.nil?
- return
- elsif binding.type.array?
- mark_typed_array(value, binding.element_binding.qname)
- if binding.element_binding.type.custom?
- value.each do |element|
- annotate_arrays(binding.element_binding, element)
- end
- end
- elsif binding.type.structured?
- binding.type.each_member do |name, type|
- member_binding = register_type(type)
- member_value = value.respond_to?('[]') ? value[name] : value.send(name)
- annotate_arrays(member_binding, member_value) if type.custom?
- end
- end
- end
-
- private
- def typed_struct_factory(type_class)
- if Object.const_defined?('ActiveRecord')
- if type_class.ancestors.include?(ActiveRecord::Base)
- qname = XSD::QName.new(@namespace, soap_type_name(type_class.name))
- type_class.instance_variable_set('@qname', qname)
- return SoapActiveRecordStructFactory.new
- end
- end
- SOAP::Mapping::Registry::TypedStructFactory
- end
-
- def mark_typed_array(array, qname)
- (class << array; self; end).class_eval do
- define_method(:arytype) do
- qname
- end
- end
- end
-
- def soap_base_type_name(type)
- xsd_type = type.ancestors.find{ |c| c.const_defined? 'Type' }
- xsd_type ? xsd_type.const_get('Type') : XSD::XSDAnySimpleType::Type
- end
-
- def soap_type_name(type_name)
- type_name.gsub(/::/, '..')
- end
-
- def register_static_factories
- @registry.add(ActionWebService::Base64, SOAP::SOAPBase64, SoapBase64Factory.new, nil)
- mapping = @registry.find_mapped_soap_class(ActionWebService::Base64)
- @type2binding[ActionWebService::Base64] =
- SoapBinding.new(self, SOAP::SOAPBase64::Type, ActionWebService::Base64, mapping)
- @registry.add(Array, SOAP::SOAPArray, SoapTypedArrayFactory.new, nil)
- @registry.add(::BigDecimal, SOAP::SOAPDouble, SOAP::Mapping::Registry::BasetypeFactory, {:derived_class => true})
- end
- end
-
- class SoapBinding
- attr :qname
- attr :type
- attr :mapping
- attr :element_binding
-
- def initialize(marshaler, qname, type, mapping, element_binding=nil)
- @marshaler = marshaler
- @qname = qname
- @type = type
- @mapping = mapping
- @element_binding = element_binding
- end
-
- def type_name
- @type.custom? ? @qname.name : nil
- end
-
- def qualified_type_name(ns=nil)
- if @type.custom?
- "#{ns ? ns : @qname.namespace}:#{@qname.name}"
- else
- ns = XSD::NS.new
- ns.assign(XSD::Namespace, SOAP::XSDNamespaceTag)
- ns.assign(SOAP::EncodingNamespace, "soapenc")
- xsd_klass = mapping[0].ancestors.find{|c| c.const_defined?('Type')}
- return ns.name(XSD::AnyTypeName) unless xsd_klass
- ns.name(xsd_klass.const_get('Type'))
- end
- end
-
- def eql?(other)
- @qname == other.qname
- end
- alias :== :eql?
-
- def hash
- @qname.hash
- end
- end
-
- class SoapActiveRecordStructFactory < SOAP::Mapping::Factory
- def obj2soap(soap_class, obj, info, map)
- unless obj.is_a?(ActiveRecord::Base)
- return nil
- end
- soap_obj = soap_class.new(obj.class.instance_variable_get('@qname'))
- obj.class.columns.each do |column|
- key = column.name.to_s
- value = obj.send(key)
- soap_obj[key] = SOAP::Mapping._obj2soap(value, map)
- end
- soap_obj
- end
-
- def soap2obj(obj_class, node, info, map)
- unless node.type == obj_class.instance_variable_get('@qname')
- return false
- end
- obj = obj_class.new
- node.each do |key, value|
- obj[key] = value.data
- end
- obj.instance_variable_set('@new_record', false)
- return true, obj
- end
- end
-
- class SoapTypedArrayFactory < SOAP::Mapping::Factory
- def obj2soap(soap_class, obj, info, map)
- unless obj.respond_to?(:arytype)
- return nil
- end
- soap_obj = soap_class.new(SOAP::ValueArrayName, 1, obj.arytype)
- mark_marshalled_obj(obj, soap_obj)
- obj.each do |item|
- child = SOAP::Mapping._obj2soap(item, map)
- soap_obj.add(child)
- end
- soap_obj
- end
-
- def soap2obj(obj_class, node, info, map)
- return false
- end
- end
-
- class SoapBase64Factory < SOAP::Mapping::Factory
- def obj2soap(soap_class, obj, info, map)
- unless obj.is_a?(ActionWebService::Base64)
- return nil
- end
- return soap_class.new(obj)
- end
-
- def soap2obj(obj_class, node, info, map)
- unless node.type == SOAP::SOAPBase64::Type
- return false
- end
- return true, obj_class.new(node.string)
- end
- end
-
- end
- end
-end
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb b/vendor/rails/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb
deleted file mode 100644
index dfa4afc6..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb
+++ /dev/null
@@ -1,122 +0,0 @@
-require 'xmlrpc/marshal'
-require 'action_web_service/client/xmlrpc_client'
-
-module XMLRPC # :nodoc:
- class FaultException # :nodoc:
- alias :message :faultString
- end
-
- class Create
- def wrong_type(value)
- if BigDecimal === value
- [true, value.to_f]
- else
- false
- end
- end
- end
-end
-
-module ActionWebService # :nodoc:
- module API # :nodoc:
- class Base # :nodoc:
- def self.xmlrpc_client(endpoint_uri, options={})
- ActionWebService::Client::XmlRpc.new self, endpoint_uri, options
- end
- end
- end
-
- module Protocol # :nodoc:
- module XmlRpc # :nodoc:
- def self.included(base)
- base.register_protocol(XmlRpcProtocol)
- end
-
- class XmlRpcProtocol < AbstractProtocol # :nodoc:
- def self.create(controller)
- XmlRpcProtocol.new
- end
-
- def decode_action_pack_request(action_pack_request)
- service_name = action_pack_request.parameters['action']
- decode_request(action_pack_request.raw_post, service_name)
- end
-
- def decode_request(raw_request, service_name)
- method_name, params = XMLRPC::Marshal.load_call(raw_request)
- Request.new(self, method_name, params, service_name)
- rescue
- return nil
- end
-
- def encode_request(method_name, params, param_types)
- if param_types
- params = params.dup
- param_types.each_with_index{ |type, i| params[i] = value_to_xmlrpc_wire_format(params[i], type) }
- end
- XMLRPC::Marshal.dump_call(method_name, *params)
- end
-
- def decode_response(raw_response)
- [nil, XMLRPC::Marshal.load_response(raw_response)]
- end
-
- def encode_response(method_name, return_value, return_type, protocol_options={})
- if return_value && return_type
- return_value = value_to_xmlrpc_wire_format(return_value, return_type)
- end
- return_value = false if return_value.nil?
- raw_response = XMLRPC::Marshal.dump_response(return_value)
- Response.new(raw_response, 'text/xml', return_value)
- end
-
- def encode_multicall_response(responses, protocol_options={})
- result = responses.map do |return_value, return_type|
- if return_value && return_type
- return_value = value_to_xmlrpc_wire_format(return_value, return_type)
- return_value = [return_value] unless return_value.nil?
- end
- return_value = false if return_value.nil?
- return_value
- end
- raw_response = XMLRPC::Marshal.dump_response(result)
- Response.new(raw_response, 'text/xml', result)
- end
-
- def protocol_client(api, protocol_name, endpoint_uri, options={})
- return nil unless protocol_name == :xmlrpc
- ActionWebService::Client::XmlRpc.new(api, endpoint_uri, options)
- end
-
- def value_to_xmlrpc_wire_format(value, value_type)
- if value_type.array?
- value.map{ |val| value_to_xmlrpc_wire_format(val, value_type.element_type) }
- else
- if value.is_a?(ActionWebService::Struct)
- struct = {}
- value.class.members.each do |name, type|
- member_value = value[name]
- next if member_value.nil?
- struct[name.to_s] = value_to_xmlrpc_wire_format(member_value, type)
- end
- struct
- elsif value.is_a?(ActiveRecord::Base)
- struct = {}
- value.attributes.each do |key, member_value|
- next if member_value.nil?
- struct[key.to_s] = member_value
- end
- struct
- elsif value.is_a?(ActionWebService::Base64)
- XMLRPC::Base64.new(value)
- elsif value.is_a?(Exception) && !value.is_a?(XMLRPC::FaultException)
- XMLRPC::FaultException.new(2, value.message)
- else
- value
- end
- end
- end
- end
- end
- end
-end
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/scaffolding.rb b/vendor/rails/actionwebservice/lib/action_web_service/scaffolding.rb
deleted file mode 100644
index f94a7ee9..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/scaffolding.rb
+++ /dev/null
@@ -1,283 +0,0 @@
-require 'benchmark'
-require 'pathname'
-
-module ActionWebService
- module Scaffolding # :nodoc:
- class ScaffoldingError < ActionWebServiceError # :nodoc:
- end
-
- def self.included(base)
- base.extend(ClassMethods)
- end
-
- # Web service invocation scaffolding provides a way to quickly invoke web service methods in a controller. The
- # generated scaffold actions have default views to let you enter the method parameters and view the
- # results.
- #
- # Example:
- #
- # class ApiController < ActionController
- # web_service_scaffold :invoke
- # end
- #
- # This example generates an +invoke+ action in the +ApiController+ that you can navigate to from
- # your browser, select the API method, enter its parameters, and perform the invocation.
- #
- # If you want to customize the default views, create the following views in "app/views":
- #
- # * action_name/methods.erb
- # * action_name/parameters.erb
- # * action_name/result.erb
- # * action_name/layout.erb
- #
- # Where action_name is the name of the action you gave to ClassMethods#web_service_scaffold.
- #
- # You can use the default views in RAILS_DIR/lib/action_web_service/templates/scaffolds as
- # a guide.
- module ClassMethods
- # Generates web service invocation scaffolding for the current controller. The given action name
- # can then be used as the entry point for invoking API methods from a web browser.
- def web_service_scaffold(action_name)
- add_template_helper(Helpers)
- module_eval <<-"end_eval", __FILE__, __LINE__ + 1
- def #{action_name}
- if request.method == :get
- setup_invocation_assigns
- render_invocation_scaffold 'methods'
- end
- end
-
- def #{action_name}_method_params
- if request.method == :get
- setup_invocation_assigns
- render_invocation_scaffold 'parameters'
- end
- end
-
- def #{action_name}_submit
- if request.method == :post
- setup_invocation_assigns
- protocol_name = params['protocol'] ? params['protocol'].to_sym : :soap
- case protocol_name
- when :soap
- @protocol = Protocol::Soap::SoapProtocol.create(self)
- when :xmlrpc
- @protocol = Protocol::XmlRpc::XmlRpcProtocol.create(self)
- end
- bm = Benchmark.measure do
- @protocol.register_api(@scaffold_service.api)
- post_params = params['method_params'] ? params['method_params'].dup : nil
- params = []
- @scaffold_method.expects.each_with_index do |spec, i|
- params << post_params[i.to_s]
- end if @scaffold_method.expects
- params = @scaffold_method.cast_expects(params)
- method_name = public_method_name(@scaffold_service.name, @scaffold_method.public_name)
- @method_request_xml = @protocol.encode_request(method_name, params, @scaffold_method.expects)
- new_request = @protocol.encode_action_pack_request(@scaffold_service.name, @scaffold_method.public_name, @method_request_xml)
- prepare_request(new_request, @scaffold_service.name, @scaffold_method.public_name)
- self.request = new_request
- if @scaffold_container.dispatching_mode != :direct
- request.parameters['action'] = @scaffold_service.name
- end
- dispatch_web_service_request
- @method_response_xml = response.body
- method_name, obj = @protocol.decode_response(@method_response_xml)
- return if handle_invocation_exception(obj)
- @method_return_value = @scaffold_method.cast_returns(obj)
- end
- @method_elapsed = bm.real
- add_instance_variables_to_assigns
- reset_invocation_response
- render_invocation_scaffold 'result'
- end
- end
-
- private
- def setup_invocation_assigns
- @scaffold_class = self.class
- @scaffold_action_name = "#{action_name}"
- @scaffold_container = WebServiceModel::Container.new(self)
- if params['service'] && params['method']
- @scaffold_service = @scaffold_container.services.find{ |x| x.name == params['service'] }
- @scaffold_method = @scaffold_service.api_methods[params['method']]
- end
- add_instance_variables_to_assigns
- end
-
- def render_invocation_scaffold(action)
- customized_template = "\#{self.class.controller_path}/#{action_name}/\#{action}"
- default_template = scaffold_path(action)
- if template_exists?(customized_template)
- content = @template.render :file => customized_template
- else
- content = @template.render :file => default_template
- end
- @template.instance_variable_set("@content_for_layout", content)
- if self.active_layout.nil?
- render :file => scaffold_path("layout")
- else
- render :file => self.active_layout
- end
- end
-
- def scaffold_path(template_name)
- File.dirname(__FILE__) + "/templates/scaffolds/" + template_name + ".erb"
- end
-
- def reset_invocation_response
- erase_render_results
- response.headers = ::ActionController::AbstractResponse::DEFAULT_HEADERS.merge("cookie" => [])
- end
-
- def public_method_name(service_name, method_name)
- if web_service_dispatching_mode == :layered && @protocol.is_a?(ActionWebService::Protocol::XmlRpc::XmlRpcProtocol)
- service_name + '.' + method_name
- else
- method_name
- end
- end
-
- def prepare_request(new_request, service_name, method_name)
- new_request.parameters.update(request.parameters)
- request.env.each{ |k, v| new_request.env[k] = v unless new_request.env.has_key?(k) }
- if web_service_dispatching_mode == :layered && @protocol.is_a?(ActionWebService::Protocol::Soap::SoapProtocol)
- new_request.env['HTTP_SOAPACTION'] = "/\#{controller_name()}/\#{service_name}/\#{method_name}"
- end
- end
-
- def handle_invocation_exception(obj)
- exception = nil
- if obj.respond_to?(:detail) && obj.detail.respond_to?(:cause) && obj.detail.cause.is_a?(Exception)
- exception = obj.detail.cause
- elsif obj.is_a?(XMLRPC::FaultException)
- exception = obj
- end
- return unless exception
- reset_invocation_response
- rescue_action(exception)
- true
- end
- end_eval
- end
- end
-
- module Helpers # :nodoc:
- def method_parameter_input_fields(method, type, field_name_base, idx, was_structured=false)
- if type.array?
- return content_tag('em', "Typed array input fields not supported yet (#{type.name})")
- end
- if type.structured?
- return content_tag('em', "Nested structural types not supported yet (#{type.name})") if was_structured
- parameters = ""
- type.each_member do |member_name, member_type|
- label = method_parameter_label(member_name, member_type)
- nested_content = method_parameter_input_fields(
- method,
- member_type,
- "#{field_name_base}[#{idx}][#{member_name}]",
- idx,
- true)
- if member_type.custom?
- parameters << content_tag('li', label)
- parameters << content_tag('ul', nested_content)
- else
- parameters << content_tag('li', label + ' ' + nested_content)
- end
- end
- content_tag('ul', parameters)
- else
- # If the data source was structured previously we already have the index set
- field_name_base = "#{field_name_base}[#{idx}]" unless was_structured
-
- case type.type
- when :int
- text_field_tag "#{field_name_base}"
- when :string
- text_field_tag "#{field_name_base}"
- when :base64
- text_area_tag "#{field_name_base}", nil, :size => "40x5"
- when :bool
- radio_button_tag("#{field_name_base}", "true") + " True" +
- radio_button_tag("#{field_name_base}", "false") + "False"
- when :float
- text_field_tag "#{field_name_base}"
- when :time, :datetime
- time = Time.now
- i = 0
- %w|year month day hour minute second|.map do |name|
- i += 1
- send("select_#{name}", time, :prefix => "#{field_name_base}[#{i}]", :discard_type => true)
- end.join
- when :date
- date = Date.today
- i = 0
- %w|year month day|.map do |name|
- i += 1
- send("select_#{name}", date, :prefix => "#{field_name_base}[#{i}]", :discard_type => true)
- end.join
- end
- end
- end
-
- def method_parameter_label(name, type)
- name.to_s.capitalize + ' (' + type.human_name(false) + ')'
- end
-
- def service_method_list(service)
- action = @scaffold_action_name + '_method_params'
- methods = service.api_methods_full.map do |desc, name|
- content_tag("li", link_to(desc, :action => action, :service => service.name, :method => name))
- end
- content_tag("ul", methods.join("\n"))
- end
- end
-
- module WebServiceModel # :nodoc:
- class Container # :nodoc:
- attr :services
- attr :dispatching_mode
-
- def initialize(real_container)
- @real_container = real_container
- @dispatching_mode = @real_container.class.web_service_dispatching_mode
- @services = []
- if @dispatching_mode == :direct
- @services << Service.new(@real_container.controller_name, @real_container)
- else
- @real_container.class.web_services.each do |name, obj|
- @services << Service.new(name, @real_container.instance_eval{ web_service_object(name) })
- end
- end
- end
- end
-
- class Service # :nodoc:
- attr :name
- attr :object
- attr :api
- attr :api_methods
- attr :api_methods_full
-
- def initialize(name, real_service)
- @name = name.to_s
- @object = real_service
- @api = @object.class.web_service_api
- if @api.nil?
- raise ScaffoldingError, "No web service API attached to #{object.class}"
- end
- @api_methods = {}
- @api_methods_full = []
- @api.api_methods.each do |name, method|
- @api_methods[method.public_name.to_s] = method
- @api_methods_full << [method.to_s, method.public_name.to_s]
- end
- end
-
- def to_s
- self.name.camelize
- end
- end
- end
- end
-end
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/struct.rb b/vendor/rails/actionwebservice/lib/action_web_service/struct.rb
deleted file mode 100644
index 00eafc16..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/struct.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-module ActionWebService
- # To send structured types across the wire, derive from ActionWebService::Struct,
- # and use +member+ to declare structure members.
- #
- # ActionWebService::Struct should be used in method signatures when you want to accept or return
- # structured types that have no Active Record model class representations, or you don't
- # want to expose your entire Active Record model to remote callers.
- #
- # === Example
- #
- # class Person < ActionWebService::Struct
- # member :id, :int
- # member :firstnames, [:string]
- # member :lastname, :string
- # member :email, :string
- # end
- # person = Person.new(:id => 5, :firstname => 'john', :lastname => 'doe')
- #
- # Active Record model classes are already implicitly supported in method
- # signatures.
- class Struct
- # If a Hash is given as argument to an ActionWebService::Struct constructor,
- # it can contain initial values for the structure member.
- def initialize(values={})
- if values.is_a?(Hash)
- values.map{|k,v| __send__('%s=' % k.to_s, v)}
- end
- end
-
- # The member with the given name
- def [](name)
- send(name.to_s)
- end
-
- # Iterates through each member
- def each_pair(&block)
- self.class.members.each do |name, type|
- yield name, self.__send__(name)
- end
- end
-
- class << self
- # Creates a structure member with the specified +name+ and +type+. Generates
- # accessor methods for reading and writing the member value.
- def member(name, type)
- name = name.to_sym
- type = ActionWebService::SignatureTypes.canonical_signature_entry({ name => type }, 0)
- write_inheritable_hash("struct_members", name => type)
- class_eval <<-END
- def #{name}; @#{name}; end
- def #{name}=(value); @#{name} = value; end
- END
- end
-
- def members # :nodoc:
- read_inheritable_attribute("struct_members") || {}
- end
-
- def member_type(name) # :nodoc:
- members[name.to_sym]
- end
- end
- end
-end
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/support/class_inheritable_options.rb b/vendor/rails/actionwebservice/lib/action_web_service/support/class_inheritable_options.rb
deleted file mode 100644
index 4d1c2ed4..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/support/class_inheritable_options.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-class Class # :nodoc:
- def class_inheritable_option(sym, default_value=nil)
- write_inheritable_attribute sym, default_value
- class_eval <<-EOS
- def self.#{sym}(value=nil)
- if !value.nil?
- write_inheritable_attribute(:#{sym}, value)
- else
- read_inheritable_attribute(:#{sym})
- end
- end
-
- def self.#{sym}=(value)
- write_inheritable_attribute(:#{sym}, value)
- end
-
- def #{sym}
- self.class.#{sym}
- end
-
- def #{sym}=(value)
- self.class.#{sym} = value
- end
- EOS
- end
-end
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/support/signature_types.rb b/vendor/rails/actionwebservice/lib/action_web_service/support/signature_types.rb
deleted file mode 100644
index 66c86bf6..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/support/signature_types.rb
+++ /dev/null
@@ -1,226 +0,0 @@
-module ActionWebService # :nodoc:
- # Action Web Service supports the following base types in a signature:
- #
- # [:int] Represents an integer value, will be cast to an integer using Integer(value)
- # [:string] Represents a string value, will be cast to an string using the to_s method on an object
- # [:base64] Represents a Base 64 value, will contain the binary bytes of a Base 64 value sent by the caller
- # [:bool] Represents a boolean value, whatever is passed will be cast to boolean (true, '1', 'true', 'y', 'yes' are taken to represent true; false, '0', 'false', 'n', 'no' and nil represent false)
- # [:float] Represents a floating point value, will be cast to a float using Float(value)
- # [:time] Represents a timestamp, will be cast to a Time object
- # [:datetime] Represents a timestamp, will be cast to a DateTime object
- # [:date] Represents a date, will be cast to a Date object
- #
- # For structured types, you'll need to pass in the Class objects of
- # ActionWebService::Struct and ActiveRecord::Base derivatives.
- module SignatureTypes
- def canonical_signature(signature) # :nodoc:
- return nil if signature.nil?
- unless signature.is_a?(Array)
- raise(ActionWebServiceError, "Expected signature to be an Array")
- end
- i = -1
- signature.map{ |spec| canonical_signature_entry(spec, i += 1) }
- end
-
- def canonical_signature_entry(spec, i) # :nodoc:
- orig_spec = spec
- name = "param#{i}"
- if spec.is_a?(Hash)
- name, spec = spec.keys.first, spec.values.first
- end
- type = spec
- if spec.is_a?(Array)
- ArrayType.new(orig_spec, canonical_signature_entry(spec[0], 0), name)
- else
- type = canonical_type(type)
- if type.is_a?(Symbol)
- BaseType.new(orig_spec, type, name)
- else
- StructuredType.new(orig_spec, type, name)
- end
- end
- end
-
- def canonical_type(type) # :nodoc:
- type_name = symbol_name(type) || class_to_type_name(type)
- type = type_name || type
- return canonical_type_name(type) if type.is_a?(Symbol)
- type
- end
-
- def canonical_type_name(name) # :nodoc:
- name = name.to_sym
- case name
- when :int, :integer, :fixnum, :bignum
- :int
- when :string, :text
- :string
- when :base64, :binary
- :base64
- when :bool, :boolean
- :bool
- when :float, :double
- :float
- when :decimal
- :decimal
- when :time, :timestamp
- :time
- when :datetime
- :datetime
- when :date
- :date
- else
- raise(TypeError, "#{name} is not a valid base type")
- end
- end
-
- def canonical_type_class(type) # :nodoc:
- type = canonical_type(type)
- type.is_a?(Symbol) ? type_name_to_class(type) : type
- end
-
- def symbol_name(name) # :nodoc:
- return name.to_sym if name.is_a?(Symbol) || name.is_a?(String)
- nil
- end
-
- def class_to_type_name(klass) # :nodoc:
- klass = klass.class unless klass.is_a?(Class)
- if derived_from?(Integer, klass) || derived_from?(Fixnum, klass) || derived_from?(Bignum, klass)
- :int
- elsif klass == String
- :string
- elsif klass == Base64
- :base64
- elsif klass == TrueClass || klass == FalseClass
- :bool
- elsif derived_from?(Float, klass) || derived_from?(Precision, klass) || derived_from?(Numeric, klass)
- :float
- elsif klass == Time
- :time
- elsif klass == DateTime
- :datetime
- elsif klass == Date
- :date
- else
- nil
- end
- end
-
- def type_name_to_class(name) # :nodoc:
- case canonical_type_name(name)
- when :int
- Integer
- when :string
- String
- when :base64
- Base64
- when :bool
- TrueClass
- when :float
- Float
- when :decimal
- BigDecimal
- when :time
- Time
- when :date
- Date
- when :datetime
- DateTime
- else
- nil
- end
- end
-
- def derived_from?(ancestor, child) # :nodoc:
- child.ancestors.include?(ancestor)
- end
-
- module_function :type_name_to_class
- module_function :class_to_type_name
- module_function :symbol_name
- module_function :canonical_type_class
- module_function :canonical_type_name
- module_function :canonical_type
- module_function :canonical_signature_entry
- module_function :canonical_signature
- module_function :derived_from?
- end
-
- class BaseType # :nodoc:
- include SignatureTypes
-
- attr :spec
- attr :type
- attr :type_class
- attr :name
-
- def initialize(spec, type, name)
- @spec = spec
- @type = canonical_type(type)
- @type_class = canonical_type_class(@type)
- @name = name
- end
-
- def custom?
- false
- end
-
- def array?
- false
- end
-
- def structured?
- false
- end
-
- def human_name(show_name=true)
- type_type = array? ? element_type.type.to_s : self.type.to_s
- str = array? ? (type_type + '[]') : type_type
- show_name ? (str + " " + name.to_s) : str
- end
- end
-
- class ArrayType < BaseType # :nodoc:
- attr :element_type
-
- def initialize(spec, element_type, name)
- super(spec, Array, name)
- @element_type = element_type
- end
-
- def custom?
- true
- end
-
- def array?
- true
- end
- end
-
- class StructuredType < BaseType # :nodoc:
- def each_member
- if @type_class.respond_to?(:members)
- @type_class.members.each do |name, type|
- yield name, type
- end
- elsif @type_class.respond_to?(:columns)
- i = -1
- @type_class.columns.each do |column|
- yield column.name, canonical_signature_entry(column.type, i += 1)
- end
- end
- end
-
- def custom?
- true
- end
-
- def structured?
- true
- end
- end
-
- class Base64 < String # :nodoc:
- end
-end
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/layout.erb b/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/layout.erb
deleted file mode 100644
index 167613f6..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/layout.erb
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
- <%= @scaffold_class.wsdl_service_name %> Web Service
-
-
-
-
-<%= @content_for_layout %>
-
-
-
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/layout.rhtml b/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/layout.rhtml
deleted file mode 100644
index e69de29b..00000000
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/methods.erb b/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/methods.erb
deleted file mode 100644
index 60dfe23f..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/methods.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-<% @scaffold_container.services.each do |service| %>
-
-
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/result.rhtml b/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/result.rhtml
deleted file mode 100644
index e69de29b..00000000
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/test_invoke.rb b/vendor/rails/actionwebservice/lib/action_web_service/test_invoke.rb
deleted file mode 100644
index 7e714c94..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/test_invoke.rb
+++ /dev/null
@@ -1,110 +0,0 @@
-require 'test/unit'
-
-module Test # :nodoc:
- module Unit # :nodoc:
- class TestCase # :nodoc:
- private
- # invoke the specified API method
- def invoke_direct(method_name, *args)
- prepare_request('api', 'api', method_name, *args)
- @controller.process(@request, @response)
- decode_rpc_response
- end
- alias_method :invoke, :invoke_direct
-
- # invoke the specified API method on the specified service
- def invoke_delegated(service_name, method_name, *args)
- prepare_request(service_name.to_s, service_name, method_name, *args)
- @controller.process(@request, @response)
- decode_rpc_response
- end
-
- # invoke the specified layered API method on the correct service
- def invoke_layered(service_name, method_name, *args)
- prepare_request('api', service_name, method_name, *args)
- @controller.process(@request, @response)
- decode_rpc_response
- end
-
- # ---------------------- internal ---------------------------
-
- def prepare_request(action, service_name, api_method_name, *args)
- @request.recycle!
- @request.request_parameters['action'] = action
- @request.env['REQUEST_METHOD'] = 'POST'
- @request.env['HTTP_CONTENT_TYPE'] = 'text/xml'
- @request.env['RAW_POST_DATA'] = encode_rpc_call(service_name, api_method_name, *args)
- case protocol
- when ActionWebService::Protocol::Soap::SoapProtocol
- soap_action = "/#{@controller.controller_name}/#{service_name}/#{public_method_name(service_name, api_method_name)}"
- @request.env['HTTP_SOAPACTION'] = soap_action
- when ActionWebService::Protocol::XmlRpc::XmlRpcProtocol
- @request.env.delete('HTTP_SOAPACTION')
- end
- end
-
- def encode_rpc_call(service_name, api_method_name, *args)
- case @controller.web_service_dispatching_mode
- when :direct
- api = @controller.class.web_service_api
- when :delegated, :layered
- api = @controller.web_service_object(service_name.to_sym).class.web_service_api
- end
- protocol.register_api(api)
- method = api.api_methods[api_method_name.to_sym]
- raise ArgumentError, "wrong number of arguments for rpc call (#{args.length} for #{method.expects.length})" if method && method.expects && args.length != method.expects.length
- protocol.encode_request(public_method_name(service_name, api_method_name), args.dup, method.expects)
- end
-
- def decode_rpc_response
- public_method_name, return_value = protocol.decode_response(@response.body)
- exception = is_exception?(return_value)
- raise exception if exception
- return_value
- end
-
- def public_method_name(service_name, api_method_name)
- public_name = service_api(service_name).public_api_method_name(api_method_name)
- if @controller.web_service_dispatching_mode == :layered && protocol.is_a?(ActionWebService::Protocol::XmlRpc::XmlRpcProtocol)
- '%s.%s' % [service_name.to_s, public_name]
- else
- public_name
- end
- end
-
- def service_api(service_name)
- case @controller.web_service_dispatching_mode
- when :direct
- @controller.class.web_service_api
- when :delegated, :layered
- @controller.web_service_object(service_name.to_sym).class.web_service_api
- end
- end
-
- def protocol
- if @protocol.nil?
- @protocol ||= ActionWebService::Protocol::Soap::SoapProtocol.create(@controller)
- else
- case @protocol
- when :xmlrpc
- @protocol = ActionWebService::Protocol::XmlRpc::XmlRpcProtocol.create(@controller)
- when :soap
- @protocol = ActionWebService::Protocol::Soap::SoapProtocol.create(@controller)
- else
- @protocol
- end
- end
- end
-
- def is_exception?(obj)
- case protocol
- when :soap, ActionWebService::Protocol::Soap::SoapProtocol
- (obj.respond_to?(:detail) && obj.detail.respond_to?(:cause) && \
- obj.detail.cause.is_a?(Exception)) ? obj.detail.cause : nil
- when :xmlrpc, ActionWebService::Protocol::XmlRpc::XmlRpcProtocol
- obj.is_a?(XMLRPC::FaultException) ? obj : nil
- end
- end
- end
- end
-end
diff --git a/vendor/rails/actionwebservice/lib/action_web_service/version.rb b/vendor/rails/actionwebservice/lib/action_web_service/version.rb
deleted file mode 100644
index a1b3d592..00000000
--- a/vendor/rails/actionwebservice/lib/action_web_service/version.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-module ActionWebService
- module VERSION #:nodoc:
- MAJOR = 1
- MINOR = 2
- TINY = 5
-
- STRING = [MAJOR, MINOR, TINY].join('.')
- end
-end
diff --git a/vendor/rails/actionwebservice/lib/actionwebservice.rb b/vendor/rails/actionwebservice/lib/actionwebservice.rb
deleted file mode 100644
index 25e3aa8e..00000000
--- a/vendor/rails/actionwebservice/lib/actionwebservice.rb
+++ /dev/null
@@ -1 +0,0 @@
-require 'action_web_service'
diff --git a/vendor/rails/actionwebservice/setup.rb b/vendor/rails/actionwebservice/setup.rb
deleted file mode 100644
index aeef0d10..00000000
--- a/vendor/rails/actionwebservice/setup.rb
+++ /dev/null
@@ -1,1379 +0,0 @@
-#
-# setup.rb
-#
-# Copyright (c) 2000-2004 Minero Aoki
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# Note: Originally licensed under LGPL v2+. Using MIT license for Rails
-# with permission of Minero Aoki.
-
-#
-
-unless Enumerable.method_defined?(:map) # Ruby 1.4.6
- module Enumerable
- alias map collect
- end
-end
-
-unless File.respond_to?(:read) # Ruby 1.6
- def File.read(fname)
- open(fname) {|f|
- return f.read
- }
- end
-end
-
-def File.binread(fname)
- open(fname, 'rb') {|f|
- return f.read
- }
-end
-
-# for corrupted windows stat(2)
-def File.dir?(path)
- File.directory?((path[-1,1] == '/') ? path : path + '/')
-end
-
-
-class SetupError < StandardError; end
-
-def setup_rb_error(msg)
- raise SetupError, msg
-end
-
-#
-# Config
-#
-
-if arg = ARGV.detect {|arg| /\A--rbconfig=/ =~ arg }
- ARGV.delete(arg)
- require arg.split(/=/, 2)[1]
- $".push 'rbconfig.rb'
-else
- require 'rbconfig'
-end
-
-def multipackage_install?
- FileTest.directory?(File.dirname($0) + '/packages')
-end
-
-
-class ConfigItem
- def initialize(name, template, default, desc)
- @name = name.freeze
- @template = template
- @value = default
- @default = default.dup.freeze
- @description = desc
- end
-
- attr_reader :name
- attr_reader :description
-
- attr_accessor :default
- alias help_default default
-
- def help_opt
- "--#{@name}=#{@template}"
- end
-
- def value
- @value
- end
-
- def eval(table)
- @value.gsub(%r<\$([^/]+)>) { table[$1] }
- end
-
- def set(val)
- @value = check(val)
- end
-
- private
-
- def check(val)
- setup_rb_error "config: --#{name} requires argument" unless val
- val
- end
-end
-
-class BoolItem < ConfigItem
- def config_type
- 'bool'
- end
-
- def help_opt
- "--#{@name}"
- end
-
- private
-
- def check(val)
- return 'yes' unless val
- unless /\A(y(es)?|n(o)?|t(rue)?|f(alse))\z/i =~ val
- setup_rb_error "config: --#{@name} accepts only yes/no for argument"
- end
- (/\Ay(es)?|\At(rue)/i =~ value) ? 'yes' : 'no'
- end
-end
-
-class PathItem < ConfigItem
- def config_type
- 'path'
- end
-
- private
-
- def check(path)
- setup_rb_error "config: --#{@name} requires argument" unless path
- path[0,1] == '$' ? path : File.expand_path(path)
- end
-end
-
-class ProgramItem < ConfigItem
- def config_type
- 'program'
- end
-end
-
-class SelectItem < ConfigItem
- def initialize(name, template, default, desc)
- super
- @ok = template.split('/')
- end
-
- def config_type
- 'select'
- end
-
- private
-
- def check(val)
- unless @ok.include?(val.strip)
- setup_rb_error "config: use --#{@name}=#{@template} (#{val})"
- end
- val.strip
- end
-end
-
-class PackageSelectionItem < ConfigItem
- def initialize(name, template, default, help_default, desc)
- super name, template, default, desc
- @help_default = help_default
- end
-
- attr_reader :help_default
-
- def config_type
- 'package'
- end
-
- private
-
- def check(val)
- unless File.dir?("packages/#{val}")
- setup_rb_error "config: no such package: #{val}"
- end
- val
- end
-end
-
-class ConfigTable_class
-
- def initialize(items)
- @items = items
- @table = {}
- items.each do |i|
- @table[i.name] = i
- end
- ALIASES.each do |ali, name|
- @table[ali] = @table[name]
- end
- end
-
- include Enumerable
-
- def each(&block)
- @items.each(&block)
- end
-
- def key?(name)
- @table.key?(name)
- end
-
- def lookup(name)
- @table[name] or raise ArgumentError, "no such config item: #{name}"
- end
-
- def add(item)
- @items.push item
- @table[item.name] = item
- end
-
- def remove(name)
- item = lookup(name)
- @items.delete_if {|i| i.name == name }
- @table.delete_if {|name, i| i.name == name }
- item
- end
-
- def new
- dup()
- end
-
- def savefile
- '.config'
- end
-
- def load
- begin
- t = dup()
- File.foreach(savefile()) do |line|
- k, v = *line.split(/=/, 2)
- t[k] = v.strip
- end
- t
- rescue Errno::ENOENT
- setup_rb_error $!.message + "#{File.basename($0)} config first"
- end
- end
-
- def save
- @items.each {|i| i.value }
- File.open(savefile(), 'w') {|f|
- @items.each do |i|
- f.printf "%s=%s\n", i.name, i.value if i.value
- end
- }
- end
-
- def [](key)
- lookup(key).eval(self)
- end
-
- def []=(key, val)
- lookup(key).set val
- end
-
-end
-
-c = ::Config::CONFIG
-
-rubypath = c['bindir'] + '/' + c['ruby_install_name']
-
-major = c['MAJOR'].to_i
-minor = c['MINOR'].to_i
-teeny = c['TEENY'].to_i
-version = "#{major}.#{minor}"
-
-# ruby ver. >= 1.4.4?
-newpath_p = ((major >= 2) or
- ((major == 1) and
- ((minor >= 5) or
- ((minor == 4) and (teeny >= 4)))))
-
-if c['rubylibdir']
- # V < 1.6.3
- _stdruby = c['rubylibdir']
- _siteruby = c['sitedir']
- _siterubyver = c['sitelibdir']
- _siterubyverarch = c['sitearchdir']
-elsif newpath_p
- # 1.4.4 <= V <= 1.6.3
- _stdruby = "$prefix/lib/ruby/#{version}"
- _siteruby = c['sitedir']
- _siterubyver = "$siteruby/#{version}"
- _siterubyverarch = "$siterubyver/#{c['arch']}"
-else
- # V < 1.4.4
- _stdruby = "$prefix/lib/ruby/#{version}"
- _siteruby = "$prefix/lib/ruby/#{version}/site_ruby"
- _siterubyver = _siteruby
- _siterubyverarch = "$siterubyver/#{c['arch']}"
-end
-libdir = '-* dummy libdir *-'
-stdruby = '-* dummy rubylibdir *-'
-siteruby = '-* dummy site_ruby *-'
-siterubyver = '-* dummy site_ruby version *-'
-parameterize = lambda {|path|
- path.sub(/\A#{Regexp.quote(c['prefix'])}/, '$prefix')\
- .sub(/\A#{Regexp.quote(libdir)}/, '$libdir')\
- .sub(/\A#{Regexp.quote(stdruby)}/, '$stdruby')\
- .sub(/\A#{Regexp.quote(siteruby)}/, '$siteruby')\
- .sub(/\A#{Regexp.quote(siterubyver)}/, '$siterubyver')
-}
-libdir = parameterize.call(c['libdir'])
-stdruby = parameterize.call(_stdruby)
-siteruby = parameterize.call(_siteruby)
-siterubyver = parameterize.call(_siterubyver)
-siterubyverarch = parameterize.call(_siterubyverarch)
-
-if arg = c['configure_args'].split.detect {|arg| /--with-make-prog=/ =~ arg }
- makeprog = arg.sub(/'/, '').split(/=/, 2)[1]
-else
- makeprog = 'make'
-end
-
-common_conf = [
- PathItem.new('prefix', 'path', c['prefix'],
- 'path prefix of target environment'),
- PathItem.new('bindir', 'path', parameterize.call(c['bindir']),
- 'the directory for commands'),
- PathItem.new('libdir', 'path', libdir,
- 'the directory for libraries'),
- PathItem.new('datadir', 'path', parameterize.call(c['datadir']),
- 'the directory for shared data'),
- PathItem.new('mandir', 'path', parameterize.call(c['mandir']),
- 'the directory for man pages'),
- PathItem.new('sysconfdir', 'path', parameterize.call(c['sysconfdir']),
- 'the directory for man pages'),
- PathItem.new('stdruby', 'path', stdruby,
- 'the directory for standard ruby libraries'),
- PathItem.new('siteruby', 'path', siteruby,
- 'the directory for version-independent aux ruby libraries'),
- PathItem.new('siterubyver', 'path', siterubyver,
- 'the directory for aux ruby libraries'),
- PathItem.new('siterubyverarch', 'path', siterubyverarch,
- 'the directory for aux ruby binaries'),
- PathItem.new('rbdir', 'path', '$siterubyver',
- 'the directory for ruby scripts'),
- PathItem.new('sodir', 'path', '$siterubyverarch',
- 'the directory for ruby extentions'),
- PathItem.new('rubypath', 'path', rubypath,
- 'the path to set to #! line'),
- ProgramItem.new('rubyprog', 'name', rubypath,
- 'the ruby program using for installation'),
- ProgramItem.new('makeprog', 'name', makeprog,
- 'the make program to compile ruby extentions'),
- SelectItem.new('shebang', 'all/ruby/never', 'ruby',
- 'shebang line (#!) editing mode'),
- BoolItem.new('without-ext', 'yes/no', 'no',
- 'does not compile/install ruby extentions')
-]
-class ConfigTable_class # open again
- ALIASES = {
- 'std-ruby' => 'stdruby',
- 'site-ruby-common' => 'siteruby', # For backward compatibility
- 'site-ruby' => 'siterubyver', # For backward compatibility
- 'bin-dir' => 'bindir',
- 'bin-dir' => 'bindir',
- 'rb-dir' => 'rbdir',
- 'so-dir' => 'sodir',
- 'data-dir' => 'datadir',
- 'ruby-path' => 'rubypath',
- 'ruby-prog' => 'rubyprog',
- 'ruby' => 'rubyprog',
- 'make-prog' => 'makeprog',
- 'make' => 'makeprog'
- }
-end
-multipackage_conf = [
- PackageSelectionItem.new('with', 'name,name...', '', 'ALL',
- 'package names that you want to install'),
- PackageSelectionItem.new('without', 'name,name...', '', 'NONE',
- 'package names that you do not want to install')
-]
-if multipackage_install?
- ConfigTable = ConfigTable_class.new(common_conf + multipackage_conf)
-else
- ConfigTable = ConfigTable_class.new(common_conf)
-end
-
-
-module MetaConfigAPI
-
- def eval_file_ifexist(fname)
- instance_eval File.read(fname), fname, 1 if File.file?(fname)
- end
-
- def config_names
- ConfigTable.map {|i| i.name }
- end
-
- def config?(name)
- ConfigTable.key?(name)
- end
-
- def bool_config?(name)
- ConfigTable.lookup(name).config_type == 'bool'
- end
-
- def path_config?(name)
- ConfigTable.lookup(name).config_type == 'path'
- end
-
- def value_config?(name)
- case ConfigTable.lookup(name).config_type
- when 'bool', 'path'
- true
- else
- false
- end
- end
-
- def add_config(item)
- ConfigTable.add item
- end
-
- def add_bool_config(name, default, desc)
- ConfigTable.add BoolItem.new(name, 'yes/no', default ? 'yes' : 'no', desc)
- end
-
- def add_path_config(name, default, desc)
- ConfigTable.add PathItem.new(name, 'path', default, desc)
- end
-
- def set_config_default(name, default)
- ConfigTable.lookup(name).default = default
- end
-
- def remove_config(name)
- ConfigTable.remove(name)
- end
-
-end
-
-
-#
-# File Operations
-#
-
-module FileOperations
-
- def mkdir_p(dirname, prefix = nil)
- dirname = prefix + File.expand_path(dirname) if prefix
- $stderr.puts "mkdir -p #{dirname}" if verbose?
- return if no_harm?
-
- # does not check '/'... it's too abnormal case
- dirs = File.expand_path(dirname).split(%r<(?=/)>)
- if /\A[a-z]:\z/i =~ dirs[0]
- disk = dirs.shift
- dirs[0] = disk + dirs[0]
- end
- dirs.each_index do |idx|
- path = dirs[0..idx].join('')
- Dir.mkdir path unless File.dir?(path)
- end
- end
-
- def rm_f(fname)
- $stderr.puts "rm -f #{fname}" if verbose?
- return if no_harm?
-
- if File.exist?(fname) or File.symlink?(fname)
- File.chmod 0777, fname
- File.unlink fname
- end
- end
-
- def rm_rf(dn)
- $stderr.puts "rm -rf #{dn}" if verbose?
- return if no_harm?
-
- Dir.chdir dn
- Dir.foreach('.') do |fn|
- next if fn == '.'
- next if fn == '..'
- if File.dir?(fn)
- verbose_off {
- rm_rf fn
- }
- else
- verbose_off {
- rm_f fn
- }
- end
- end
- Dir.chdir '..'
- Dir.rmdir dn
- end
-
- def move_file(src, dest)
- File.unlink dest if File.exist?(dest)
- begin
- File.rename src, dest
- rescue
- File.open(dest, 'wb') {|f| f.write File.binread(src) }
- File.chmod File.stat(src).mode, dest
- File.unlink src
- end
- end
-
- def install(from, dest, mode, prefix = nil)
- $stderr.puts "install #{from} #{dest}" if verbose?
- return if no_harm?
-
- realdest = prefix ? prefix + File.expand_path(dest) : dest
- realdest = File.join(realdest, File.basename(from)) if File.dir?(realdest)
- str = File.binread(from)
- if diff?(str, realdest)
- verbose_off {
- rm_f realdest if File.exist?(realdest)
- }
- File.open(realdest, 'wb') {|f|
- f.write str
- }
- File.chmod mode, realdest
-
- File.open("#{objdir_root()}/InstalledFiles", 'a') {|f|
- if prefix
- f.puts realdest.sub(prefix, '')
- else
- f.puts realdest
- end
- }
- end
- end
-
- def diff?(new_content, path)
- return true unless File.exist?(path)
- new_content != File.binread(path)
- end
-
- def command(str)
- $stderr.puts str if verbose?
- system str or raise RuntimeError, "'system #{str}' failed"
- end
-
- def ruby(str)
- command config('rubyprog') + ' ' + str
- end
-
- def make(task = '')
- command config('makeprog') + ' ' + task
- end
-
- def extdir?(dir)
- File.exist?(dir + '/MANIFEST')
- end
-
- def all_files_in(dirname)
- Dir.open(dirname) {|d|
- return d.select {|ent| File.file?("#{dirname}/#{ent}") }
- }
- end
-
- REJECT_DIRS = %w(
- CVS SCCS RCS CVS.adm .svn
- )
-
- def all_dirs_in(dirname)
- Dir.open(dirname) {|d|
- return d.select {|n| File.dir?("#{dirname}/#{n}") } - %w(. ..) - REJECT_DIRS
- }
- end
-
-end
-
-
-#
-# Main Installer
-#
-
-module HookUtils
-
- def run_hook(name)
- try_run_hook "#{curr_srcdir()}/#{name}" or
- try_run_hook "#{curr_srcdir()}/#{name}.rb"
- end
-
- def try_run_hook(fname)
- return false unless File.file?(fname)
- begin
- instance_eval File.read(fname), fname, 1
- rescue
- setup_rb_error "hook #{fname} failed:\n" + $!.message
- end
- true
- end
-
-end
-
-
-module HookScriptAPI
-
- def get_config(key)
- @config[key]
- end
-
- alias config get_config
-
- def set_config(key, val)
- @config[key] = val
- end
-
- #
- # srcdir/objdir (works only in the package directory)
- #
-
- #abstract srcdir_root
- #abstract objdir_root
- #abstract relpath
-
- def curr_srcdir
- "#{srcdir_root()}/#{relpath()}"
- end
-
- def curr_objdir
- "#{objdir_root()}/#{relpath()}"
- end
-
- def srcfile(path)
- "#{curr_srcdir()}/#{path}"
- end
-
- def srcexist?(path)
- File.exist?(srcfile(path))
- end
-
- def srcdirectory?(path)
- File.dir?(srcfile(path))
- end
-
- def srcfile?(path)
- File.file? srcfile(path)
- end
-
- def srcentries(path = '.')
- Dir.open("#{curr_srcdir()}/#{path}") {|d|
- return d.to_a - %w(. ..)
- }
- end
-
- def srcfiles(path = '.')
- srcentries(path).select {|fname|
- File.file?(File.join(curr_srcdir(), path, fname))
- }
- end
-
- def srcdirectories(path = '.')
- srcentries(path).select {|fname|
- File.dir?(File.join(curr_srcdir(), path, fname))
- }
- end
-
-end
-
-
-class ToplevelInstaller
-
- Version = '3.3.1'
- Copyright = 'Copyright (c) 2000-2004 Minero Aoki'
-
- TASKS = [
- [ 'all', 'do config, setup, then install' ],
- [ 'config', 'saves your configurations' ],
- [ 'show', 'shows current configuration' ],
- [ 'setup', 'compiles ruby extentions and others' ],
- [ 'install', 'installs files' ],
- [ 'clean', "does `make clean' for each extention" ],
- [ 'distclean',"does `make distclean' for each extention" ]
- ]
-
- def ToplevelInstaller.invoke
- instance().invoke
- end
-
- @singleton = nil
-
- def ToplevelInstaller.instance
- @singleton ||= new(File.dirname($0))
- @singleton
- end
-
- include MetaConfigAPI
-
- def initialize(ardir_root)
- @config = nil
- @options = { 'verbose' => true }
- @ardir = File.expand_path(ardir_root)
- end
-
- def inspect
- "#<#{self.class} #{__id__()}>"
- end
-
- def invoke
- run_metaconfigs
- case task = parsearg_global()
- when nil, 'all'
- @config = load_config('config')
- parsearg_config
- init_installers
- exec_config
- exec_setup
- exec_install
- else
- @config = load_config(task)
- __send__ "parsearg_#{task}"
- init_installers
- __send__ "exec_#{task}"
- end
- end
-
- def run_metaconfigs
- eval_file_ifexist "#{@ardir}/metaconfig"
- end
-
- def load_config(task)
- case task
- when 'config'
- ConfigTable.new
- when 'clean', 'distclean'
- if File.exist?(ConfigTable.savefile)
- then ConfigTable.load
- else ConfigTable.new
- end
- else
- ConfigTable.load
- end
- end
-
- def init_installers
- @installer = Installer.new(@config, @options, @ardir, File.expand_path('.'))
- end
-
- #
- # Hook Script API bases
- #
-
- def srcdir_root
- @ardir
- end
-
- def objdir_root
- '.'
- end
-
- def relpath
- '.'
- end
-
- #
- # Option Parsing
- #
-
- def parsearg_global
- valid_task = /\A(?:#{TASKS.map {|task,desc| task }.join '|'})\z/
-
- while arg = ARGV.shift
- case arg
- when /\A\w+\z/
- setup_rb_error "invalid task: #{arg}" unless valid_task =~ arg
- return arg
-
- when '-q', '--quiet'
- @options['verbose'] = false
-
- when '--verbose'
- @options['verbose'] = true
-
- when '-h', '--help'
- print_usage $stdout
- exit 0
-
- when '-v', '--version'
- puts "#{File.basename($0)} version #{Version}"
- exit 0
-
- when '--copyright'
- puts Copyright
- exit 0
-
- else
- setup_rb_error "unknown global option '#{arg}'"
- end
- end
-
- nil
- end
-
-
- def parsearg_no_options
- unless ARGV.empty?
- setup_rb_error "#{task}: unknown options: #{ARGV.join ' '}"
- end
- end
-
- alias parsearg_show parsearg_no_options
- alias parsearg_setup parsearg_no_options
- alias parsearg_clean parsearg_no_options
- alias parsearg_distclean parsearg_no_options
-
- def parsearg_config
- re = /\A--(#{ConfigTable.map {|i| i.name }.join('|')})(?:=(.*))?\z/
- @options['config-opt'] = []
-
- while i = ARGV.shift
- if /\A--?\z/ =~ i
- @options['config-opt'] = ARGV.dup
- break
- end
- m = re.match(i) or setup_rb_error "config: unknown option #{i}"
- name, value = *m.to_a[1,2]
- @config[name] = value
- end
- end
-
- def parsearg_install
- @options['no-harm'] = false
- @options['install-prefix'] = ''
- while a = ARGV.shift
- case a
- when /\A--no-harm\z/
- @options['no-harm'] = true
- when /\A--prefix=(.*)\z/
- path = $1
- path = File.expand_path(path) unless path[0,1] == '/'
- @options['install-prefix'] = path
- else
- setup_rb_error "install: unknown option #{a}"
- end
- end
- end
-
- def print_usage(out)
- out.puts 'Typical Installation Procedure:'
- out.puts " $ ruby #{File.basename $0} config"
- out.puts " $ ruby #{File.basename $0} setup"
- out.puts " # ruby #{File.basename $0} install (may require root privilege)"
- out.puts
- out.puts 'Detailed Usage:'
- out.puts " ruby #{File.basename $0} "
- out.puts " ruby #{File.basename $0} [] []"
-
- fmt = " %-24s %s\n"
- out.puts
- out.puts 'Global options:'
- out.printf fmt, '-q,--quiet', 'suppress message outputs'
- out.printf fmt, ' --verbose', 'output messages verbosely'
- out.printf fmt, '-h,--help', 'print this message'
- out.printf fmt, '-v,--version', 'print version and quit'
- out.printf fmt, ' --copyright', 'print copyright and quit'
- out.puts
- out.puts 'Tasks:'
- TASKS.each do |name, desc|
- out.printf fmt, name, desc
- end
-
- fmt = " %-24s %s [%s]\n"
- out.puts
- out.puts 'Options for CONFIG or ALL:'
- ConfigTable.each do |item|
- out.printf fmt, item.help_opt, item.description, item.help_default
- end
- out.printf fmt, '--rbconfig=path', 'rbconfig.rb to load',"running ruby's"
- out.puts
- out.puts 'Options for INSTALL:'
- out.printf fmt, '--no-harm', 'only display what to do if given', 'off'
- out.printf fmt, '--prefix=path', 'install path prefix', '$prefix'
- out.puts
- end
-
- #
- # Task Handlers
- #
-
- def exec_config
- @installer.exec_config
- @config.save # must be final
- end
-
- def exec_setup
- @installer.exec_setup
- end
-
- def exec_install
- @installer.exec_install
- end
-
- def exec_show
- ConfigTable.each do |i|
- printf "%-20s %s\n", i.name, i.value
- end
- end
-
- def exec_clean
- @installer.exec_clean
- end
-
- def exec_distclean
- @installer.exec_distclean
- end
-
-end
-
-
-class ToplevelInstallerMulti < ToplevelInstaller
-
- include HookUtils
- include HookScriptAPI
- include FileOperations
-
- def initialize(ardir)
- super
- @packages = all_dirs_in("#{@ardir}/packages")
- raise 'no package exists' if @packages.empty?
- end
-
- def run_metaconfigs
- eval_file_ifexist "#{@ardir}/metaconfig"
- @packages.each do |name|
- eval_file_ifexist "#{@ardir}/packages/#{name}/metaconfig"
- end
- end
-
- def init_installers
- @installers = {}
- @packages.each do |pack|
- @installers[pack] = Installer.new(@config, @options,
- "#{@ardir}/packages/#{pack}",
- "packages/#{pack}")
- end
-
- with = extract_selection(config('with'))
- without = extract_selection(config('without'))
- @selected = @installers.keys.select {|name|
- (with.empty? or with.include?(name)) \
- and not without.include?(name)
- }
- end
-
- def extract_selection(list)
- a = list.split(/,/)
- a.each do |name|
- setup_rb_error "no such package: #{name}" unless @installers.key?(name)
- end
- a
- end
-
- def print_usage(f)
- super
- f.puts 'Included packages:'
- f.puts ' ' + @packages.sort.join(' ')
- f.puts
- end
-
- #
- # multi-package metaconfig API
- #
-
- attr_reader :packages
-
- def declare_packages(list)
- raise 'package list is empty' if list.empty?
- list.each do |name|
- raise "directory packages/#{name} does not exist"\
- unless File.dir?("#{@ardir}/packages/#{name}")
- end
- @packages = list
- end
-
- #
- # Task Handlers
- #
-
- def exec_config
- run_hook 'pre-config'
- each_selected_installers {|inst| inst.exec_config }
- run_hook 'post-config'
- @config.save # must be final
- end
-
- def exec_setup
- run_hook 'pre-setup'
- each_selected_installers {|inst| inst.exec_setup }
- run_hook 'post-setup'
- end
-
- def exec_install
- run_hook 'pre-install'
- each_selected_installers {|inst| inst.exec_install }
- run_hook 'post-install'
- end
-
- def exec_clean
- rm_f ConfigTable.savefile
- run_hook 'pre-clean'
- each_selected_installers {|inst| inst.exec_clean }
- run_hook 'post-clean'
- end
-
- def exec_distclean
- rm_f ConfigTable.savefile
- run_hook 'pre-distclean'
- each_selected_installers {|inst| inst.exec_distclean }
- run_hook 'post-distclean'
- end
-
- #
- # lib
- #
-
- def each_selected_installers
- Dir.mkdir 'packages' unless File.dir?('packages')
- @selected.each do |pack|
- $stderr.puts "Processing the package `#{pack}' ..." if @options['verbose']
- Dir.mkdir "packages/#{pack}" unless File.dir?("packages/#{pack}")
- Dir.chdir "packages/#{pack}"
- yield @installers[pack]
- Dir.chdir '../..'
- end
- end
-
- def verbose?
- @options['verbose']
- end
-
- def no_harm?
- @options['no-harm']
- end
-
-end
-
-
-class Installer
-
- FILETYPES = %w( bin lib ext data )
-
- include HookScriptAPI
- include HookUtils
- include FileOperations
-
- def initialize(config, opt, srcroot, objroot)
- @config = config
- @options = opt
- @srcdir = File.expand_path(srcroot)
- @objdir = File.expand_path(objroot)
- @currdir = '.'
- end
-
- def inspect
- "#<#{self.class} #{File.basename(@srcdir)}>"
- end
-
- #
- # Hook Script API base methods
- #
-
- def srcdir_root
- @srcdir
- end
-
- def objdir_root
- @objdir
- end
-
- def relpath
- @currdir
- end
-
- #
- # configs/options
- #
-
- def no_harm?
- @options['no-harm']
- end
-
- def verbose?
- @options['verbose']
- end
-
- def verbose_off
- begin
- save, @options['verbose'] = @options['verbose'], false
- yield
- ensure
- @options['verbose'] = save
- end
- end
-
- #
- # TASK config
- #
-
- def exec_config
- exec_task_traverse 'config'
- end
-
- def config_dir_bin(rel)
- end
-
- def config_dir_lib(rel)
- end
-
- def config_dir_ext(rel)
- extconf if extdir?(curr_srcdir())
- end
-
- def extconf
- opt = @options['config-opt'].join(' ')
- command "#{config('rubyprog')} #{curr_srcdir()}/extconf.rb #{opt}"
- end
-
- def config_dir_data(rel)
- end
-
- #
- # TASK setup
- #
-
- def exec_setup
- exec_task_traverse 'setup'
- end
-
- def setup_dir_bin(rel)
- all_files_in(curr_srcdir()).each do |fname|
- adjust_shebang "#{curr_srcdir()}/#{fname}"
- end
- end
-
- def adjust_shebang(path)
- return if no_harm?
- tmpfile = File.basename(path) + '.tmp'
- begin
- File.open(path, 'rb') {|r|
- first = r.gets
- return unless File.basename(config('rubypath')) == 'ruby'
- return unless File.basename(first.sub(/\A\#!/, '').split[0]) == 'ruby'
- $stderr.puts "adjusting shebang: #{File.basename(path)}" if verbose?
- File.open(tmpfile, 'wb') {|w|
- w.print first.sub(/\A\#!\s*\S+/, '#! ' + config('rubypath'))
- w.write r.read
- }
- move_file tmpfile, File.basename(path)
- }
- ensure
- File.unlink tmpfile if File.exist?(tmpfile)
- end
- end
-
- def setup_dir_lib(rel)
- end
-
- def setup_dir_ext(rel)
- make if extdir?(curr_srcdir())
- end
-
- def setup_dir_data(rel)
- end
-
- #
- # TASK install
- #
-
- def exec_install
- rm_f 'InstalledFiles'
- exec_task_traverse 'install'
- end
-
- def install_dir_bin(rel)
- install_files collect_filenames_auto(), "#{config('bindir')}/#{rel}", 0755
- end
-
- def install_dir_lib(rel)
- install_files ruby_scripts(), "#{config('rbdir')}/#{rel}", 0644
- end
-
- def install_dir_ext(rel)
- return unless extdir?(curr_srcdir())
- install_files ruby_extentions('.'),
- "#{config('sodir')}/#{File.dirname(rel)}",
- 0555
- end
-
- def install_dir_data(rel)
- install_files collect_filenames_auto(), "#{config('datadir')}/#{rel}", 0644
- end
-
- def install_files(list, dest, mode)
- mkdir_p dest, @options['install-prefix']
- list.each do |fname|
- install fname, dest, mode, @options['install-prefix']
- end
- end
-
- def ruby_scripts
- collect_filenames_auto().select {|n| /\.rb\z/ =~ n }
- end
-
- # picked up many entries from cvs-1.11.1/src/ignore.c
- reject_patterns = %w(
- core RCSLOG tags TAGS .make.state
- .nse_depinfo #* .#* cvslog.* ,* .del-* *.olb
- *~ *.old *.bak *.BAK *.orig *.rej _$* *$
-
- *.org *.in .*
- )
- mapping = {
- '.' => '\.',
- '$' => '\$',
- '#' => '\#',
- '*' => '.*'
- }
- REJECT_PATTERNS = Regexp.new('\A(?:' +
- reject_patterns.map {|pat|
- pat.gsub(/[\.\$\#\*]/) {|ch| mapping[ch] }
- }.join('|') +
- ')\z')
-
- def collect_filenames_auto
- mapdir((existfiles() - hookfiles()).reject {|fname|
- REJECT_PATTERNS =~ fname
- })
- end
-
- def existfiles
- all_files_in(curr_srcdir()) | all_files_in('.')
- end
-
- def hookfiles
- %w( pre-%s post-%s pre-%s.rb post-%s.rb ).map {|fmt|
- %w( config setup install clean ).map {|t| sprintf(fmt, t) }
- }.flatten
- end
-
- def mapdir(filelist)
- filelist.map {|fname|
- if File.exist?(fname) # objdir
- fname
- else # srcdir
- File.join(curr_srcdir(), fname)
- end
- }
- end
-
- def ruby_extentions(dir)
- Dir.open(dir) {|d|
- ents = d.select {|fname| /\.#{::Config::CONFIG['DLEXT']}\z/ =~ fname }
- if ents.empty?
- setup_rb_error "no ruby extention exists: 'ruby #{$0} setup' first"
- end
- return ents
- }
- end
-
- #
- # TASK clean
- #
-
- def exec_clean
- exec_task_traverse 'clean'
- rm_f ConfigTable.savefile
- rm_f 'InstalledFiles'
- end
-
- def clean_dir_bin(rel)
- end
-
- def clean_dir_lib(rel)
- end
-
- def clean_dir_ext(rel)
- return unless extdir?(curr_srcdir())
- make 'clean' if File.file?('Makefile')
- end
-
- def clean_dir_data(rel)
- end
-
- #
- # TASK distclean
- #
-
- def exec_distclean
- exec_task_traverse 'distclean'
- rm_f ConfigTable.savefile
- rm_f 'InstalledFiles'
- end
-
- def distclean_dir_bin(rel)
- end
-
- def distclean_dir_lib(rel)
- end
-
- def distclean_dir_ext(rel)
- return unless extdir?(curr_srcdir())
- make 'distclean' if File.file?('Makefile')
- end
-
- #
- # lib
- #
-
- def exec_task_traverse(task)
- run_hook "pre-#{task}"
- FILETYPES.each do |type|
- if config('without-ext') == 'yes' and type == 'ext'
- $stderr.puts 'skipping ext/* by user option' if verbose?
- next
- end
- traverse task, type, "#{task}_dir_#{type}"
- end
- run_hook "post-#{task}"
- end
-
- def traverse(task, rel, mid)
- dive_into(rel) {
- run_hook "pre-#{task}"
- __send__ mid, rel.sub(%r[\A.*?(?:/|\z)], '')
- all_dirs_in(curr_srcdir()).each do |d|
- traverse task, "#{rel}/#{d}", mid
- end
- run_hook "post-#{task}"
- }
- end
-
- def dive_into(rel)
- return unless File.dir?("#{@srcdir}/#{rel}")
-
- dir = File.basename(rel)
- Dir.mkdir dir unless File.dir?(dir)
- prevdir = Dir.pwd
- Dir.chdir dir
- $stderr.puts '---> ' + rel if verbose?
- @currdir = rel
- yield
- Dir.chdir prevdir
- $stderr.puts '<--- ' + rel if verbose?
- @currdir = File.dirname(rel)
- end
-
-end
-
-
-if $0 == __FILE__
- begin
- if multipackage_install?
- ToplevelInstallerMulti.invoke
- else
- ToplevelInstaller.invoke
- end
- rescue SetupError
- raise if $DEBUG
- $stderr.puts $!.message
- $stderr.puts "Try 'ruby #{$0} --help' for detailed usage."
- exit 1
- end
-end
diff --git a/vendor/rails/actionwebservice/test/abstract_client.rb b/vendor/rails/actionwebservice/test/abstract_client.rb
deleted file mode 100644
index 467c4e0d..00000000
--- a/vendor/rails/actionwebservice/test/abstract_client.rb
+++ /dev/null
@@ -1,183 +0,0 @@
-require File.dirname(__FILE__) + '/abstract_unit'
-require 'webrick'
-require 'webrick/log'
-require 'singleton'
-
-module ClientTest
- class Person < ActionWebService::Struct
- member :firstnames, [:string]
- member :lastname, :string
-
- def ==(other)
- firstnames == other.firstnames && lastname == other.lastname
- end
- end
-
- class Inner < ActionWebService::Struct
- member :name, :string
- end
-
- class Outer < ActionWebService::Struct
- member :name, :string
- member :inner, Inner
- end
-
- class User < ActiveRecord::Base
- end
-
- module Accounting
- class User < ActiveRecord::Base
- end
- end
-
- class WithModel < ActionWebService::Struct
- member :user, User
- member :users, [User]
- end
-
- class WithMultiDimArray < ActionWebService::Struct
- member :pref, [[:string]]
- end
-
- class API < ActionWebService::API::Base
- api_method :void
- api_method :normal, :expects => [:int, :int], :returns => [:int]
- api_method :array_return, :returns => [[Person]]
- api_method :struct_pass, :expects => [[Person]], :returns => [:bool]
- api_method :nil_struct_return, :returns => [Person]
- api_method :inner_nil, :returns => [Outer]
- api_method :client_container, :returns => [:int]
- api_method :named_parameters, :expects => [{:key=>:string}, {:id=>:int}]
- api_method :thrower
- api_method :user_return, :returns => [User]
- api_method :with_model_return, :returns => [WithModel]
- api_method :scoped_model_return, :returns => [Accounting::User]
- api_method :multi_dim_return, :returns => [WithMultiDimArray]
- end
-
- class NullLogOut
- def <<(*args); end
- end
-
- class Container < ActionController::Base
- web_service_api API
-
- attr_accessor :value_void
- attr_accessor :value_normal
- attr_accessor :value_array_return
- attr_accessor :value_struct_pass
- attr_accessor :value_named_parameters
-
- def initialize
- @value_void = nil
- @value_normal = nil
- @value_array_return = nil
- @value_struct_pass = nil
- @value_named_parameters = nil
- end
-
- def void
- @value_void = @method_params
- end
-
- def normal
- @value_normal = @method_params
- 5
- end
-
- def array_return
- person = Person.new
- person.firstnames = ["one", "two"]
- person.lastname = "last"
- @value_array_return = [person]
- end
-
- def struct_pass
- @value_struct_pass = @method_params
- true
- end
-
- def nil_struct_return
- nil
- end
-
- def inner_nil
- Outer.new :name => 'outer', :inner => nil
- end
-
- def client_container
- 50
- end
-
- def named_parameters
- @value_named_parameters = @method_params
- end
-
- def thrower
- raise "Hi"
- end
-
- def user_return
- User.find(1)
- end
-
- def with_model_return
- WithModel.new :user => User.find(1), :users => User.find(:all)
- end
-
- def scoped_model_return
- Accounting::User.find(1)
- end
-
- def multi_dim_return
- WithMultiDimArray.new :pref => [%w{pref1 value1}, %w{pref2 value2}]
- end
- end
-
- class AbstractClientLet < WEBrick::HTTPServlet::AbstractServlet
- def initialize(controller)
- @controller = controller
- end
-
- def get_instance(*args)
- self
- end
-
- def require_path_info?
- false
- end
-
- def do_GET(req, res)
- raise WEBrick::HTTPStatus::MethodNotAllowed, "GET request not allowed."
- end
-
- def do_POST(req, res)
- raise NotImplementedError
- end
- end
-
- class AbstractServer
- include ClientTest
- include Singleton
- attr :container
- def initialize
- @container = Container.new
- @clientlet = create_clientlet(@container)
- log = WEBrick::BasicLog.new(NullLogOut.new)
- @server = WEBrick::HTTPServer.new(:Port => server_port, :Logger => log, :AccessLog => log)
- @server.mount('/', @clientlet)
- @thr = Thread.new { @server.start }
- until @server.status == :Running; end
- at_exit { @server.stop; @thr.join }
- end
-
- protected
- def create_clientlet
- raise NotImplementedError
- end
-
- def server_port
- raise NotImplementedError
- end
- end
-end
diff --git a/vendor/rails/actionwebservice/test/abstract_dispatcher.rb b/vendor/rails/actionwebservice/test/abstract_dispatcher.rb
deleted file mode 100644
index c15af417..00000000
--- a/vendor/rails/actionwebservice/test/abstract_dispatcher.rb
+++ /dev/null
@@ -1,551 +0,0 @@
-require File.dirname(__FILE__) + '/abstract_unit'
-require 'stringio'
-
-class ActionController::Base; def rescue_action(e) raise e end; end
-
-module DispatcherTest
- Utf8String = "One World Caf\303\251"
- WsdlNamespace = 'http://rubyonrails.com/some/namespace'
-
- class Node < ActiveRecord::Base
- def initialize(*args)
- super(*args)
- @new_record = false
- end
-
- class << self
- def name
- "DispatcherTest::Node"
- end
-
- def columns(*args)
- [
- ActiveRecord::ConnectionAdapters::Column.new('id', 0, 'int'),
- ActiveRecord::ConnectionAdapters::Column.new('name', nil, 'string'),
- ActiveRecord::ConnectionAdapters::Column.new('description', nil, 'string'),
- ]
- end
-
- def connection
- self
- end
- end
- end
-
- class Person < ActionWebService::Struct
- member :id, :int
- member :name, :string
-
- def ==(other)
- self.id == other.id && self.name == other.name
- end
- end
-
- class API < ActionWebService::API::Base
- api_method :add, :expects => [:int, :int], :returns => [:int]
- api_method :interceptee
- api_method :struct_return, :returns => [[Node]]
- api_method :void
- end
-
- class DirectAPI < ActionWebService::API::Base
- api_method :add, :expects => [{:a=>:int}, {:b=>:int}], :returns => [:int]
- api_method :add2, :expects => [{:a=>:int}, {:b=>:int}], :returns => [:int]
- api_method :before_filtered
- api_method :after_filtered, :returns => [[:int]]
- api_method :struct_return, :returns => [[Node]]
- api_method :struct_pass, :expects => [{:person => Person}]
- api_method :base_struct_return, :returns => [[Person]]
- api_method :hash_struct_return, :returns => [[Person]]
- api_method :thrower
- api_method :void
- api_method :test_utf8, :returns => [:string]
- api_method :hex, :expects => [:base64], :returns => [:string]
- api_method :unhex, :expects => [:string], :returns => [:base64]
- api_method :time, :expects => [:time], :returns => [:time]
- end
-
- class VirtualAPI < ActionWebService::API::Base
- default_api_method :fallback
- end
-
- class Service < ActionWebService::Base
- web_service_api API
-
- before_invocation :do_intercept, :only => [:interceptee]
-
- attr :added
- attr :intercepted
- attr :void_called
-
- def initialize
- @void_called = false
- end
-
- def add(a, b)
- @added = a + b
- end
-
- def interceptee
- @intercepted = false
- end
-
- def struct_return
- n1 = Node.new('id' => 1, 'name' => 'node1', 'description' => 'Node 1')
- n2 = Node.new('id' => 2, 'name' => 'node2', 'description' => 'Node 2')
- [n1, n2]
- end
-
- def void(*args)
- @void_called = args
- end
-
- def do_intercept(name, args)
- [false, "permission denied"]
- end
- end
-
- class MTAPI < ActionWebService::API::Base
- inflect_names false
- api_method :getCategories, :returns => [[:string]]
- api_method :bool, :returns => [:bool]
- api_method :alwaysFail
- api_method :person, :returns => [Person]
- end
-
- class BloggerAPI < ActionWebService::API::Base
- inflect_names false
- api_method :getCategories, :returns => [[:string]]
- api_method :str, :expects => [:int], :returns => [:string]
- api_method :alwaysFail
- end
-
- class MTService < ActionWebService::Base
- web_service_api MTAPI
-
- def getCategories
- ["mtCat1", "mtCat2"]
- end
-
- def bool
- 'y'
- end
-
- def alwaysFail
- raise "MT AlwaysFail"
- end
-
- def person
- Person.new('id' => 1, 'name' => 'person1')
- end
- end
-
- class BloggerService < ActionWebService::Base
- web_service_api BloggerAPI
-
- def getCategories
- ["bloggerCat1", "bloggerCat2"]
- end
-
- def str(int)
- unless int.is_a?(Integer)
- raise "Not an integer!"
- end
- 500 + int
- end
-
- def alwaysFail
- raise "Blogger AlwaysFail"
- end
- end
-
- class AbstractController < ActionController::Base
- def generate_wsdl
- self.request ||= ::ActionController::TestRequest.new
- to_wsdl
- end
- end
-
- class DelegatedController < AbstractController
- web_service_dispatching_mode :delegated
- wsdl_namespace WsdlNamespace
-
- web_service(:test_service) { @service ||= Service.new; @service }
- end
-
- class LayeredController < AbstractController
- web_service_dispatching_mode :layered
- wsdl_namespace WsdlNamespace
-
- web_service(:mt) { @mt_service ||= MTService.new; @mt_service }
- web_service(:blogger) { @blogger_service ||= BloggerService.new; @blogger_service }
- end
-
- class DirectController < AbstractController
- web_service_api DirectAPI
- web_service_dispatching_mode :direct
- wsdl_namespace WsdlNamespace
-
- before_invocation :alwaysfail, :only => [:before_filtered]
- after_invocation :alwaysok, :only => [:after_filtered]
-
- attr :added
- attr :added2
- attr :before_filter_called
- attr :before_filter_target_called
- attr :after_filter_called
- attr :after_filter_target_called
- attr :void_called
- attr :struct_pass_value
-
- def initialize
- @before_filter_called = false
- @before_filter_target_called = false
- @after_filter_called = false
- @after_filter_target_called = false
- @void_called = false
- @struct_pass_value = false
- end
-
- def add
- @added = params['a'] + params['b']
- end
-
- def add2(a, b)
- @added2 = a + b
- end
-
- def before_filtered
- @before_filter_target_called = true
- end
-
- def after_filtered
- @after_filter_target_called = true
- [5, 6, 7]
- end
-
- def thrower
- raise "Hi, I'm an exception"
- end
-
- def struct_return
- n1 = Node.new('id' => 1, 'name' => 'node1', 'description' => 'Node 1')
- n2 = Node.new('id' => 2, 'name' => 'node2', 'description' => 'Node 2')
- [n1, n2]
- end
-
- def struct_pass(person)
- @struct_pass_value = person
- end
-
- def base_struct_return
- p1 = Person.new('id' => 1, 'name' => 'person1')
- p2 = Person.new('id' => 2, 'name' => 'person2')
- [p1, p2]
- end
-
- def hash_struct_return
- p1 = { :id => '1', 'name' => 'test' }
- p2 = { 'id' => '2', :name => 'person2' }
- [p1, p2]
- end
-
- def void
- @void_called = @method_params
- end
-
- def test_utf8
- Utf8String
- end
-
- def hex(s)
- return s.unpack("H*")[0]
- end
-
- def unhex(s)
- return [s].pack("H*")
- end
-
- def time(t)
- t
- end
-
- protected
- def alwaysfail(method_name, params)
- @before_filter_called = true
- false
- end
-
- def alwaysok(method_name, params, return_value)
- @after_filter_called = true
- end
- end
-
- class VirtualController < AbstractController
- web_service_api VirtualAPI
- wsdl_namespace WsdlNamespace
-
- def fallback
- "fallback!"
- end
- end
-end
-
-module DispatcherCommonTests
- def test_direct_dispatching
- assert_equal(70, do_method_call(@direct_controller, 'Add', 20, 50))
- assert_equal(70, @direct_controller.added)
- assert_equal(50, do_method_call(@direct_controller, 'Add2', 25, 25))
- assert_equal(50, @direct_controller.added2)
- assert(@direct_controller.void_called == false)
- assert(do_method_call(@direct_controller, 'Void', 3, 4, 5).nil?)
- assert(@direct_controller.void_called == [])
- result = do_method_call(@direct_controller, 'BaseStructReturn')
- assert(result[0].is_a?(DispatcherTest::Person))
- assert(result[1].is_a?(DispatcherTest::Person))
- assert_equal("cafe", do_method_call(@direct_controller, 'Hex', "\xca\xfe"))
- assert_equal("\xca\xfe", do_method_call(@direct_controller, 'Unhex', "cafe"))
- time = Time.gm(1998, "Feb", 02, 15, 12, 01)
- assert_equal(time, do_method_call(@direct_controller, 'Time', time))
- end
-
- def test_direct_entrypoint
- assert(@direct_controller.respond_to?(:api))
- end
-
- def test_virtual_dispatching
- assert_equal("fallback!", do_method_call(@virtual_controller, 'VirtualOne'))
- assert_equal("fallback!", do_method_call(@virtual_controller, 'VirtualTwo'))
- end
-
- def test_direct_filtering
- assert_equal(false, @direct_controller.before_filter_called)
- assert_equal(false, @direct_controller.before_filter_target_called)
- do_method_call(@direct_controller, 'BeforeFiltered')
- assert_equal(true, @direct_controller.before_filter_called)
- assert_equal(false, @direct_controller.before_filter_target_called)
- assert_equal(false, @direct_controller.after_filter_called)
- assert_equal(false, @direct_controller.after_filter_target_called)
- assert_equal([5, 6, 7], do_method_call(@direct_controller, 'AfterFiltered'))
- assert_equal(true, @direct_controller.after_filter_called)
- assert_equal(true, @direct_controller.after_filter_target_called)
- end
-
- def test_delegated_dispatching
- assert_equal(130, do_method_call(@delegated_controller, 'Add', 50, 80))
- service = @delegated_controller.web_service_object(:test_service)
- assert_equal(130, service.added)
- @delegated_controller.web_service_exception_reporting = true
- assert(service.intercepted.nil?)
- result = do_method_call(@delegated_controller, 'Interceptee')
- assert(service.intercepted.nil?)
- assert(is_exception?(result))
- assert_match(/permission denied/, exception_message(result))
- result = do_method_call(@delegated_controller, 'NonExistentMethod')
- assert(is_exception?(result))
- assert_match(/NonExistentMethod/, exception_message(result))
- assert(service.void_called == false)
- assert(do_method_call(@delegated_controller, 'Void', 3, 4, 5).nil?)
- assert(service.void_called == [])
- end
-
- def test_garbage_request
- [@direct_controller, @delegated_controller].each do |controller|
- controller.class.web_service_exception_reporting = true
- send_garbage_request = lambda do
- service_name = service_name(controller)
- request = protocol.encode_action_pack_request(service_name, 'broken, method, name!', 'broken request body', :request_class => ActionController::TestRequest)
- response = ActionController::TestResponse.new
- controller.process(request, response)
- # puts response.body
- assert(response.headers['Status'] =~ /^500/)
- end
- send_garbage_request.call
- controller.class.web_service_exception_reporting = false
- send_garbage_request.call
- end
- end
-
- def test_exception_marshaling
- @direct_controller.web_service_exception_reporting = true
- result = do_method_call(@direct_controller, 'Thrower')
- assert(is_exception?(result))
- assert_equal("Hi, I'm an exception", exception_message(result))
- @direct_controller.web_service_exception_reporting = false
- result = do_method_call(@direct_controller, 'Thrower')
- assert(exception_message(result) != "Hi, I'm an exception")
- end
-
- def test_ar_struct_return
- [@direct_controller, @delegated_controller].each do |controller|
- result = do_method_call(controller, 'StructReturn')
- assert(result[0].is_a?(DispatcherTest::Node))
- assert(result[1].is_a?(DispatcherTest::Node))
- assert_equal('node1', result[0].name)
- assert_equal('node2', result[1].name)
- end
- end
-
- def test_casting
- assert_equal 70, do_method_call(@direct_controller, 'Add', "50", "20")
- assert_equal false, @direct_controller.struct_pass_value
- person = DispatcherTest::Person.new(:id => 1, :name => 'test')
- result = do_method_call(@direct_controller, 'StructPass', person)
- assert(nil == result || true == result)
- assert_equal person, @direct_controller.struct_pass_value
- assert !person.equal?(@direct_controller.struct_pass_value)
- result = do_method_call(@direct_controller, 'StructPass', {'id' => '1', 'name' => 'test'})
- case
- when soap?
- assert_equal(person, @direct_controller.struct_pass_value)
- assert !person.equal?(@direct_controller.struct_pass_value)
- when xmlrpc?
- assert_equal(person, @direct_controller.struct_pass_value)
- assert !person.equal?(@direct_controller.struct_pass_value)
- end
- assert_equal person, do_method_call(@direct_controller, 'HashStructReturn')[0]
- result = do_method_call(@direct_controller, 'StructPass', {'id' => '1', 'name' => 'test', 'nonexistent_attribute' => 'value'})
- case
- when soap?
- assert_equal(person, @direct_controller.struct_pass_value)
- assert !person.equal?(@direct_controller.struct_pass_value)
- when xmlrpc?
- assert_equal(person, @direct_controller.struct_pass_value)
- assert !person.equal?(@direct_controller.struct_pass_value)
- end
- end
-
- def test_logging
- buf = ""
- ActionController::Base.logger = Logger.new(StringIO.new(buf))
- test_casting
- test_garbage_request
- test_exception_marshaling
- ActionController::Base.logger = nil
- assert_match /Web Service Response/, buf
- assert_match /Web Service Request/, buf
- end
-
- def test_allowed_http_methods
- webservice_api = @direct_controller.class.web_service_api
- original_allowed_http_methods = webservice_api.allowed_http_methods
-
- # check defaults
- assert_equal false, http_method_allowed?(:get)
- assert_equal false, http_method_allowed?(:head)
- assert_equal false, http_method_allowed?(:put)
- assert_equal false, http_method_allowed?(:delete)
- assert_equal false, http_method_allowed?(:trace)
- assert_equal false, http_method_allowed?(:connect)
- assert_equal true, http_method_allowed?(:post)
-
- # allow get and post
- webservice_api.allowed_http_methods = [ :get, :post ]
- assert_equal true, http_method_allowed?(:get)
- assert_equal true, http_method_allowed?(:post)
-
- # allow get only
- webservice_api.allowed_http_methods = [ :get ]
- assert_equal true, http_method_allowed?(:get)
- assert_equal false, http_method_allowed?(:post)
-
- # allow delete only
- webservice_api.allowed_http_methods = [ 'DELETE' ]
- assert_equal false, http_method_allowed?(:get)
- assert_equal false, http_method_allowed?(:head)
- assert_equal false, http_method_allowed?(:post)
- assert_equal false, http_method_allowed?(:put)
- assert_equal false, http_method_allowed?(:trace)
- assert_equal false, http_method_allowed?(:connect)
- assert_equal true, http_method_allowed?(:delete)
-
- ensure
- webservice_api.allowed_http_methods = original_allowed_http_methods
- end
-
- protected
- def service_name(container)
- raise NotImplementedError
- end
-
- def exception_message(obj)
- raise NotImplementedError
- end
-
- def is_exception?(obj)
- raise NotImplementedError
- end
-
- def protocol
- @protocol
- end
-
- def soap?
- protocol.is_a? ActionWebService::Protocol::Soap::SoapProtocol
- end
-
- def xmlrpc?
- protocol.is_a? ActionWebService::Protocol::XmlRpc::XmlRpcProtocol
- end
-
- def do_method_call(container, public_method_name, *params)
- request_env = {}
- mode = container.web_service_dispatching_mode
- case mode
- when :direct
- service_name = service_name(container)
- api = container.class.web_service_api
- method = api.public_api_method_instance(public_method_name)
- when :delegated
- service_name = service_name(container)
- api = container.web_service_object(service_name).class.web_service_api
- method = api.public_api_method_instance(public_method_name)
- when :layered
- service_name = nil
- real_method_name = nil
- if public_method_name =~ /^([^\.]+)\.(.*)$/
- service_name = $1
- real_method_name = $2
- end
- if soap?
- public_method_name = real_method_name
- request_env['HTTP_SOAPACTION'] = "/soap/#{service_name}/#{real_method_name}"
- end
- api = container.web_service_object(service_name.to_sym).class.web_service_api rescue nil
- method = api.public_api_method_instance(real_method_name) rescue nil
- service_name = self.service_name(container)
- end
- protocol.register_api(api)
- virtual = false
- unless method
- virtual = true
- method ||= ActionWebService::API::Method.new(public_method_name.underscore.to_sym, public_method_name, nil, nil)
- end
- body = protocol.encode_request(public_method_name, params.dup, method.expects)
- # puts body
- ap_request = protocol.encode_action_pack_request(service_name, public_method_name, body, :request_class => ActionController::TestRequest)
- ap_request.env.update(request_env)
- ap_response = ActionController::TestResponse.new
- container.process(ap_request, ap_response)
- # puts ap_response.body
- @response_body = ap_response.body
- public_method_name, return_value = protocol.decode_response(ap_response.body)
- unless is_exception?(return_value) || virtual
- return_value = method.cast_returns(return_value)
- end
- if soap?
- # http://dev.rubyonrails.com/changeset/920
- assert_match(/Response$/, public_method_name) unless public_method_name == "fault"
- end
- return_value
- end
-
- def http_method_allowed?(method)
- method = method.to_s.upcase
- test_request = ActionController::TestRequest.new({ 'action' => 'api' })
- test_response = ActionController::TestResponse.new
- test_request.env['REQUEST_METHOD'] = method
- result = @direct_controller.process(test_request, test_response)
- result.body =~ /(GET|POST|PUT|DELETE|TRACE|CONNECT) not supported/ ? false : true
- end
-end
diff --git a/vendor/rails/actionwebservice/test/abstract_unit.rb b/vendor/rails/actionwebservice/test/abstract_unit.rb
deleted file mode 100644
index b7088c43..00000000
--- a/vendor/rails/actionwebservice/test/abstract_unit.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-ENV["RAILS_ENV"] = "test"
-$:.unshift(File.dirname(__FILE__) + '/../lib')
-$:.unshift(File.dirname(__FILE__) + '/../../activesupport/lib')
-$:.unshift(File.dirname(__FILE__) + '/../../actionpack/lib')
-$:.unshift(File.dirname(__FILE__) + '/../../activerecord/lib')
-
-require 'test/unit'
-require 'action_web_service'
-require 'action_controller'
-require 'action_controller/test_process'
-
-# Show backtraces for deprecated behavior for quicker cleanup.
-ActiveSupport::Deprecation.debug = true
-
-
-ActionController::Base.logger = Logger.new("debug.log")
-ActionController::Base.ignore_missing_templates = true
-
-begin
- PATH_TO_AR = File.dirname(__FILE__) + '/../../activerecord'
- require "#{PATH_TO_AR}/lib/active_record" unless Object.const_defined?(:ActiveRecord)
- require "#{PATH_TO_AR}/lib/active_record/fixtures" unless Object.const_defined?(:Fixtures)
-rescue LoadError => e
- fail "\nFailed to load activerecord: #{e}"
-end
-
-ActiveRecord::Base.configurations = {
- 'mysql' => {
- :adapter => "mysql",
- :username => "rails",
- :encoding => "utf8",
- :database => "actionwebservice_unittest"
- }
-}
-
-ActiveRecord::Base.establish_connection 'mysql'
-
-Test::Unit::TestCase.fixture_path = "#{File.dirname(__FILE__)}/fixtures/"
-
-# restore default raw_post functionality
-class ActionController::TestRequest
- def raw_post
- super
- end
-end
diff --git a/vendor/rails/actionwebservice/test/api_test.rb b/vendor/rails/actionwebservice/test/api_test.rb
deleted file mode 100644
index 0e58d848..00000000
--- a/vendor/rails/actionwebservice/test/api_test.rb
+++ /dev/null
@@ -1,102 +0,0 @@
-require File.dirname(__FILE__) + '/abstract_unit'
-
-module APITest
- class API < ActionWebService::API::Base
- api_method :void
- api_method :expects_and_returns, :expects_and_returns => [:string]
- api_method :expects, :expects => [:int, :bool]
- api_method :returns, :returns => [:int, [:string]]
- api_method :named_signature, :expects => [{:appkey=>:int}, {:publish=>:bool}]
- api_method :string_types, :expects => ['int', 'string', 'bool', 'base64']
- api_method :class_types, :expects => [TrueClass, Bignum, String]
- end
-end
-
-class TC_API < Test::Unit::TestCase
- API = APITest::API
-
- def test_api_method_declaration
- %w(
- void
- expects_and_returns
- expects
- returns
- named_signature
- string_types
- class_types
- ).each do |name|
- name = name.to_sym
- public_name = API.public_api_method_name(name)
- assert(API.has_api_method?(name))
- assert(API.has_public_api_method?(public_name))
- assert(API.api_method_name(public_name) == name)
- assert(API.api_methods.has_key?(name))
- end
- end
-
- def test_signature_canonicalization
- assert_equal(nil, API.api_methods[:void].expects)
- assert_equal(nil, API.api_methods[:void].returns)
- assert_equal([String], API.api_methods[:expects_and_returns].expects.map{|x| x.type_class})
- assert_equal([String], API.api_methods[:expects_and_returns].returns.map{|x| x.type_class})
- assert_equal([Integer, TrueClass], API.api_methods[:expects].expects.map{|x| x.type_class})
- assert_equal(nil, API.api_methods[:expects].returns)
- assert_equal(nil, API.api_methods[:returns].expects)
- assert_equal([Integer, [String]], API.api_methods[:returns].returns.map{|x| x.array?? [x.element_type.type_class] : x.type_class})
- assert_equal([[:appkey, Integer], [:publish, TrueClass]], API.api_methods[:named_signature].expects.map{|x| [x.name, x.type_class]})
- assert_equal(nil, API.api_methods[:named_signature].returns)
- assert_equal([Integer, String, TrueClass, ActionWebService::Base64], API.api_methods[:string_types].expects.map{|x| x.type_class})
- assert_equal(nil, API.api_methods[:string_types].returns)
- assert_equal([TrueClass, Integer, String], API.api_methods[:class_types].expects.map{|x| x.type_class})
- assert_equal(nil, API.api_methods[:class_types].returns)
- end
-
- def test_not_instantiable
- assert_raises(NoMethodError) do
- API.new
- end
- end
-
- def test_api_errors
- assert_raises(ActionWebService::ActionWebServiceError) do
- klass = Class.new(ActionWebService::API::Base) do
- api_method :test, :expects => [ActiveRecord::Base]
- end
- end
- klass = Class.new(ActionWebService::API::Base) do
- allow_active_record_expects true
- api_method :test2, :expects => [ActiveRecord::Base]
- end
- assert_raises(ActionWebService::ActionWebServiceError) do
- klass = Class.new(ActionWebService::API::Base) do
- api_method :test, :invalid => [:int]
- end
- end
- end
-
- def test_parameter_names
- method = API.api_methods[:named_signature]
- assert_equal 0, method.expects_index_of(:appkey)
- assert_equal 1, method.expects_index_of(:publish)
- assert_equal 1, method.expects_index_of('publish')
- assert_equal 0, method.expects_index_of('appkey')
- assert_equal -1, method.expects_index_of('blah')
- assert_equal -1, method.expects_index_of(:missing)
- assert_equal -1, API.api_methods[:void].expects_index_of('test')
- end
-
- def test_parameter_hash
- method = API.api_methods[:named_signature]
- hash = method.expects_to_hash([5, false])
- assert_equal({:appkey => 5, :publish => false}, hash)
- end
-
- def test_api_methods_compat
- sig = API.api_methods[:named_signature][:expects]
- assert_equal [{:appkey=>Integer}, {:publish=>TrueClass}], sig
- end
-
- def test_to_s
- assert_equal 'void Expects(int param0, bool param1)', APITest::API.api_methods[:expects].to_s
- end
-end
diff --git a/vendor/rails/actionwebservice/test/apis/auto_load_api.rb b/vendor/rails/actionwebservice/test/apis/auto_load_api.rb
deleted file mode 100644
index a35bbe3f..00000000
--- a/vendor/rails/actionwebservice/test/apis/auto_load_api.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-class AutoLoadAPI < ActionWebService::API::Base
- api_method :void
-end
diff --git a/vendor/rails/actionwebservice/test/apis/broken_auto_load_api.rb b/vendor/rails/actionwebservice/test/apis/broken_auto_load_api.rb
deleted file mode 100644
index 139597f9..00000000
--- a/vendor/rails/actionwebservice/test/apis/broken_auto_load_api.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/vendor/rails/actionwebservice/test/base_test.rb b/vendor/rails/actionwebservice/test/base_test.rb
deleted file mode 100644
index 55a112a0..00000000
--- a/vendor/rails/actionwebservice/test/base_test.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-require File.dirname(__FILE__) + '/abstract_unit'
-
-module BaseTest
- class API < ActionWebService::API::Base
- api_method :add, :expects => [:int, :int], :returns => [:int]
- api_method :void
- end
-
- class PristineAPI < ActionWebService::API::Base
- inflect_names false
-
- api_method :add
- api_method :under_score
- end
-
- class Service < ActionWebService::Base
- web_service_api API
-
- def add(a, b)
- end
-
- def void
- end
- end
-
- class PristineService < ActionWebService::Base
- web_service_api PristineAPI
-
- def add
- end
-
- def under_score
- end
- end
-end
-
-class TC_Base < Test::Unit::TestCase
- def test_options
- assert(BaseTest::PristineService.web_service_api.inflect_names == false)
- assert(BaseTest::Service.web_service_api.inflect_names == true)
- end
-end
diff --git a/vendor/rails/actionwebservice/test/casting_test.rb b/vendor/rails/actionwebservice/test/casting_test.rb
deleted file mode 100644
index 34bad07d..00000000
--- a/vendor/rails/actionwebservice/test/casting_test.rb
+++ /dev/null
@@ -1,86 +0,0 @@
-require File.dirname(__FILE__) + '/abstract_unit'
-
-module CastingTest
- class API < ActionWebService::API::Base
- api_method :int, :expects => [:int]
- api_method :str, :expects => [:string]
- api_method :base64, :expects => [:base64]
- api_method :bool, :expects => [:bool]
- api_method :float, :expects => [:float]
- api_method :time, :expects => [:time]
- api_method :datetime, :expects => [:datetime]
- api_method :date, :expects => [:date]
-
- api_method :int_array, :expects => [[:int]]
- api_method :str_array, :expects => [[:string]]
- api_method :bool_array, :expects => [[:bool]]
- end
-end
-
-class TC_Casting < Test::Unit::TestCase
- include CastingTest
-
- def test_base_type_casting_valid
- assert_equal 10000, cast_expects(:int, '10000')[0]
- assert_equal '10000', cast_expects(:str, 10000)[0]
- base64 = cast_expects(:base64, 10000)[0]
- assert_equal '10000', base64
- assert_instance_of ActionWebService::Base64, base64
- [1, '1', 'true', 'y', 'yes'].each do |val|
- assert_equal true, cast_expects(:bool, val)[0]
- end
- [0, '0', 'false', 'n', 'no'].each do |val|
- assert_equal false, cast_expects(:bool, val)[0]
- end
- assert_equal 3.14159, cast_expects(:float, '3.14159')[0]
- now = Time.at(Time.now.tv_sec)
- casted = cast_expects(:time, now.to_s)[0]
- assert_equal now, casted
- now = DateTime.now
- assert_equal now.to_s, cast_expects(:datetime, now.to_s)[0].to_s
- today = Date.today
- assert_equal today, cast_expects(:date, today.to_s)[0]
- end
-
- def test_base_type_casting_invalid
- assert_raises ArgumentError do
- cast_expects(:int, 'this is not a number')
- end
- assert_raises ActionWebService::Casting::CastingError do
- # neither true or false ;)
- cast_expects(:bool, 'i always lie')
- end
- assert_raises ArgumentError do
- cast_expects(:float, 'not a float')
- end
- assert_raises ArgumentError do
- cast_expects(:time, '111111111111111111111111111111111')
- end
- assert_raises ArgumentError do
- cast_expects(:datetime, '-1')
- end
- assert_raises ArgumentError do
- cast_expects(:date, '')
- end
- end
-
- def test_array_type_casting
- assert_equal [1, 2, 3213992, 4], cast_expects(:int_array, ['1', '2', '3213992', '4'])[0]
- assert_equal ['one', 'two', '5.0', '200', nil, 'true'], cast_expects(:str_array, [:one, 'two', 5.0, 200, nil, true])[0]
- assert_equal [true, nil, true, true, false], cast_expects(:bool_array, ['1', nil, 'y', true, 'false'])[0]
- end
-
- def test_array_type_casting_failure
- assert_raises ActionWebService::Casting::CastingError do
- cast_expects(:bool_array, ['false', 'blahblah'])
- end
- assert_raises ArgumentError do
- cast_expects(:int_array, ['1', '2.021', '4'])
- end
- end
-
- private
- def cast_expects(method_name, *args)
- API.api_method_instance(method_name.to_sym).cast_expects([*args])
- end
-end
diff --git a/vendor/rails/actionwebservice/test/client_soap_test.rb b/vendor/rails/actionwebservice/test/client_soap_test.rb
deleted file mode 100644
index 914bf377..00000000
--- a/vendor/rails/actionwebservice/test/client_soap_test.rb
+++ /dev/null
@@ -1,153 +0,0 @@
-require File.dirname(__FILE__) + '/abstract_client'
-
-
-module ClientSoapTest
- PORT = 8998
-
- class SoapClientLet < ClientTest::AbstractClientLet
- def do_POST(req, res)
- test_request = ActionController::TestRequest.new
- test_request.request_parameters['action'] = req.path.gsub(/^\//, '').split(/\//)[1]
- test_request.env['REQUEST_METHOD'] = "POST"
- test_request.env['HTTP_CONTENTTYPE'] = 'text/xml'
- test_request.env['HTTP_SOAPACTION'] = req.header['soapaction'][0]
- test_request.env['RAW_POST_DATA'] = req.body
- response = ActionController::TestResponse.new
- @controller.process(test_request, response)
- res.header['content-type'] = 'text/xml'
- res.body = response.body
- rescue Exception => e
- $stderr.puts e.message
- $stderr.puts e.backtrace.join("\n")
- end
- end
-
- class ClientContainer < ActionController::Base
- web_client_api :client, :soap, "http://localhost:#{PORT}/client/api", :api => ClientTest::API
- web_client_api :invalid, :null, "", :api => true
-
- def get_client
- client
- end
-
- def get_invalid
- invalid
- end
- end
-
- class SoapServer < ClientTest::AbstractServer
- def create_clientlet(controller)
- SoapClientLet.new(controller)
- end
-
- def server_port
- PORT
- end
- end
-end
-
-class TC_ClientSoap < Test::Unit::TestCase
- include ClientTest
- include ClientSoapTest
-
- fixtures :users
-
- def setup
- @server = SoapServer.instance
- @container = @server.container
- @client = ActionWebService::Client::Soap.new(API, "http://localhost:#{@server.server_port}/client/api")
- end
-
- def test_void
- assert(@container.value_void.nil?)
- @client.void
- assert(!@container.value_void.nil?)
- end
-
- def test_normal
- assert(@container.value_normal.nil?)
- assert_equal(5, @client.normal(5, 6))
- assert_equal([5, 6], @container.value_normal)
- assert_equal(5, @client.normal("7", "8"))
- assert_equal([7, 8], @container.value_normal)
- assert_equal(5, @client.normal(true, false))
- end
-
- def test_array_return
- assert(@container.value_array_return.nil?)
- new_person = Person.new
- new_person.firstnames = ["one", "two"]
- new_person.lastname = "last"
- assert_equal([new_person], @client.array_return)
- assert_equal([new_person], @container.value_array_return)
- end
-
- def test_struct_pass
- assert(@container.value_struct_pass.nil?)
- new_person = Person.new
- new_person.firstnames = ["one", "two"]
- new_person.lastname = "last"
- assert_equal(true, @client.struct_pass([new_person]))
- assert_equal([[new_person]], @container.value_struct_pass)
- end
-
- def test_nil_struct_return
- assert_nil @client.nil_struct_return
- end
-
- def test_inner_nil
- outer = @client.inner_nil
- assert_equal 'outer', outer.name
- assert_nil outer.inner
- end
-
- def test_client_container
- assert_equal(50, ClientContainer.new.get_client.client_container)
- assert(ClientContainer.new.get_invalid.nil?)
- end
-
- def test_named_parameters
- assert(@container.value_named_parameters.nil?)
- assert(@client.named_parameters("key", 5).nil?)
- assert_equal(["key", 5], @container.value_named_parameters)
- end
-
- def test_capitalized_method_name
- @container.value_normal = nil
- assert_equal(5, @client.Normal(5, 6))
- assert_equal([5, 6], @container.value_normal)
- @container.value_normal = nil
- end
-
- def test_model_return
- user = @client.user_return
- assert_equal 1, user.id
- assert_equal 'Kent', user.name
- assert user.active?
- assert_kind_of Date, user.created_on
- assert_equal Date.today, user.created_on
- assert_equal BigDecimal('12.2'), user.balance
- end
-
- def test_with_model
- with_model = @client.with_model_return
- assert_equal 'Kent', with_model.user.name
- assert_equal 2, with_model.users.size
- with_model.users.each do |user|
- assert_kind_of User, user
- end
- end
-
- def test_scoped_model_return
- scoped_model = @client.scoped_model_return
- assert_kind_of Accounting::User, scoped_model
- assert_equal 'Kent', scoped_model.name
- end
-
- def test_multi_dim_return
- md_struct = @client.multi_dim_return
- assert_kind_of Array, md_struct.pref
- assert_equal 2, md_struct.pref.size
- assert_kind_of Array, md_struct.pref[0]
- end
-end
diff --git a/vendor/rails/actionwebservice/test/client_xmlrpc_test.rb b/vendor/rails/actionwebservice/test/client_xmlrpc_test.rb
deleted file mode 100644
index 896ec595..00000000
--- a/vendor/rails/actionwebservice/test/client_xmlrpc_test.rb
+++ /dev/null
@@ -1,152 +0,0 @@
-require File.dirname(__FILE__) + '/abstract_client'
-
-
-module ClientXmlRpcTest
- PORT = 8999
-
- class XmlRpcClientLet < ClientTest::AbstractClientLet
- def do_POST(req, res)
- test_request = ActionController::TestRequest.new
- test_request.request_parameters['action'] = req.path.gsub(/^\//, '').split(/\//)[1]
- test_request.env['REQUEST_METHOD'] = "POST"
- test_request.env['HTTP_CONTENT_TYPE'] = 'text/xml'
- test_request.env['RAW_POST_DATA'] = req.body
- response = ActionController::TestResponse.new
- @controller.process(test_request, response)
- res.header['content-type'] = 'text/xml'
- res.body = response.body
- # puts res.body
- rescue Exception => e
- $stderr.puts e.message
- $stderr.puts e.backtrace.join("\n")
- end
- end
-
- class ClientContainer < ActionController::Base
- web_client_api :client, :xmlrpc, "http://localhost:#{PORT}/client/api", :api => ClientTest::API
-
- def get_client
- client
- end
- end
-
- class XmlRpcServer < ClientTest::AbstractServer
- def create_clientlet(controller)
- XmlRpcClientLet.new(controller)
- end
-
- def server_port
- PORT
- end
- end
-end
-
-class TC_ClientXmlRpc < Test::Unit::TestCase
- include ClientTest
- include ClientXmlRpcTest
-
- fixtures :users
-
- def setup
- @server = XmlRpcServer.instance
- @container = @server.container
- @client = ActionWebService::Client::XmlRpc.new(API, "http://localhost:#{@server.server_port}/client/api")
- end
-
- def test_void
- assert(@container.value_void.nil?)
- @client.void
- assert(!@container.value_void.nil?)
- end
-
- def test_normal
- assert(@container.value_normal.nil?)
- assert_equal(5, @client.normal(5, 6))
- assert_equal([5, 6], @container.value_normal)
- assert_equal(5, @client.normal("7", "8"))
- assert_equal([7, 8], @container.value_normal)
- assert_equal(5, @client.normal(true, false))
- end
-
- def test_array_return
- assert(@container.value_array_return.nil?)
- new_person = Person.new
- new_person.firstnames = ["one", "two"]
- new_person.lastname = "last"
- assert_equal([new_person], @client.array_return)
- assert_equal([new_person], @container.value_array_return)
- end
-
- def test_struct_pass
- assert(@container.value_struct_pass.nil?)
- new_person = Person.new
- new_person.firstnames = ["one", "two"]
- new_person.lastname = "last"
- assert_equal(true, @client.struct_pass([new_person]))
- assert_equal([[new_person]], @container.value_struct_pass)
- end
-
- def test_nil_struct_return
- assert_equal false, @client.nil_struct_return
- end
-
- def test_inner_nil
- outer = @client.inner_nil
- assert_equal 'outer', outer.name
- assert_nil outer.inner
- end
-
- def test_client_container
- assert_equal(50, ClientContainer.new.get_client.client_container)
- end
-
- def test_named_parameters
- assert(@container.value_named_parameters.nil?)
- assert_equal(false, @client.named_parameters("xxx", 7))
- assert_equal(["xxx", 7], @container.value_named_parameters)
- end
-
- def test_exception
- assert_raises(ActionWebService::Client::ClientError) do
- assert(@client.thrower)
- end
- end
-
- def test_invalid_signature
- assert_raises(ArgumentError) do
- @client.normal
- end
- end
-
- def test_model_return
- user = @client.user_return
- assert_equal 1, user.id
- assert_equal 'Kent', user.name
- assert user.active?
- assert_kind_of Time, user.created_on
- assert_equal Time.utc(Time.now.year, Time.now.month, Time.now.day), user.created_on
- assert_equal BigDecimal('12.2'), user.balance
- end
-
- def test_with_model
- with_model = @client.with_model_return
- assert_equal 'Kent', with_model.user.name
- assert_equal 2, with_model.users.size
- with_model.users.each do |user|
- assert_kind_of User, user
- end
- end
-
- def test_scoped_model_return
- scoped_model = @client.scoped_model_return
- assert_kind_of Accounting::User, scoped_model
- assert_equal 'Kent', scoped_model.name
- end
-
- def test_multi_dim_return
- md_struct = @client.multi_dim_return
- assert_kind_of Array, md_struct.pref
- assert_equal 2, md_struct.pref.size
- assert_kind_of Array, md_struct.pref[0]
- end
-end
diff --git a/vendor/rails/actionwebservice/test/container_test.rb b/vendor/rails/actionwebservice/test/container_test.rb
deleted file mode 100644
index 325d420f..00000000
--- a/vendor/rails/actionwebservice/test/container_test.rb
+++ /dev/null
@@ -1,73 +0,0 @@
-require File.dirname(__FILE__) + '/abstract_unit'
-
-module ContainerTest
- $immediate_service = Object.new
- $deferred_service = Object.new
-
- class DelegateContainer < ActionController::Base
- web_service_dispatching_mode :delegated
-
- attr :flag
- attr :previous_flag
-
- def initialize
- @previous_flag = nil
- @flag = true
- end
-
- web_service :immediate_service, $immediate_service
- web_service(:deferred_service) { @previous_flag = @flag; @flag = false; $deferred_service }
- end
-
- class DirectContainer < ActionController::Base
- web_service_dispatching_mode :direct
- end
-
- class InvalidContainer
- include ActionWebService::Container::Direct
- end
-end
-
-class TC_Container < Test::Unit::TestCase
- include ContainerTest
-
- def setup
- @delegate_container = DelegateContainer.new
- @direct_container = DirectContainer.new
- end
-
- def test_registration
- assert(DelegateContainer.has_web_service?(:immediate_service))
- assert(DelegateContainer.has_web_service?(:deferred_service))
- assert(!DelegateContainer.has_web_service?(:fake_service))
- assert_raises(ActionWebService::Container::Delegated::ContainerError) do
- DelegateContainer.web_service('invalid')
- end
- end
-
- def test_service_object
- assert_raises(ActionWebService::Container::Delegated::ContainerError) do
- @delegate_container.web_service_object(:nonexistent)
- end
- assert(@delegate_container.flag == true)
- assert(@delegate_container.web_service_object(:immediate_service) == $immediate_service)
- assert(@delegate_container.previous_flag.nil?)
- assert(@delegate_container.flag == true)
- assert(@delegate_container.web_service_object(:deferred_service) == $deferred_service)
- assert(@delegate_container.previous_flag == true)
- assert(@delegate_container.flag == false)
- end
-
- def test_direct_container
- assert(DirectContainer.web_service_dispatching_mode == :direct)
- end
-
- def test_validity
- assert_raises(ActionWebService::Container::Direct::ContainerError) do
- InvalidContainer.web_service_api :test
- end
- assert_raises(ActionWebService::Container::Direct::ContainerError) do
- InvalidContainer.web_service_api 50.0
- end
- end
-end
diff --git a/vendor/rails/actionwebservice/test/dispatcher_action_controller_soap_test.rb b/vendor/rails/actionwebservice/test/dispatcher_action_controller_soap_test.rb
deleted file mode 100644
index 0b58af30..00000000
--- a/vendor/rails/actionwebservice/test/dispatcher_action_controller_soap_test.rb
+++ /dev/null
@@ -1,137 +0,0 @@
-$:.unshift(File.dirname(__FILE__) + '/apis')
-require File.dirname(__FILE__) + '/abstract_dispatcher'
-require 'wsdl/parser'
-
-class ActionController::Base
- class << self
- alias :inherited_without_name_error :inherited
- def inherited(child)
- begin
- inherited_without_name_error(child)
- rescue NameError => e
- end
- end
- end
-end
-
-class AutoLoadController < ActionController::Base; end
-class FailingAutoLoadController < ActionController::Base; end
-class BrokenAutoLoadController < ActionController::Base; end
-
-class TC_DispatcherActionControllerSoap < Test::Unit::TestCase
- include DispatcherTest
- include DispatcherCommonTests
-
- def setup
- @direct_controller = DirectController.new
- @delegated_controller = DelegatedController.new
- @virtual_controller = VirtualController.new
- @layered_controller = LayeredController.new
- @protocol = ActionWebService::Protocol::Soap::SoapProtocol.create(@direct_controller)
- end
-
- def test_wsdl_generation
- ensure_valid_wsdl_generation DelegatedController.new, DispatcherTest::WsdlNamespace
- ensure_valid_wsdl_generation DirectController.new, DispatcherTest::WsdlNamespace
- end
-
- def test_wsdl_action
- delegated_types = ensure_valid_wsdl_action DelegatedController.new
- delegated_names = delegated_types.map{|x| x.name.name}
- assert(delegated_names.include?('DispatcherTest..NodeArray'))
- assert(delegated_names.include?('DispatcherTest..Node'))
- direct_types = ensure_valid_wsdl_action DirectController.new
- direct_names = direct_types.map{|x| x.name.name}
- assert(direct_names.include?('DispatcherTest..NodeArray'))
- assert(direct_names.include?('DispatcherTest..Node'))
- assert(direct_names.include?('IntegerArray'))
- end
-
- def test_autoloading
- assert(!AutoLoadController.web_service_api.nil?)
- assert(AutoLoadController.web_service_api.has_public_api_method?('Void'))
- assert(FailingAutoLoadController.web_service_api.nil?)
- assert_raises(MissingSourceFile) do
- FailingAutoLoadController.require_web_service_api :blah
- end
- assert_raises(ArgumentError) do
- FailingAutoLoadController.require_web_service_api 50.0
- end
- assert(BrokenAutoLoadController.web_service_api.nil?)
- end
-
- def test_layered_dispatching
- mt_cats = do_method_call(@layered_controller, 'mt.getCategories')
- assert_equal(["mtCat1", "mtCat2"], mt_cats)
- blogger_cats = do_method_call(@layered_controller, 'blogger.getCategories')
- assert_equal(["bloggerCat1", "bloggerCat2"], blogger_cats)
- end
-
- def test_utf8
- @direct_controller.web_service_exception_reporting = true
- $KCODE = 'u'
- assert_equal(Utf8String, do_method_call(@direct_controller, 'TestUtf8'))
- retval = SOAP::Processor.unmarshal(@response_body).body.response
- assert retval.is_a?(SOAP::SOAPString)
-
- # If $KCODE is not set to UTF-8, any strings with non-ASCII UTF-8 data
- # will be sent back as base64 by SOAP4R. By the time we get it here though,
- # it will be decoded back into a string. So lets read the base64 value
- # from the message body directly.
- $KCODE = 'NONE'
- do_method_call(@direct_controller, 'TestUtf8')
- retval = SOAP::Processor.unmarshal(@response_body).body.response
- assert retval.is_a?(SOAP::SOAPBase64)
- assert_equal "T25lIFdvcmxkIENhZsOp", retval.data.to_s
- end
-
- protected
- def exception_message(soap_fault_exception)
- soap_fault_exception.detail.cause.message
- end
-
- def is_exception?(obj)
- obj.respond_to?(:detail) && obj.detail.respond_to?(:cause) && \
- obj.detail.cause.is_a?(Exception)
- end
-
- def service_name(container)
- container.is_a?(DelegatedController) ? 'test_service' : 'api'
- end
-
- def ensure_valid_wsdl_generation(controller, expected_namespace)
- wsdl = controller.generate_wsdl
- ensure_valid_wsdl(controller, wsdl, expected_namespace)
- end
-
- def ensure_valid_wsdl(controller, wsdl, expected_namespace)
- definitions = WSDL::Parser.new.parse(wsdl)
- assert(definitions.is_a?(WSDL::Definitions))
- definitions.bindings.each do |binding|
- assert(binding.name.name.index(':').nil?)
- end
- definitions.services.each do |service|
- service.ports.each do |port|
- assert(port.name.name.index(':').nil?)
- end
- end
- types = definitions.collect_complextypes.map{|x| x.name}
- types.each do |type|
- assert(type.namespace == expected_namespace)
- end
- location = definitions.services[0].ports[0].soap_address.location
- if controller.is_a?(DelegatedController)
- assert_match %r{http://test.host/dispatcher_test/delegated/test_service$}, location
- elsif controller.is_a?(DirectController)
- assert_match %r{http://test.host/dispatcher_test/direct/api$}, location
- end
- definitions.collect_complextypes
- end
-
- def ensure_valid_wsdl_action(controller)
- test_request = ActionController::TestRequest.new({ 'action' => 'wsdl' })
- test_response = ActionController::TestResponse.new
- wsdl = controller.process(test_request, test_response).body
- ensure_valid_wsdl(controller, wsdl, DispatcherTest::WsdlNamespace)
- end
-end
diff --git a/vendor/rails/actionwebservice/test/dispatcher_action_controller_xmlrpc_test.rb b/vendor/rails/actionwebservice/test/dispatcher_action_controller_xmlrpc_test.rb
deleted file mode 100644
index 8add5766..00000000
--- a/vendor/rails/actionwebservice/test/dispatcher_action_controller_xmlrpc_test.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-require File.dirname(__FILE__) + '/abstract_dispatcher'
-
-class TC_DispatcherActionControllerXmlRpc < Test::Unit::TestCase
- include DispatcherTest
- include DispatcherCommonTests
-
- def setup
- @direct_controller = DirectController.new
- @delegated_controller = DelegatedController.new
- @layered_controller = LayeredController.new
- @virtual_controller = VirtualController.new
- @protocol = ActionWebService::Protocol::XmlRpc::XmlRpcProtocol.create(@direct_controller)
- end
-
- def test_layered_dispatching
- mt_cats = do_method_call(@layered_controller, 'mt.getCategories')
- assert_equal(["mtCat1", "mtCat2"], mt_cats)
- blogger_cats = do_method_call(@layered_controller, 'blogger.getCategories')
- assert_equal(["bloggerCat1", "bloggerCat2"], blogger_cats)
- end
-
- def test_multicall
- response = do_method_call(@layered_controller, 'system.multicall', [
- {'methodName' => 'mt.getCategories'},
- {'methodName' => 'blogger.getCategories'},
- {'methodName' => 'mt.bool'},
- {'methodName' => 'blogger.str', 'params' => ['2000']},
- {'methodName' => 'mt.alwaysFail'},
- {'methodName' => 'blogger.alwaysFail'},
- {'methodName' => 'mt.blah'},
- {'methodName' => 'blah.blah'},
- {'methodName' => 'mt.person'}
- ])
- assert_equal [
- [["mtCat1", "mtCat2"]],
- [["bloggerCat1", "bloggerCat2"]],
- [true],
- ["2500"],
- {"faultCode" => 3, "faultString" => "MT AlwaysFail"},
- {"faultCode" => 3, "faultString" => "Blogger AlwaysFail"},
- {"faultCode" => 4, "faultMessage" => "no such method 'blah' on API DispatcherTest::MTAPI"},
- {"faultCode" => 4, "faultMessage" => "no such web service 'blah'"},
- [{"name"=>"person1", "id"=>1}]
- ], response
- end
-
- protected
- def exception_message(xmlrpc_fault_exception)
- xmlrpc_fault_exception.faultString
- end
-
- def is_exception?(obj)
- obj.is_a?(XMLRPC::FaultException)
- end
-
- def service_name(container)
- container.is_a?(DelegatedController) ? 'test_service' : 'api'
- end
-end
diff --git a/vendor/rails/actionwebservice/test/fixtures/db_definitions/mysql.sql b/vendor/rails/actionwebservice/test/fixtures/db_definitions/mysql.sql
deleted file mode 100644
index 8e01eef4..00000000
--- a/vendor/rails/actionwebservice/test/fixtures/db_definitions/mysql.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-CREATE TABLE `users` (
- `id` int(11) NOT NULL auto_increment,
- `name` varchar(30) default NULL,
- `active` tinyint(4) default NULL,
- `balance` decimal(5, 2) default NULL,
- `created_on` date default NULL,
- PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1;
diff --git a/vendor/rails/actionwebservice/test/fixtures/users.yml b/vendor/rails/actionwebservice/test/fixtures/users.yml
deleted file mode 100644
index 926d6015..00000000
--- a/vendor/rails/actionwebservice/test/fixtures/users.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-user1:
- id: 1
- name: Kent
- active: 1
- balance: 12.2
- created_on: <%= Date.today %>
-user2:
- id: 2
- name: David
- active: 1
- balance: 16.4
- created_on: <%= Date.today %>
diff --git a/vendor/rails/actionwebservice/test/gencov b/vendor/rails/actionwebservice/test/gencov
deleted file mode 100755
index 1faab34c..00000000
--- a/vendor/rails/actionwebservice/test/gencov
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-rcov -x '.*_test\.rb,rubygems,abstract_,/run,/apis' ./run
diff --git a/vendor/rails/actionwebservice/test/invocation_test.rb b/vendor/rails/actionwebservice/test/invocation_test.rb
deleted file mode 100644
index 3ef22faf..00000000
--- a/vendor/rails/actionwebservice/test/invocation_test.rb
+++ /dev/null
@@ -1,185 +0,0 @@
-require File.dirname(__FILE__) + '/abstract_unit'
-
-module InvocationTest
- class API < ActionWebService::API::Base
- api_method :add, :expects => [:int, :int], :returns => [:int]
- api_method :transmogrify, :expects_and_returns => [:string]
- api_method :fail_with_reason
- api_method :fail_generic
- api_method :no_before
- api_method :no_after
- api_method :only_one
- api_method :only_two
- end
-
- class Interceptor
- attr :args
-
- def initialize
- @args = nil
- end
-
- def intercept(*args)
- @args = args
- end
- end
-
- InterceptorClass = Interceptor.new
-
- class Service < ActionController::Base
- web_service_api API
-
- before_invocation :intercept_before, :except => [:no_before]
- after_invocation :intercept_after, :except => [:no_after]
- prepend_after_invocation :intercept_after_first, :except => [:no_after]
- prepend_before_invocation :intercept_only, :only => [:only_one, :only_two]
- after_invocation(:only => [:only_one]) do |*args|
- args[0].instance_variable_set('@block_invoked', args[1])
- end
- after_invocation InterceptorClass, :only => [:only_one]
-
- attr_accessor :before_invoked
- attr_accessor :after_invoked
- attr_accessor :after_first_invoked
- attr_accessor :only_invoked
- attr_accessor :block_invoked
- attr_accessor :invocation_result
-
- def initialize
- @before_invoked = nil
- @after_invoked = nil
- @after_first_invoked = nil
- @only_invoked = nil
- @invocation_result = nil
- @block_invoked = nil
- end
-
- def add(a, b)
- a + b
- end
-
- def transmogrify(str)
- str.upcase
- end
-
- def fail_with_reason
- end
-
- def fail_generic
- end
-
- def no_before
- 5
- end
-
- def no_after
- end
-
- def only_one
- end
-
- def only_two
- end
-
- protected
- def intercept_before(name, args)
- @before_invoked = name
- return [false, "permission denied"] if name == :fail_with_reason
- return false if name == :fail_generic
- end
-
- def intercept_after(name, args, result)
- @after_invoked = name
- @invocation_result = result
- end
-
- def intercept_after_first(name, args, result)
- @after_first_invoked = name
- end
-
- def intercept_only(name, args)
- raise "Interception error" unless name == :only_one || name == :only_two
- @only_invoked = name
- end
- end
-end
-
-class TC_Invocation < Test::Unit::TestCase
- include ActionWebService::Invocation
-
- def setup
- @service = InvocationTest::Service.new
- end
-
- def test_invocation
- assert(perform_invocation(:add, 5, 10) == 15)
- assert(perform_invocation(:transmogrify, "hello") == "HELLO")
- assert_raises(NoMethodError) do
- perform_invocation(:nonexistent_method_xyzzy)
- end
- end
-
- def test_interceptor_registration
- assert(InvocationTest::Service.before_invocation_interceptors.length == 2)
- assert(InvocationTest::Service.after_invocation_interceptors.length == 4)
- assert_equal(:intercept_only, InvocationTest::Service.before_invocation_interceptors[0])
- assert_equal(:intercept_after_first, InvocationTest::Service.after_invocation_interceptors[0])
- end
-
- def test_interception
- assert(@service.before_invoked.nil?)
- assert(@service.after_invoked.nil?)
- assert(@service.only_invoked.nil?)
- assert(@service.block_invoked.nil?)
- assert(@service.invocation_result.nil?)
- perform_invocation(:add, 20, 50)
- assert(@service.before_invoked == :add)
- assert(@service.after_invoked == :add)
- assert(@service.invocation_result == 70)
- end
-
- def test_interception_canceling
- reason = nil
- perform_invocation(:fail_with_reason){|r| reason = r}
- assert(@service.before_invoked == :fail_with_reason)
- assert(@service.after_invoked.nil?)
- assert(@service.invocation_result.nil?)
- assert(reason == "permission denied")
- reason = true
- @service.before_invoked = @service.after_invoked = @service.invocation_result = nil
- perform_invocation(:fail_generic){|r| reason = r}
- assert(@service.before_invoked == :fail_generic)
- assert(@service.after_invoked.nil?)
- assert(@service.invocation_result.nil?)
- assert(reason == true)
- end
-
- def test_interception_except_conditions
- perform_invocation(:no_before)
- assert(@service.before_invoked.nil?)
- assert(@service.after_first_invoked == :no_before)
- assert(@service.after_invoked == :no_before)
- assert(@service.invocation_result == 5)
- @service.before_invoked = @service.after_invoked = @service.invocation_result = nil
- perform_invocation(:no_after)
- assert(@service.before_invoked == :no_after)
- assert(@service.after_invoked.nil?)
- assert(@service.invocation_result.nil?)
- end
-
- def test_interception_only_conditions
- assert(@service.only_invoked.nil?)
- perform_invocation(:only_one)
- assert(@service.only_invoked == :only_one)
- assert(@service.block_invoked == :only_one)
- assert(InvocationTest::InterceptorClass.args[1] == :only_one)
- @service.only_invoked = nil
- perform_invocation(:only_two)
- assert(@service.only_invoked == :only_two)
- end
-
- private
- def perform_invocation(method_name, *args, &block)
- @service.perform_invocation(method_name, args, &block)
- end
-end
diff --git a/vendor/rails/actionwebservice/test/run b/vendor/rails/actionwebservice/test/run
deleted file mode 100755
index c8c03727..00000000
--- a/vendor/rails/actionwebservice/test/run
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/env ruby
-require 'test/unit'
-$:.unshift(File.dirname(__FILE__) + '/../lib')
-args = Dir[File.join(File.dirname(__FILE__), '*_test.rb')] + Dir[File.join(File.dirname(__FILE__), 'ws/*_test.rb')]
-(r = Test::Unit::AutoRunner.new(true)).process_args(args)
-exit r.run
diff --git a/vendor/rails/actionwebservice/test/scaffolded_controller_test.rb b/vendor/rails/actionwebservice/test/scaffolded_controller_test.rb
deleted file mode 100644
index 722007cc..00000000
--- a/vendor/rails/actionwebservice/test/scaffolded_controller_test.rb
+++ /dev/null
@@ -1,146 +0,0 @@
-require File.dirname(__FILE__) + '/abstract_unit'
-
-ActionController::Routing::Routes.draw do |map|
- map.connect '', :controller => 'scaffolded'
- map.connect ':controller/:action/:id'
-end
-
-ActionController::Base.view_paths = [ '.' ]
-
-class ScaffoldPerson < ActionWebService::Struct
- member :id, :int
- member :name, :string
- member :birth, :date
-
- def ==(other)
- self.id == other.id && self.name == other.name
- end
-end
-
-class ScaffoldedControllerTestAPI < ActionWebService::API::Base
- api_method :hello, :expects => [{:integer=>:int}, :string], :returns => [:bool]
- api_method :hello_struct_param, :expects => [{:person => ScaffoldPerson}], :returns => [:bool]
- api_method :date_of_birth, :expects => [ScaffoldPerson], :returns => [:string]
- api_method :bye, :returns => [[ScaffoldPerson]]
- api_method :date_diff, :expects => [{:start_date => :date}, {:end_date => :date}], :returns => [:int]
- api_method :time_diff, :expects => [{:start_time => :time}, {:end_time => :time}], :returns => [:int]
- api_method :base64_upcase, :expects => [:base64], :returns => [:base64]
-end
-
-class ScaffoldedController < ActionController::Base
- web_service_api ScaffoldedControllerTestAPI
- web_service_scaffold :scaffold_invoke
-
- def hello(int, string)
- 0
- end
-
- def hello_struct_param(person)
- 0
- end
-
- def date_of_birth(person)
- person.birth.to_s
- end
-
- def bye
- [ScaffoldPerson.new(:id => 1, :name => "leon"), ScaffoldPerson.new(:id => 2, :name => "paul")]
- end
-
- def rescue_action(e)
- raise e
- end
-
- def date_diff(start_date, end_date)
- end_date - start_date
- end
-
- def time_diff(start_time, end_time)
- end_time - start_time
- end
-
- def base64_upcase(data)
- data.upcase
- end
-end
-
-class ScaffoldedControllerTest < Test::Unit::TestCase
- def setup
- @controller = ScaffoldedController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- end
-
- def test_scaffold_invoke
- get :scaffold_invoke
- assert_template 'methods.erb'
- end
-
- def test_scaffold_invoke_method_params
- get :scaffold_invoke_method_params, :service => 'scaffolded', :method => 'Hello'
- assert_template 'parameters.erb'
- end
-
- def test_scaffold_invoke_method_params_with_struct
- get :scaffold_invoke_method_params, :service => 'scaffolded', :method => 'HelloStructParam'
- assert_template 'parameters.erb'
- assert_tag :tag => 'form'
- assert_tag :tag => 'input', :attributes => {:name => "method_params[0][name]"}
- end
-
- def test_scaffold_invoke_submit_hello
- post :scaffold_invoke_submit, :service => 'scaffolded', :method => 'Hello', :method_params => {'0' => '5', '1' => 'hello world'}
- assert_template 'result.erb'
- assert_equal false, @controller.instance_eval{ @method_return_value }
- end
-
- def test_scaffold_invoke_submit_bye
- post :scaffold_invoke_submit, :service => 'scaffolded', :method => 'Bye'
- assert_template 'result.erb'
- persons = [ScaffoldPerson.new(:id => 1, :name => "leon"), ScaffoldPerson.new(:id => 2, :name => "paul")]
- assert_equal persons, @controller.instance_eval{ @method_return_value }
- end
-
- def test_scaffold_date_params
- get :scaffold_invoke_method_params, :service => 'scaffolded', :method => 'DateDiff'
- (0..1).each do |param|
- (1..3).each do |date_part|
- assert_tag :tag => 'select', :attributes => {:name => "method_params[#{param}][#{date_part}]"},
- :children => {:greater_than => 1, :only => {:tag => 'option'}}
- end
- end
-
- post :scaffold_invoke_submit, :service => 'scaffolded', :method => 'DateDiff',
- :method_params => {'0' => {'1' => '2006', '2' => '2', '3' => '1'}, '1' => {'1' => '2006', '2' => '2', '3' => '2'}}
- assert_equal 1, @controller.instance_eval{ @method_return_value }
- end
-
- def test_scaffold_struct_date_params
- post :scaffold_invoke_submit, :service => 'scaffolded', :method => 'DateOfBirth',
- :method_params => {'0' => {'birth' => {'1' => '2006', '2' => '2', '3' => '1'}, 'id' => '1', 'name' => 'person'}}
- assert_equal '2006-02-01', @controller.instance_eval{ @method_return_value }
- end
-
- def test_scaffold_time_params
- get :scaffold_invoke_method_params, :service => 'scaffolded', :method => 'TimeDiff'
- (0..1).each do |param|
- (1..6).each do |date_part|
- assert_tag :tag => 'select', :attributes => {:name => "method_params[#{param}][#{date_part}]"},
- :children => {:greater_than => 1, :only => {:tag => 'option'}}
- end
- end
-
- post :scaffold_invoke_submit, :service => 'scaffolded', :method => 'TimeDiff',
- :method_params => {'0' => {'1' => '2006', '2' => '2', '3' => '1', '4' => '1', '5' => '1', '6' => '1'},
- '1' => {'1' => '2006', '2' => '2', '3' => '2', '4' => '1', '5' => '1', '6' => '1'}}
- assert_equal 86400, @controller.instance_eval{ @method_return_value }
- end
-
- def test_scaffold_base64
- get :scaffold_invoke_method_params, :service => 'scaffolded', :method => 'Base64Upcase'
- assert_tag :tag => 'textarea', :attributes => {:name => 'method_params[0]'}
-
- post :scaffold_invoke_submit, :service => 'scaffolded', :method => 'Base64Upcase', :method_params => {'0' => 'scaffold'}
- assert_equal 'SCAFFOLD', @controller.instance_eval{ @method_return_value }
- end
-end
diff --git a/vendor/rails/actionwebservice/test/struct_test.rb b/vendor/rails/actionwebservice/test/struct_test.rb
deleted file mode 100644
index f689746e..00000000
--- a/vendor/rails/actionwebservice/test/struct_test.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-require File.dirname(__FILE__) + '/abstract_unit'
-
-module StructTest
- class Struct < ActionWebService::Struct
- member :id, Integer
- member :name, String
- member :items, [String]
- member :deleted, :bool
- member :emails, [:string]
- end
-end
-
-class TC_Struct < Test::Unit::TestCase
- include StructTest
-
- def setup
- @struct = Struct.new(:id => 5,
- :name => 'hello',
- :items => ['one', 'two'],
- :deleted => true,
- :emails => ['test@test.com'])
- end
-
- def test_members
- assert_equal(5, Struct.members.size)
- assert_equal(Integer, Struct.members[:id].type_class)
- assert_equal(String, Struct.members[:name].type_class)
- assert_equal(String, Struct.members[:items].element_type.type_class)
- assert_equal(TrueClass, Struct.members[:deleted].type_class)
- assert_equal(String, Struct.members[:emails].element_type.type_class)
- end
-
- def test_initializer_and_lookup
- assert_equal(5, @struct.id)
- assert_equal('hello', @struct.name)
- assert_equal(['one', 'two'], @struct.items)
- assert_equal(true, @struct.deleted)
- assert_equal(['test@test.com'], @struct.emails)
- assert_equal(5, @struct['id'])
- assert_equal('hello', @struct['name'])
- assert_equal(['one', 'two'], @struct['items'])
- assert_equal(true, @struct['deleted'])
- assert_equal(['test@test.com'], @struct['emails'])
- end
-
- def test_each_pair
- @struct.each_pair do |name, value|
- assert_equal @struct.__send__(name), value
- assert_equal @struct[name], value
- end
- end
-end
diff --git a/vendor/rails/actionwebservice/test/test_invoke_test.rb b/vendor/rails/actionwebservice/test/test_invoke_test.rb
deleted file mode 100644
index 72ebc719..00000000
--- a/vendor/rails/actionwebservice/test/test_invoke_test.rb
+++ /dev/null
@@ -1,112 +0,0 @@
-require File.dirname(__FILE__) + '/abstract_unit'
-require 'action_web_service/test_invoke'
-
-class TestInvokeAPI < ActionWebService::API::Base
- api_method :null
- api_method :add, :expects => [:int, :int], :returns => [:int]
-end
-
-class TestInvokeService < ActionWebService::Base
- web_service_api TestInvokeAPI
-
- attr :invoked
-
- def add(a, b)
- @invoked = true
- a + b
- end
-
- def null
- end
-end
-
-class TestController < ActionController::Base
- def rescue_action(e); raise e; end
-end
-
-class TestInvokeDirectController < TestController
- web_service_api TestInvokeAPI
-
- attr :invoked
-
- def add
- @invoked = true
- @method_params[0] + @method_params[1]
- end
-
- def null
- end
-end
-
-class TestInvokeDelegatedController < TestController
- web_service_dispatching_mode :delegated
- web_service :service, TestInvokeService.new
-end
-
-class TestInvokeLayeredController < TestController
- web_service_dispatching_mode :layered
- web_service(:one) { @service_one ||= TestInvokeService.new }
- web_service(:two) { @service_two ||= TestInvokeService.new }
-end
-
-class TestInvokeTest < Test::Unit::TestCase
- def setup
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- end
-
- def test_direct_add
- @controller = TestInvokeDirectController.new
- assert_equal nil, @controller.invoked
- result = invoke :add, 25, 25
- assert_equal 50, result
- assert_equal true, @controller.invoked
- end
-
- def test_delegated_add
- @controller = TestInvokeDelegatedController.new
- assert_equal nil, @controller.web_service_object(:service).invoked
- result = invoke_delegated :service, :add, 100, 50
- assert_equal 150, result
- assert_equal true, @controller.web_service_object(:service).invoked
- end
-
- def test_layered_add
- [:soap, :xmlrpc].each do |protocol|
- @protocol = protocol
- [:one, :two].each do |service|
- @controller = TestInvokeLayeredController.new
- assert_equal nil, @controller.web_service_object(service).invoked
- result = invoke_layered service, :add, 200, -50
- assert_equal 150, result
- assert_equal true, @controller.web_service_object(service).invoked
- end
- end
- end
-
- def test_layered_fail_with_wrong_number_of_arguments
- [:soap, :xmlrpc].each do |protocol|
- @protocol = protocol
- [:one, :two].each do |service|
- @controller = TestInvokeLayeredController.new
- assert_raise(ArgumentError) { invoke_layered service, :add, 1 }
- end
- end
- end
-
- def test_delegated_fail_with_wrong_number_of_arguments
- @controller = TestInvokeDelegatedController.new
- assert_raise(ArgumentError) { invoke_delegated :service, :add, 1 }
- end
-
- def test_direct_fail_with_wrong_number_of_arguments
- @controller = TestInvokeDirectController.new
- assert_raise(ArgumentError) { invoke :add, 1 }
- end
-
- def test_with_no_parameters_declared
- @controller = TestInvokeDirectController.new
- assert_nil invoke(:null)
- end
-
-end
diff --git a/vendor/rails/activemodel/CHANGES b/vendor/rails/activemodel/CHANGES
deleted file mode 100644
index a9f9c275..00000000
--- a/vendor/rails/activemodel/CHANGES
+++ /dev/null
@@ -1,12 +0,0 @@
-Changes from extracting bits to ActiveModel
-
-* ActiveModel::Observer#add_observer!
-
- It has a custom hook to define after_find that should really be in a
- ActiveRecord::Observer subclass:
-
- def add_observer!(klass)
- klass.add_observer(self)
- klass.class_eval 'def after_find() end' unless
- klass.respond_to?(:after_find)
- end
\ No newline at end of file
diff --git a/vendor/rails/activemodel/README b/vendor/rails/activemodel/README
deleted file mode 100644
index c20f732a..00000000
--- a/vendor/rails/activemodel/README
+++ /dev/null
@@ -1,21 +0,0 @@
-Active Model
-==============
-
-Totally experimental library that aims to extract common model mixins from
-ActiveRecord for use in ActiveResource (and other similar libraries).
-This is in a very rough state (no autotest or spec rake tasks set up yet),
-so please excuse the mess.
-
-Here's what I plan to extract:
- * ActiveModel::Observing
- * ActiveModel::Callbacks
- * ActiveModel::Validations
-
- # for ActiveResource params and ActiveRecord options
- * ActiveModel::Scoping
-
- # to_json, to_xml, etc
- * ActiveModel::Serialization
-
-I'm trying to keep ActiveRecord compatibility where possible, but I'm
-annotating the spots where I'm diverging a bit.
\ No newline at end of file
diff --git a/vendor/rails/activemodel/Rakefile b/vendor/rails/activemodel/Rakefile
deleted file mode 100644
index 87e9b547..00000000
--- a/vendor/rails/activemodel/Rakefile
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-$LOAD_PATH << File.join(File.dirname(__FILE__), 'vendor', 'rspec', 'lib')
-require 'rake'
-require 'spec/rake/spectask'
-require 'rake/rdoctask'
-
-# Generate the RDoc documentation
-Rake::RDocTask.new { |rdoc|
- rdoc.rdoc_dir = 'doc'
- rdoc.title = "Active Model"
- rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
- rdoc.options << '--charset' << 'utf-8'
- rdoc.template = "#{ENV['template']}.rb" if ENV['template']
- rdoc.rdoc_files.include('README', 'CHANGES')
- rdoc.rdoc_files.include('lib/**/*.rb')
-}
\ No newline at end of file
diff --git a/vendor/rails/activemodel/lib/active_model.rb b/vendor/rails/activemodel/lib/active_model.rb
deleted file mode 100644
index 369c7fed..00000000
--- a/vendor/rails/activemodel/lib/active_model.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-$LOAD_PATH << File.join(File.dirname(__FILE__), '..', '..', 'activesupport', 'lib')
-
-# premature optimization?
-require 'active_support/inflector'
-require 'active_support/core_ext/string/inflections'
-String.send :include, ActiveSupport::CoreExtensions::String::Inflections
-
-require 'active_model/base'
-require 'active_model/observing'
-require 'active_model/callbacks'
-require 'active_model/validations'
-
-ActiveModel::Base.class_eval do
- include ActiveModel::Observing
- include ActiveModel::Callbacks
- include ActiveModel::Validations
-end
\ No newline at end of file
diff --git a/vendor/rails/activemodel/lib/active_model/base.rb b/vendor/rails/activemodel/lib/active_model/base.rb
deleted file mode 100644
index 1141156d..00000000
--- a/vendor/rails/activemodel/lib/active_model/base.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-module ActiveModel
- class Base
- end
-end
\ No newline at end of file
diff --git a/vendor/rails/activemodel/lib/active_model/callbacks.rb b/vendor/rails/activemodel/lib/active_model/callbacks.rb
deleted file mode 100644
index 0114fc38..00000000
--- a/vendor/rails/activemodel/lib/active_model/callbacks.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-module ActiveModel
- module Callbacks
-
- end
-end
\ No newline at end of file
diff --git a/vendor/rails/activemodel/lib/active_model/deprecated_error_methods.rb b/vendor/rails/activemodel/lib/active_model/deprecated_error_methods.rb
deleted file mode 100644
index e0cbd9ba..00000000
--- a/vendor/rails/activemodel/lib/active_model/deprecated_error_methods.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-module ActiveModel
- module DeprecatedErrorMethods
- def on(attribute)
- ActiveSupport::Deprecation.warn "Errors#on have been deprecated, use Errors#[] instead"
- self[attribute]
- end
-
- def on_base
- ActiveSupport::Deprecation.warn "Errors#on_base have been deprecated, use Errors#[:base] instead"
- on(:base)
- end
-
- def add(attribute, msg = Errors.default_error_messages[:invalid])
- ActiveSupport::Deprecation.warn "Errors#add(attribute, msg) has been deprecated, use Errors#[attribute] << msg instead"
- self[attribute] << msg
- end
-
- def add_to_base(msg)
- ActiveSupport::Deprecation.warn "Errors#add_to_base(msg) has been deprecated, use Errors#[:base] << msg instead"
- self[:base] << msg
- end
-
- def invalid?(attribute)
- ActiveSupport::Deprecation.warn "Errors#invalid?(attribute) has been deprecated, use Errors#[attribute].any? instead"
- self[attribute].any?
- end
-
- def full_messages
- ActiveSupport::Deprecation.warn "Errors#full_messages has been deprecated, use Errors#to_a instead"
- to_a
- end
-
- def each_full
- ActiveSupport::Deprecation.warn "Errors#each_full has been deprecated, use Errors#to_a.each instead"
- to_a.each { |error| yield error }
- end
- end
-end
\ No newline at end of file
diff --git a/vendor/rails/activemodel/lib/active_model/errors.rb b/vendor/rails/activemodel/lib/active_model/errors.rb
deleted file mode 100644
index a99bb001..00000000
--- a/vendor/rails/activemodel/lib/active_model/errors.rb
+++ /dev/null
@@ -1,80 +0,0 @@
-module ActiveModel
- class Errors < Hash
- include DeprecatedErrorMethods
-
- @@default_error_messages = {
- :inclusion => "is not included in the list",
- :exclusion => "is reserved",
- :invalid => "is invalid",
- :confirmation => "doesn't match confirmation",
- :accepted => "must be accepted",
- :empty => "can't be empty",
- :blank => "can't be blank",
- :too_long => "is too long (maximum is %d characters)",
- :too_short => "is too short (minimum is %d characters)",
- :wrong_length => "is the wrong length (should be %d characters)",
- :taken => "has already been taken",
- :not_a_number => "is not a number",
- :greater_than => "must be greater than %d",
- :greater_than_or_equal_to => "must be greater than or equal to %d",
- :equal_to => "must be equal to %d",
- :less_than => "must be less than %d",
- :less_than_or_equal_to => "must be less than or equal to %d",
- :odd => "must be odd",
- :even => "must be even"
- }
-
- # Holds a hash with all the default error messages that can be replaced by your own copy or localizations.
- cattr_accessor :default_error_messages
-
- alias_method :get, :[]
- alias_method :set, :[]=
-
- def [](attribute)
- if errors = get(attribute.to_sym)
- errors.size == 1 ? errors.first : errors
- else
- set(attribute.to_sym, [])
- end
- end
-
- def []=(attribute, error)
- self[attribute.to_sym] << error
- end
-
- def each
- each_key do |attribute|
- self[attribute].each { |error| yield attribute, error }
- end
- end
-
- def size
- values.flatten.size
- end
-
- def to_a
- inject([]) do |errors_with_attributes, (attribute, errors)|
- if error.blank?
- errors_with_attributes
- else
- if attr == :base
- errors_with_attributes << error
- else
- errors_with_attributes << (attribute.to_s.humanize + " " + error)
- end
- end
- end
- end
-
- def to_xml(options={})
- options[:root] ||= "errors"
- options[:indent] ||= 2
- options[:builder] ||= Builder::XmlMarkup.new(:indent => options[:indent])
-
- options[:builder].instruct! unless options.delete(:skip_instruct)
- options[:builder].errors do |e|
- to_a.each { |error| e.error(error) }
- end
- end
- end
-end
\ No newline at end of file
diff --git a/vendor/rails/activemodel/lib/active_model/observing.rb b/vendor/rails/activemodel/lib/active_model/observing.rb
deleted file mode 100644
index db758f51..00000000
--- a/vendor/rails/activemodel/lib/active_model/observing.rb
+++ /dev/null
@@ -1,100 +0,0 @@
-require 'observer'
-
-module ActiveModel
- module Observing
- module ClassMethods
- def observers
- @observers ||= []
- end
-
- def observers=(*values)
- @observers = values.flatten
- end
-
- def instantiate_observers
- observers.each { |o| instantiate_observer(o) }
- end
-
- protected
- def instantiate_observer(observer)
- # string/symbol
- if observer.respond_to?(:to_sym)
- observer = observer.to_s.camelize.constantize.instance
- elsif observer.respond_to?(:instance)
- observer.instance
- else
- raise ArgumentError, "#{observer} must be a lowercase, underscored class name (or an instance of the class itself) responding to the instance method. Example: Person.observers = :big_brother # calls BigBrother.instance"
- end
- end
-
- # Notify observers when the observed class is subclassed.
- def inherited(subclass)
- super
- changed
- notify_observers :observed_class_inherited, subclass
- end
- end
-
- def self.included(receiver)
- receiver.extend Observable, ClassMethods
- end
- end
-
- class Observer
- include Singleton
- attr_writer :observed_classes
-
- class << self
- attr_accessor :models
- # Attaches the observer to the supplied model classes.
- def observe(*models)
- @models = models.flatten
- @models.collect! { |model| model.respond_to?(:to_sym) ? model.to_s.camelize.constantize : model }
- end
-
- def observed_class_name
- @observed_class_name ||=
- if guessed_name = name.scan(/(.*)Observer/)[0]
- @observed_class_name = guessed_name[0]
- end
- end
-
- # The class observed by default is inferred from the observer's class name:
- # assert_equal [Person], PersonObserver.observed_class
- def observed_class
- if observed_class_name
- observed_class_name.constantize
- else
- nil
- end
- end
- end
-
- # Start observing the declared classes and their subclasses.
- def initialize
- self.observed_classes = self.class.models if self.class.models
- observed_classes.each { |klass| add_observer! klass }
- end
-
- # Send observed_method(object) if the method exists.
- def update(observed_method, object) #:nodoc:
- send(observed_method, object) if respond_to?(observed_method)
- end
-
- # Special method sent by the observed class when it is inherited.
- # Passes the new subclass.
- def observed_class_inherited(subclass) #:nodoc:
- self.class.observe(observed_classes + [subclass])
- add_observer!(subclass)
- end
-
- protected
- def observed_classes
- @observed_classes ||= [self.class.observed_class]
- end
-
- def add_observer!(klass)
- klass.add_observer(self)
- end
- end
-end
\ No newline at end of file
diff --git a/vendor/rails/activemodel/lib/active_model/validations.rb b/vendor/rails/activemodel/lib/active_model/validations.rb
deleted file mode 100644
index 34ef3b8f..00000000
--- a/vendor/rails/activemodel/lib/active_model/validations.rb
+++ /dev/null
@@ -1,124 +0,0 @@
-module ActiveModel
- module Validations
- def self.included(base) # :nodoc:
- base.extend(ClassMethods)
- base.send!(:include, ActiveSupport::Callbacks)
- base.define_callbacks :validate, :validate_on_create, :validate_on_update
- end
-
- module ClassMethods
- DEFAULT_VALIDATION_OPTIONS = { :on => :save, :allow_nil => false, :allow_blank => false, :message => nil }.freeze
-
- # Adds a validation method or block to the class. This is useful when
- # overriding the +validate+ instance method becomes too unwieldly and
- # you're looking for more descriptive declaration of your validations.
- #
- # This can be done with a symbol pointing to a method:
- #
- # class Comment < ActiveRecord::Base
- # validate :must_be_friends
- #
- # def must_be_friends
- # errors.add_to_base("Must be friends to leave a comment") unless commenter.friend_of?(commentee)
- # end
- # end
- #
- # Or with a block which is passed the current record to be validated:
- #
- # class Comment < ActiveRecord::Base
- # validate do |comment|
- # comment.must_be_friends
- # end
- #
- # def must_be_friends
- # errors.add_to_base("Must be friends to leave a comment") unless commenter.friend_of?(commentee)
- # end
- # end
- #
- # This usage applies to +validate_on_create+ and +validate_on_update as well+.
- #
- # Validates each attribute against a block.
- #
- # class Person < ActiveRecord::Base
- # validates_each :first_name, :last_name do |record, attr, value|
- # record.errors.add attr, 'starts with z.' if value[0] == ?z
- # end
- # end
- #
- # Options:
- # * :on - Specifies when this validation is active (default is :save, other options :create, :update)
- # * :allow_nil - Skip validation if attribute is +nil+.
- # * :allow_blank - Skip validation if attribute is blank.
- # * :if - Specifies a method, proc or string to call to determine if the validation should
- # occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }). The
- # method, proc or string should return or evaluate to a true or false value.
- # * :unless - Specifies a method, proc or string to call to determine if the validation should
- # not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }). The
- # method, proc or string should return or evaluate to a true or false value.
- def validates_each(*attrs)
- options = attrs.extract_options!.symbolize_keys
- attrs = attrs.flatten
-
- # Declare the validation.
- send(validation_method(options[:on] || :save), options) do |record|
- attrs.each do |attr|
- value = record.send(attr)
- next if (value.nil? && options[:allow_nil]) || (value.blank? && options[:allow_blank])
- yield record, attr, value
- end
- end
- end
-
- private
- def validation_method(on)
- case on
- when :save then :validate
- when :create then :validate_on_create
- when :update then :validate_on_update
- end
- end
- end
-
- # Returns the Errors object that holds all information about attribute error messages.
- def errors
- @errors ||= Errors.new
- end
-
- # Runs all the specified validations and returns true if no errors were added otherwise false.
- def valid?
- errors.clear
-
- run_callbacks(:validate)
-
- if responds_to?(:validate)
- ActiveSupport::Deprecations.warn "Base#validate has been deprecated, please use Base.validate :method instead"
- validate
- end
-
- if new_record?
- run_callbacks(:validate_on_create)
-
- if responds_to?(:validate_on_create)
- ActiveSupport::Deprecations.warn(
- "Base#validate_on_create has been deprecated, please use Base.validate_on_create :method instead")
- validate_on_create
- end
- else
- run_callbacks(:validate_on_update)
-
- if responds_to?(:validate_on_update)
- ActiveSupport::Deprecations.warn(
- "Base#validate_on_update has been deprecated, please use Base.validate_on_update :method instead")
- validate_on_update
- end
- end
-
- errors.empty?
- end
- end
-end
-
-Dir[File.dirname(__FILE__) + "/validations/*.rb"].sort.each do |path|
- filename = File.basename(path)
- require "active_model/validations/#{filename}"
-end
\ No newline at end of file
diff --git a/vendor/rails/activemodel/lib/active_model/validations/acceptance.rb b/vendor/rails/activemodel/lib/active_model/validations/acceptance.rb
deleted file mode 100644
index 9be7d51f..00000000
--- a/vendor/rails/activemodel/lib/active_model/validations/acceptance.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-module ActiveModel
- module Validations
- module ClassMethods
- # Encapsulates the pattern of wanting to validate the acceptance of a terms of service check box (or similar agreement). Example:
- #
- # class Person < ActiveRecord::Base
- # validates_acceptance_of :terms_of_service
- # validates_acceptance_of :eula, :message => "must be abided"
- # end
- #
- # If the database column does not exist, the :terms_of_service attribute is entirely virtual. This check is
- # performed only if :terms_of_service is not +nil+ and by default on save.
- #
- # Configuration options:
- # * :message - A custom error message (default is: "must be accepted")
- # * :on - Specifies when this validation is active (default is :save, other options :create, :update)
- # * :allow_nil - Skip validation if attribute is +nil+. (default is +true+)
- # * :accept - Specifies value that is considered accepted. The default value is a string "1", which
- # makes it easy to relate to an HTML checkbox. This should be set to +true+ if you are validating a database
- # column, since the attribute is typecasted from "1" to +true+ before validation.
- # * :if - Specifies a method, proc or string to call to determine if the validation should
- # occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }). The
- # method, proc or string should return or evaluate to a true or false value.
- # * :unless - Specifies a method, proc or string to call to determine if the validation should
- # not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }). The
- # method, proc or string should return or evaluate to a true or false value.
- def validates_acceptance_of(*attr_names)
- configuration = { :message => ActiveRecord::Errors.default_error_messages[:accepted], :on => :save, :allow_nil => true, :accept => "1" }
- configuration.update(attr_names.extract_options!)
-
- db_cols = begin
- column_names
- rescue ActiveRecord::StatementInvalid
- []
- end
- names = attr_names.reject { |name| db_cols.include?(name.to_s) }
- attr_accessor(*names)
-
- validates_each(attr_names,configuration) do |record, attr_name, value|
- record.errors.add(attr_name, configuration[:message]) unless value == configuration[:accept]
- end
- end
- end
- end
-end
\ No newline at end of file
diff --git a/vendor/rails/activemodel/lib/active_model/validations/associated.rb b/vendor/rails/activemodel/lib/active_model/validations/associated.rb
deleted file mode 100644
index b2d78af5..00000000
--- a/vendor/rails/activemodel/lib/active_model/validations/associated.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-module ActiveModel
- module Validations
- module ClassMethods
- # Validates whether the associated object or objects are all valid themselves. Works with any kind of association.
- #
- # class Book < ActiveRecord::Base
- # has_many :pages
- # belongs_to :library
- #
- # validates_associated :pages, :library
- # end
- #
- # Warning: If, after the above definition, you then wrote:
- #
- # class Page < ActiveRecord::Base
- # belongs_to :book
- #
- # validates_associated :book
- # end
- #
- # ...this would specify a circular dependency and cause infinite recursion.
- #
- # NOTE: This validation will not fail if the association hasn't been assigned. If you want to ensure that the association
- # is both present and guaranteed to be valid, you also need to use +validates_presence_of+.
- #
- # Configuration options:
- # * :message - A custom error message (default is: "is invalid")
- # * :on - Specifies when this validation is active (default is :save, other options :create, :update)
- # * :if - Specifies a method, proc or string to call to determine if the validation should
- # occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }). The
- # method, proc or string should return or evaluate to a true or false value.
- # * :unless - Specifies a method, proc or string to call to determine if the validation should
- # not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }). The
- # method, proc or string should return or evaluate to a true or false value.
- def validates_associated(*attr_names)
- configuration = { :message => ActiveRecord::Errors.default_error_messages[:invalid], :on => :save }
- configuration.update(attr_names.extract_options!)
-
- validates_each(attr_names, configuration) do |record, attr_name, value|
- record.errors.add(attr_name, configuration[:message]) unless
- (value.is_a?(Array) ? value : [value]).inject(true) { |v, r| (r.nil? || r.valid?) && v }
- end
- end
- end
- end
-end
\ No newline at end of file
diff --git a/vendor/rails/activemodel/lib/active_model/validations/confirmation.rb b/vendor/rails/activemodel/lib/active_model/validations/confirmation.rb
deleted file mode 100644
index ba4a18ad..00000000
--- a/vendor/rails/activemodel/lib/active_model/validations/confirmation.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-module ActiveModel
- module Validations
- module ClassMethods
- # Encapsulates the pattern of wanting to validate a password or email address field with a confirmation. Example:
- #
- # Model:
- # class Person < ActiveRecord::Base
- # validates_confirmation_of :user_name, :password
- # validates_confirmation_of :email_address, :message => "should match confirmation"
- # end
- #
- # View:
- # <%= password_field "person", "password" %>
- # <%= password_field "person", "password_confirmation" %>
- #
- # The added +password_confirmation+ attribute is virtual; it exists only as an in-memory attribute for validating the password.
- # To achieve this, the validation adds accessors to the model for the confirmation attribute. NOTE: This check is performed
- # only if +password_confirmation+ is not +nil+, and by default only on save. To require confirmation, make sure to add a presence
- # check for the confirmation attribute:
- #
- # validates_presence_of :password_confirmation, :if => :password_changed?
- #
- # Configuration options:
- # * :message - A custom error message (default is: "doesn't match confirmation")
- # * :on - Specifies when this validation is active (default is :save, other options :create, :update)
- # * :if - Specifies a method, proc or string to call to determine if the validation should
- # occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }). The
- # method, proc or string should return or evaluate to a true or false value.
- # * :unless - Specifies a method, proc or string to call to determine if the validation should
- # not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }). The
- # method, proc or string should return or evaluate to a true or false value.
- def validates_confirmation_of(*attr_names)
- configuration = { :message => ActiveRecord::Errors.default_error_messages[:confirmation], :on => :save }
- configuration.update(attr_names.extract_options!)
-
- attr_accessor(*(attr_names.map { |n| "#{n}_confirmation" }))
-
- validates_each(attr_names, configuration) do |record, attr_name, value|
- record.errors.add(attr_name, configuration[:message]) unless record.send("#{attr_name}_confirmation").nil? or value == record.send("#{attr_name}_confirmation")
- end
- end
- end
- end
-end
\ No newline at end of file
diff --git a/vendor/rails/activemodel/lib/active_model/validations/exclusion.rb b/vendor/rails/activemodel/lib/active_model/validations/exclusion.rb
deleted file mode 100644
index f3367abc..00000000
--- a/vendor/rails/activemodel/lib/active_model/validations/exclusion.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-module ActiveModel
- module Validations
- module ClassMethods
- # Validates that the value of the specified attribute is not in a particular enumerable object.
- #
- # class Person < ActiveRecord::Base
- # validates_exclusion_of :username, :in => %w( admin superuser ), :message => "You don't belong here"
- # validates_exclusion_of :age, :in => 30..60, :message => "This site is only for under 30 and over 60"
- # validates_exclusion_of :format, :in => %w( mov avi ), :message => "extension %s is not allowed"
- # end
- #
- # Configuration options:
- # * :in - An enumerable object of items that the value shouldn't be part of
- # * :message - Specifies a custom error message (default is: "is reserved")
- # * :allow_nil - If set to +true+, skips this validation if the attribute is +nil+ (default is: +false+)
- # * :allow_blank - If set to +true+, skips this validation if the attribute is blank (default is: +false+)
- # * :if - Specifies a method, proc or string to call to determine if the validation should
- # occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }). The
- # method, proc or string should return or evaluate to a true or false value.
- # * :unless - Specifies a method, proc or string to call to determine if the validation should
- # not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }). The
- # method, proc or string should return or evaluate to a true or false value.
- def validates_exclusion_of(*attr_names)
- configuration = { :message => ActiveRecord::Errors.default_error_messages[:exclusion], :on => :save }
- configuration.update(attr_names.extract_options!)
-
- enum = configuration[:in] || configuration[:within]
-
- raise(ArgumentError, "An object with the method include? is required must be supplied as the :in option of the configuration hash") unless enum.respond_to?("include?")
-
- validates_each(attr_names, configuration) do |record, attr_name, value|
- record.errors.add(attr_name, configuration[:message] % value) if enum.include?(value)
- end
- end
- end
- end
-end
\ No newline at end of file
diff --git a/vendor/rails/activemodel/lib/active_model/validations/format.rb b/vendor/rails/activemodel/lib/active_model/validations/format.rb
deleted file mode 100644
index 1320ef64..00000000
--- a/vendor/rails/activemodel/lib/active_model/validations/format.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-module ActiveModel
- module Validations
- module ClassMethods
- # Validates whether the value of the specified attribute is of the correct form by matching it against the regular expression
- # provided.
- #
- # class Person < ActiveRecord::Base
- # validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i, :on => :create
- # end
- #
- # Note: use \A and \Z to match the start and end of the string, ^ and $ match the start/end of a line.
- #
- # A regular expression must be provided or else an exception will be raised.
- #
- # Configuration options:
- # * :message - A custom error message (default is: "is invalid")
- # * :allow_nil - If set to +true+, skips this validation if the attribute is +nil+ (default is: +false+)
- # * :allow_blank - If set to +true+, skips this validation if the attribute is blank (default is: +false+)
- # * :with - The regular expression used to validate the format with (note: must be supplied!)
- # * :on - Specifies when this validation is active (default is :save, other options :create, :update)
- # * :if - Specifies a method, proc or string to call to determine if the validation should
- # occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }). The
- # method, proc or string should return or evaluate to a true or false value.
- # * :unless - Specifies a method, proc or string to call to determine if the validation should
- # not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }). The
- # method, proc or string should return or evaluate to a true or false value.
- def validates_format_of(*attr_names)
- configuration = { :message => ActiveRecord::Errors.default_error_messages[:invalid], :on => :save, :with => nil }
- configuration.update(attr_names.extract_options!)
-
- raise(ArgumentError, "A regular expression must be supplied as the :with option of the configuration hash") unless configuration[:with].is_a?(Regexp)
-
- validates_each(attr_names, configuration) do |record, attr_name, value|
- record.errors.add(attr_name, configuration[:message]) unless value.to_s =~ configuration[:with]
- end
- end
- end
- end
-end
\ No newline at end of file
diff --git a/vendor/rails/activemodel/lib/active_model/validations/inclusion.rb b/vendor/rails/activemodel/lib/active_model/validations/inclusion.rb
deleted file mode 100644
index 9fc1caaa..00000000
--- a/vendor/rails/activemodel/lib/active_model/validations/inclusion.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-module ActiveModel
- module Validations
- module ClassMethods
- # Validates whether the value of the specified attribute is available in a particular enumerable object.
- #
- # class Person < ActiveRecord::Base
- # validates_inclusion_of :gender, :in => %w( m f ), :message => "woah! what are you then!??!!"
- # validates_inclusion_of :age, :in => 0..99
- # validates_inclusion_of :format, :in => %w( jpg gif png ), :message => "extension %s is not included in the list"
- # end
- #
- # Configuration options:
- # * :in - An enumerable object of available items
- # * :message - Specifies a custom error message (default is: "is not included in the list")
- # * :allow_nil - If set to +true+, skips this validation if the attribute is null (default is: +false+)
- # * :allow_blank - If set to +true+, skips this validation if the attribute is blank (default is: +false+)
- # * :if - Specifies a method, proc or string to call to determine if the validation should
- # occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }). The
- # method, proc or string should return or evaluate to a true or false value.
- # * :unless - Specifies a method, proc or string to call to determine if the validation should
- # not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }). The
- # method, proc or string should return or evaluate to a true or false value.
- def validates_inclusion_of(*attr_names)
- configuration = { :message => ActiveRecord::Errors.default_error_messages[:inclusion], :on => :save }
- configuration.update(attr_names.extract_options!)
-
- enum = configuration[:in] || configuration[:within]
-
- raise(ArgumentError, "An object with the method include? is required must be supplied as the :in option of the configuration hash") unless enum.respond_to?("include?")
-
- validates_each(attr_names, configuration) do |record, attr_name, value|
- record.errors.add(attr_name, configuration[:message] % value) unless enum.include?(value)
- end
- end
- end
- end
-end
\ No newline at end of file
diff --git a/vendor/rails/activemodel/lib/active_model/validations/length.rb b/vendor/rails/activemodel/lib/active_model/validations/length.rb
deleted file mode 100644
index 673ad339..00000000
--- a/vendor/rails/activemodel/lib/active_model/validations/length.rb
+++ /dev/null
@@ -1,95 +0,0 @@
-module ActiveModel
- module Validations
- module ClassMethods
- ALL_RANGE_OPTIONS = [ :is, :within, :in, :minimum, :maximum ].freeze
-
- # Validates that the specified attribute matches the length restrictions supplied. Only one option can be used at a time:
- #
- # class Person < ActiveRecord::Base
- # validates_length_of :first_name, :maximum => 30
- # validates_length_of :last_name, :maximum => 30, :message => "less than %d if you don't mind"
- # validates_length_of :fax, :in => 7..32, :allow_nil => true
- # validates_length_of :phone, :in => 7..32, :allow_blank => true
- # validates_length_of :user_name, :within => 6..20, :too_long => "pick a shorter name", :too_short => "pick a longer name"
- # validates_length_of :fav_bra_size, :minimum => 1, :too_short => "please enter at least %d character"
- # validates_length_of :smurf_leader, :is => 4, :message => "papa is spelled with %d characters... don't play me."
- # end
- #
- # Configuration options:
- # * :minimum - The minimum size of the attribute
- # * :maximum - The maximum size of the attribute
- # * :is - The exact size of the attribute
- # * :within - A range specifying the minimum and maximum size of the attribute
- # * :in - A synonym (or alias) for :within
- # * :allow_nil - Attribute may be +nil+; skip validation.
- # * :allow_blank - Attribute may be blank; skip validation.
- # * :too_long - The error message if the attribute goes over the maximum (default is: "is too long (maximum is %d characters)")
- # * :too_short - The error message if the attribute goes under the minimum (default is: "is too short (min is %d characters)")
- # * :wrong_length - The error message if using the :is method and the attribute is the wrong size (default is: "is the wrong length (should be %d characters)")
- # * :message - The error message to use for a :minimum, :maximum, or :is violation. An alias of the appropriate :too_long/too_short/wrong_length message
- # * :on - Specifies when this validation is active (default is :save, other options :create, :update)
- # * :if - Specifies a method, proc or string to call to determine if the validation should
- # occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }). The
- # method, proc or string should return or evaluate to a true or false value.
- # * :unless - Specifies a method, proc or string to call to determine if the validation should
- # not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }). The
- # method, proc or string should return or evaluate to a true or false value.
- def validates_length_of(*attrs)
- # Merge given options with defaults.
- options = {
- :too_long => ActiveRecord::Errors.default_error_messages[:too_long],
- :too_short => ActiveRecord::Errors.default_error_messages[:too_short],
- :wrong_length => ActiveRecord::Errors.default_error_messages[:wrong_length]
- }.merge(DEFAULT_VALIDATION_OPTIONS)
- options.update(attrs.extract_options!.symbolize_keys)
-
- # Ensure that one and only one range option is specified.
- range_options = ALL_RANGE_OPTIONS & options.keys
- case range_options.size
- when 0
- raise ArgumentError, 'Range unspecified. Specify the :within, :maximum, :minimum, or :is option.'
- when 1
- # Valid number of options; do nothing.
- else
- raise ArgumentError, 'Too many range options specified. Choose only one.'
- end
-
- # Get range option and value.
- option = range_options.first
- option_value = options[range_options.first]
-
- case option
- when :within, :in
- raise ArgumentError, ":#{option} must be a Range" unless option_value.is_a?(Range)
-
- too_short = options[:too_short] % option_value.begin
- too_long = options[:too_long] % option_value.end
-
- validates_each(attrs, options) do |record, attr, value|
- value = value.split(//) if value.kind_of?(String)
- if value.nil? or value.size < option_value.begin
- record.errors.add(attr, too_short)
- elsif value.size > option_value.end
- record.errors.add(attr, too_long)
- end
- end
- when :is, :minimum, :maximum
- raise ArgumentError, ":#{option} must be a nonnegative Integer" unless option_value.is_a?(Integer) and option_value >= 0
-
- # Declare different validations per option.
- validity_checks = { :is => "==", :minimum => ">=", :maximum => "<=" }
- message_options = { :is => :wrong_length, :minimum => :too_short, :maximum => :too_long }
-
- message = (options[:message] || options[message_options[option]]) % option_value
-
- validates_each(attrs, options) do |record, attr, value|
- value = value.split(//) if value.kind_of?(String)
- record.errors.add(attr, message) unless !value.nil? and value.size.method(validity_checks[option])[option_value]
- end
- end
- end
-
- alias_method :validates_size_of, :validates_length_of
- end
- end
-end
\ No newline at end of file
diff --git a/vendor/rails/activemodel/lib/active_model/validations/numericality.rb b/vendor/rails/activemodel/lib/active_model/validations/numericality.rb
deleted file mode 100644
index 92ca5f40..00000000
--- a/vendor/rails/activemodel/lib/active_model/validations/numericality.rb
+++ /dev/null
@@ -1,80 +0,0 @@
-module ActiveModel
- module Validations
- module ClassMethods
- ALL_NUMERICALITY_CHECKS = { :greater_than => '>', :greater_than_or_equal_to => '>=',
- :equal_to => '==', :less_than => '<', :less_than_or_equal_to => '<=',
- :odd => 'odd?', :even => 'even?' }.freeze
-
-
- # Validates whether the value of the specified attribute is numeric by trying to convert it to
- # a float with Kernel.Float (if integer is false) or applying it to the regular expression
- # /\A[\+\-]?\d+\Z/ (if integer is true).
- #
- # class Person < ActiveRecord::Base
- # validates_numericality_of :value, :on => :create
- # end
- #
- # Configuration options:
- # * :message - A custom error message (default is: "is not a number").
- # * :on - Specifies when this validation is active (default is :save, other options :create, :update).
- # * :only_integer - Specifies whether the value has to be an integer, e.g. an integral value (default is +false+).
- # * :allow_nil - Skip validation if attribute is +nil+ (default is +false+). Notice that for fixnum and float columns empty strings are converted to +nil+.
- # * :greater_than - Specifies the value must be greater than the supplied value.
- # * :greater_than_or_equal_to - Specifies the value must be greater than or equal the supplied value.
- # * :equal_to - Specifies the value must be equal to the supplied value.
- # * :less_than - Specifies the value must be less than the supplied value.
- # * :less_than_or_equal_to - Specifies the value must be less than or equal the supplied value.
- # * :odd - Specifies the value must be an odd number.
- # * :even - Specifies the value must be an even number.
- # * :if - Specifies a method, proc or string to call to determine if the validation should
- # occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }). The
- # method, proc or string should return or evaluate to a true or false value.
- # * :unless - Specifies a method, proc or string to call to determine if the validation should
- # not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }). The
- # method, proc or string should return or evaluate to a true or false value.
- def validates_numericality_of(*attr_names)
- configuration = { :on => :save, :only_integer => false, :allow_nil => false }
- configuration.update(attr_names.extract_options!)
-
-
- numericality_options = ALL_NUMERICALITY_CHECKS.keys & configuration.keys
-
- (numericality_options - [ :odd, :even ]).each do |option|
- raise ArgumentError, ":#{option} must be a number" unless configuration[option].is_a?(Numeric)
- end
-
- validates_each(attr_names,configuration) do |record, attr_name, value|
- raw_value = record.send("#{attr_name}_before_type_cast") || value
-
- next if configuration[:allow_nil] and raw_value.nil?
-
- if configuration[:only_integer]
- unless raw_value.to_s =~ /\A[+-]?\d+\Z/
- record.errors.add(attr_name, configuration[:message] || ActiveRecord::Errors.default_error_messages[:not_a_number])
- next
- end
- raw_value = raw_value.to_i
- else
- begin
- raw_value = Kernel.Float(raw_value.to_s)
- rescue ArgumentError, TypeError
- record.errors.add(attr_name, configuration[:message] || ActiveRecord::Errors.default_error_messages[:not_a_number])
- next
- end
- end
-
- numericality_options.each do |option|
- case option
- when :odd, :even
- record.errors.add(attr_name, configuration[:message] || ActiveRecord::Errors.default_error_messages[option]) unless raw_value.to_i.method(ALL_NUMERICALITY_CHECKS[option])[]
- else
- message = configuration[:message] || ActiveRecord::Errors.default_error_messages[option]
- message = message % configuration[option] if configuration[option]
- record.errors.add(attr_name, message) unless raw_value.method(ALL_NUMERICALITY_CHECKS[option])[configuration[option]]
- end
- end
- end
- end
- end
- end
-end
\ No newline at end of file
diff --git a/vendor/rails/activemodel/lib/active_model/validations/presence.rb b/vendor/rails/activemodel/lib/active_model/validations/presence.rb
deleted file mode 100644
index 62e46690..00000000
--- a/vendor/rails/activemodel/lib/active_model/validations/presence.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-module ActiveModel
- module Validations
- module ClassMethods
- # Validates that the specified attributes are not blank (as defined by Object#blank?). Happens by default on save. Example:
- #
- # class Person < ActiveRecord::Base
- # validates_presence_of :first_name
- # end
- #
- # The +first_name+ attribute must be in the object and it cannot be blank.
- #
- # If you want to validate the presence of a boolean field (where the real values are +true+ and +false+),
- # you will want to use
- #
- # validates_inclusion_of :field_name, :in => [true, false]
- #
- # This is due to the way Object#blank? handles boolean values:
- #
- # false.blank? # => true
- #
- # Configuration options:
- # * :message - A custom error message (default is: "can't be blank")
- # * :on - Specifies when this validation is active (default is :save, other options :create, :update)
- # * :if - Specifies a method, proc or string to call to determine if the validation should
- # occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }). The
- # method, proc or string should return or evaluate to a true or false value.
- # * :unless - Specifies a method, proc or string to call to determine if the validation should
- # not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }). The
- # method, proc or string should return or evaluate to a true or false value.
- def validates_presence_of(*attr_names)
- configuration = { :message => ActiveRecord::Errors.default_error_messages[:blank], :on => :save }
- configuration.update(attr_names.extract_options!)
-
- # can't use validates_each here, because it cannot cope with nonexistent attributes,
- # while errors.add_on_empty can
- send(validation_method(configuration[:on]), configuration) do |record|
- record.errors.add_on_blank(attr_names, configuration[:message])
- end
- end
- end
- end
-end
\ No newline at end of file
diff --git a/vendor/rails/activemodel/lib/active_model/validations/uniqueness.rb b/vendor/rails/activemodel/lib/active_model/validations/uniqueness.rb
deleted file mode 100644
index 2b47c6bc..00000000
--- a/vendor/rails/activemodel/lib/active_model/validations/uniqueness.rb
+++ /dev/null
@@ -1,104 +0,0 @@
-module ActiveModel
- module Validations
- module ClassMethods
- # Validates whether the value of the specified attributes are unique across the system. Useful for making sure that only one user
- # can be named "davidhh".
- #
- # class Person < ActiveRecord::Base
- # validates_uniqueness_of :user_name, :scope => :account_id
- # end
- #
- # It can also validate whether the value of the specified attributes are unique based on multiple scope parameters. For example,
- # making sure that a teacher can only be on the schedule once per semester for a particular class.
- #
- # class TeacherSchedule < ActiveRecord::Base
- # validates_uniqueness_of :teacher_id, :scope => [:semester_id, :class_id]
- # end
- #
- # When the record is created, a check is performed to make sure that no record exists in the database with the given value for the specified
- # attribute (that maps to a column). When the record is updated, the same check is made but disregarding the record itself.
- #
- # Because this check is performed outside the database there is still a chance that duplicate values
- # will be inserted in two parallel transactions. To guarantee against this you should create a
- # unique index on the field. See +add_index+ for more information.
- #
- # Configuration options:
- # * :message - Specifies a custom error message (default is: "has already been taken")
- # * :scope - One or more columns by which to limit the scope of the uniqueness constraint.
- # * :case_sensitive - Looks for an exact match. Ignored by non-text columns (+false+ by default).
- # * :allow_nil - If set to +true+, skips this validation if the attribute is +nil+ (default is: +false+)
- # * :allow_blank - If set to +true+, skips this validation if the attribute is blank (default is: +false+)
- # * :if - Specifies a method, proc or string to call to determine if the validation should
- # occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }). The
- # method, proc or string should return or evaluate to a true or false value.
- # * :unless - Specifies a method, proc or string to call to determine if the validation should
- # not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }). The
- # method, proc or string should return or evaluate to a true or false value.
- def validates_uniqueness_of(*attr_names)
- configuration = { :message => ActiveRecord::Errors.default_error_messages[:taken] }
- configuration.update(attr_names.extract_options!)
-
- validates_each(attr_names,configuration) do |record, attr_name, value|
- # The check for an existing value should be run from a class that
- # isn't abstract. This means working down from the current class
- # (self), to the first non-abstract class. Since classes don't know
- # their subclasses, we have to build the hierarchy between self and
- # the record's class.
- class_hierarchy = [record.class]
- while class_hierarchy.first != self
- class_hierarchy.insert(0, class_hierarchy.first.superclass)
- end
-
- # Now we can work our way down the tree to the first non-abstract
- # class (which has a database table to query from).
- finder_class = class_hierarchy.detect { |klass| !klass.abstract_class? }
-
- if value.nil? || (configuration[:case_sensitive] || !finder_class.columns_hash[attr_name.to_s].text?)
- condition_sql = "#{record.class.quoted_table_name}.#{attr_name} #{attribute_condition(value)}"
- condition_params = [value]
- else
- # sqlite has case sensitive SELECT query, while MySQL/Postgresql don't.
- # Hence, this is needed only for sqlite.
- condition_sql = "LOWER(#{record.class.quoted_table_name}.#{attr_name}) #{attribute_condition(value)}"
- condition_params = [value.downcase]
- end
-
- if scope = configuration[:scope]
- Array(scope).map do |scope_item|
- scope_value = record.send(scope_item)
- condition_sql << " AND #{record.class.quoted_table_name}.#{scope_item} #{attribute_condition(scope_value)}"
- condition_params << scope_value
- end
- end
-
- unless record.new_record?
- condition_sql << " AND #{record.class.quoted_table_name}.#{record.class.primary_key} <> ?"
- condition_params << record.send(:id)
- end
-
- results = finder_class.with_exclusive_scope do
- connection.select_all(
- construct_finder_sql(
- :select => "#{attr_name}",
- :from => "#{finder_class.quoted_table_name}",
- :conditions => [condition_sql, *condition_params]
- )
- )
- end
-
- unless results.length.zero?
- found = true
-
- # As MySQL/Postgres don't have case sensitive SELECT queries, we try to find duplicate
- # column in ruby when case sensitive option
- if configuration[:case_sensitive] && finder_class.columns_hash[attr_name.to_s].text?
- found = results.any? { |a| a[attr_name.to_s] == value }
- end
-
- record.errors.add(attr_name, configuration[:message]) if found
- end
- end
- end
- end
- end
-end
\ No newline at end of file
diff --git a/vendor/rails/activemodel/spec/observing_spec.rb b/vendor/rails/activemodel/spec/observing_spec.rb
deleted file mode 100644
index 1919bb59..00000000
--- a/vendor/rails/activemodel/spec/observing_spec.rb
+++ /dev/null
@@ -1,120 +0,0 @@
-require File.join(File.dirname(__FILE__), 'spec_helper')
-
-class ObservedModel < ActiveModel::Base
- class Observer
- end
-end
-
-class FooObserver < ActiveModel::Observer
- class << self
- public :new
- end
-
- attr_accessor :stub
-
- def on_spec(record)
- stub.event_with(record) if stub
- end
-end
-
-class Foo < ActiveModel::Base
-end
-
-module ActiveModel
- describe Observing do
- before do
- ObservedModel.observers.clear
- end
-
- it "initializes model with no cached observers" do
- ObservedModel.observers.should be_empty
- end
-
- it "stores cached observers in an array" do
- ObservedModel.observers << :foo
- ObservedModel.observers.should include(:foo)
- end
-
- it "flattens array of assigned cached observers" do
- ObservedModel.observers = [[:foo], :bar]
- ObservedModel.observers.should include(:foo)
- ObservedModel.observers.should include(:bar)
- end
-
- it "instantiates observer names passed as strings" do
- ObservedModel.observers << 'foo_observer'
- FooObserver.should_receive(:instance)
- ObservedModel.instantiate_observers
- end
-
- it "instantiates observer names passed as symbols" do
- ObservedModel.observers << :foo_observer
- FooObserver.should_receive(:instance)
- ObservedModel.instantiate_observers
- end
-
- it "instantiates observer classes" do
- ObservedModel.observers << ObservedModel::Observer
- ObservedModel::Observer.should_receive(:instance)
- ObservedModel.instantiate_observers
- end
-
- it "should pass observers to subclasses" do
- FooObserver.instance
- bar = Class.new(Foo)
- bar.count_observers.should == 1
- end
- end
-
- describe Observer do
- before do
- ObservedModel.observers = :foo_observer
- FooObserver.models = nil
- end
-
- it "guesses implicit observable model name" do
- FooObserver.observed_class_name.should == 'Foo'
- end
-
- it "tracks implicit observable models" do
- instance = FooObserver.new
- instance.send(:observed_classes).should include(Foo)
- instance.send(:observed_classes).should_not include(ObservedModel)
- end
-
- it "tracks explicit observed model class" do
- FooObserver.new.send(:observed_classes).should_not include(ObservedModel)
- FooObserver.observe ObservedModel
- instance = FooObserver.new
- instance.send(:observed_classes).should include(ObservedModel)
- end
-
- it "tracks explicit observed model as string" do
- FooObserver.new.send(:observed_classes).should_not include(ObservedModel)
- FooObserver.observe 'observed_model'
- instance = FooObserver.new
- instance.send(:observed_classes).should include(ObservedModel)
- end
-
- it "tracks explicit observed model as symbol" do
- FooObserver.new.send(:observed_classes).should_not include(ObservedModel)
- FooObserver.observe :observed_model
- instance = FooObserver.new
- instance.send(:observed_classes).should include(ObservedModel)
- end
-
- it "calls existing observer event" do
- foo = Foo.new
- FooObserver.instance.stub = stub!(:stub)
- FooObserver.instance.stub.should_receive(:event_with).with(foo)
- Foo.send(:changed)
- Foo.send(:notify_observers, :on_spec, foo)
- end
-
- it "skips nonexistent observer event" do
- foo = Foo.new
- Foo.send(:changed)
- Foo.send(:notify_observers, :whatever, foo)
- end
- end
-end
\ No newline at end of file
diff --git a/vendor/rails/activemodel/spec/spec_helper.rb b/vendor/rails/activemodel/spec/spec_helper.rb
deleted file mode 100644
index 004fdfca..00000000
--- a/vendor/rails/activemodel/spec/spec_helper.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-ENV['LOG_NAME'] = 'spec'
-$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'vendor', 'rspec', 'lib')
-$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
-require 'active_model'
-begin
- require 'spec'
-rescue LoadError
- require 'rubygems'
- require 'spec'
-end
-
-begin
- require 'ruby-debug'
- Debugger.start
-rescue LoadError
- # you do not know the ways of ruby-debug yet, what a shame
-end
\ No newline at end of file
diff --git a/vendor/rails/activerecord/CHANGELOG b/vendor/rails/activerecord/CHANGELOG
deleted file mode 100644
index 1c7c9771..00000000
--- a/vendor/rails/activerecord/CHANGELOG
+++ /dev/null
@@ -1,5719 +0,0 @@
-*2.1.0 (May 31st, 2008)*
-
-* Add ActiveRecord::Base.sti_name that checks ActiveRecord::Base#store_full_sti_class? and returns either the full or demodulized name. [rick]
-
-* Add first/last methods to associations/named_scope. Resolved #226. [Ryan Bates]
-
-* Added SQL escaping for :limit and :offset #288 [Aaron Bedra, Steven Bristol, Jonathan Wiess]
-
-* Added first/last methods to associations/named_scope. Resolved #226. [Ryan Bates]
-
-* Ensure hm:t preloading honours reflection options. Resolves #137. [Frederick Cheung]
-
-* Added protection against duplicate migration names (Aslak Hellesøy) [#112]
-
-* Base#instantiate_time_object: eliminate check for Time.zone, since we can assume this is set if time_zone_aware_attributes is set to true [Geoff Buesing]
-
-* Time zone aware attribute methods use Time.zone.parse instead of #to_time for String arguments, so that offset information in String is respected. Resolves #105. [Scott Fleckenstein, Geoff Buesing]
-
-* Added change_table for migrations (Jeff Dean) [#71]. Example:
-
- change_table :videos do |t|
- t.timestamps # adds created_at, updated_at
- t.belongs_to :goat # adds goat_id integer
- t.string :name, :email, :limit => 20 # adds name and email both with a 20 char limit
- t.remove :name, :email # removes the name and email columns
- end
-
-* Fixed has_many :through .create with no parameters caused a "can't dup NilClass" error (Steven Soroka) [#85]
-
-* Added block-setting of attributes for Base.create like Base.new already has (Adam Meehan) [#39]
-
-* Fixed that pessimistic locking you reference the quoted table name (Josh Susser) [#67]
-
-* Fixed that change_column should be able to use :null => true on a field that formerly had false [Nate Wiger] [#26]
-
-* Added that the MySQL adapter should map integer to either smallint, int, or bigint depending on the :limit just like PostgreSQL [DHH]
-
-* Change validates_uniqueness_of :case_sensitive option default back to true (from [9160]). Love your database columns, don't LOWER them. [rick]
-
-* Add support for interleaving migrations by storing which migrations have run in the new schema_migrations table. Closes #11493 [jordi]
-
-* ActiveRecord::Base#sum defaults to 0 if no rows are returned. Closes #11550 [kamal]
-
-* Ensure that respond_to? considers dynamic finder methods. Closes #11538. [floehopper]
-
-* Ensure that save on parent object fails for invalid has_one association. Closes #10518. [Pratik]
-
-* Remove duplicate code from associations. [Pratik]
-
-* Refactor HasManyThroughAssociation to inherit from HasManyAssociation. Association callbacks and _ids= now work with hm:t. #11516 [rubyruy]
-
-* Ensure HABTM#create and HABTM#build do not load entire association. [Pratik]
-
-* Improve documentation. [Xavier Noria, Jack Danger Canty, leethal]
-
-* Tweak ActiveRecord::Base#to_json to include a root value in the returned hash: {"post": {"title": ...}} [rick]
-
- Post.find(1).to_json # => {"title": ...}
- config.active_record.include_root_in_json = true
- Post.find(1).to_json # => {"post": {"title": ...}}
-
-* Add efficient #include? to AssociationCollection (for has_many/has_many :through/habtm). [stopdropandrew]
-
-* PostgreSQL: create_ and drop_database support. #9042 [ez, pedz, nicksieger]
-
-* Ensure that validates_uniqueness_of works with with_scope. Closes #9235. [nik.wakelin, cavalle]
-
-* Partial updates include only unsaved attributes. Off by default; set YourClass.partial_updates = true to enable. [Jeremy Kemper]
-
-* Removing unnecessary uses_tzinfo helper from tests, given that TZInfo is now bundled [Geoff Buesing]
-
-* Fixed that validates_size_of :within works in associations #11295, #10019 [cavalle]
-
-* Track changes to unsaved attributes. [Jeremy Kemper]
-
-* Switched to UTC-timebased version numbers for migrations and the schema. This will as good as eliminate the problem of multiple migrations getting the same version assigned in different branches. Also added rake db:migrate:up/down to apply individual migrations that may need to be run when you merge branches #11458 [jbarnette]
-
-* Fixed that has_many :through would ignore the hash conditions #11447 [miloops]
-
-* Fix issue where the :uniq option of a has_many :through association is ignored when find(:all) is called. Closes #9407 [cavalle]
-
-* Fix duplicate table alias error when including an association with a has_many :through association on the same join table. Closes #7310 [cavalle]
-
-* More efficient association preloading code that compacts a through_records array in a central location. Closes #11427 [danger]
-
-* Improve documentation. [Radar, Jan De Poorter, chuyeow, xaviershay, danger, miloops, Xavier Noria, Sunny Ripert]
-
-* Fixed that ActiveRecord#Base.find_or_create/initialize would not honor attr_protected/accessible when used with a hash #11422 [miloops]
-
-* Added ActiveRecord#Base.all/first/last as aliases for find(:all/:first/:last) #11413 [nkallen, thechrisoshow]
-
-* Merge the has_finder gem, renamed as 'named_scope'. #11404 [nkallen]
-
- class Article < ActiveRecord::Base
- named_scope :published, :conditions => {:published => true}
- named_scope :popular, :conditions => ...
- end
-
- Article.published.paginate(:page => 1)
- Article.published.popular.count
- Article.popular.find(:first)
- Article.popular.find(:all, :conditions => {...})
-
- See http://pivots.pivotallabs.com/users/nick/blog/articles/284-hasfinder-it-s-now-easier-than-ever-to-create-complex-re-usable-sql-queries
-
-* Add has_one :through support. #4756 [thechrisoshow]
-
-* Migrations: create_table supports primary_key_prefix_type. #10314 [student, thechrisoshow]
-
-* Added logging for dependency load errors with fixtures #11056 [stuthulhu]
-
-* Time zone aware attributes use Time#in_time_zone [Geoff Buesing]
-
-* Fixed that scoped joins would not always be respected #6821 [Theory/Danger]
-
-* Ensure that ActiveRecord::Calculations disambiguates field names with the table name. #11027 [cavalle]
-
-* Added add/remove_timestamps to the schema statements for adding the created_at/updated_at columns on existing tables #11129 [jramirez]
-
-* Added ActiveRecord::Base.find(:last) #11338 [miloops]
-
-* test_native_types expects DateTime.local_offset instead of DateTime.now.offset; fixes test breakage due to dst transition [Geoff Buesing]
-
-* Add :readonly option to HasManyThrough associations. #11156 [miloops]
-
-* Improve performance on :include/:conditions/:limit queries by selectively joining in the pre-query. #9560 [dasil003]
-
-* Perf fix: Avoid the use of named block arguments. Closes #11109 [adymo]
-
-* PostgreSQL: support server versions 7.4 through 8.0 and the ruby-pg driver. #11127 [jdavis]
-
-* Ensure association preloading doesn't break when an association returns nil. ##11145 [GMFlash]
-
-* Make dynamic finders respect the :include on HasManyThrough associations. #10998. [cpytel]
-
-* Base#instantiate_time_object only uses Time.zone when Base.time_zone_aware_attributes is true; leverages Time#time_with_datetime_fallback for readability [Geoff Buesing]
-
-* Refactor ConnectionAdapters::Column.new_time: leverage DateTime failover behavior of Time#time_with_datetime_fallback [Geoff Buesing]
-
-* Improve associations performance by using symbol callbacks instead of string callbacks. #11108 [adymo]
-
-* Optimise the BigDecimal conversion code. #11110 [adymo]
-
-* Introduce the :readonly option to all associations. Records from the association cannot be saved. #11084 [miloops]
-
-* Multiparameter attributes for time columns fail over to DateTime when out of range of Time [Geoff Buesing]
-
-* Base#instantiate_time_object uses Time.zone.local() [Geoff Buesing]
-
-* Add timezone-aware attribute readers and writers. #10982 [Geoff Buesing]
-
-* Instantiating time objects in multiparameter attributes uses Time.zone if available. #10982 [rick]
-
-* Add note about how ActiveRecord::Observer classes are initialized in a Rails app. #10980 [fxn]
-
-* MySQL: omit text/blob defaults from the schema instead of using an empty string. #10963 [mdeiters]
-
-* belongs_to supports :dependent => :destroy and :delete. #10592 [Jonathan Viney]
-
-* Introduce preload query strategy for eager :includes. #9640 [Frederick Cheung, Aleksey Kondratenko, codafoo]
-
-* Support aggregations in finder conditions. #10572 [Ryan Kinderman]
-
-* Organize and clean up the Active Record test suite. #10742 [John Barnette]
-
-* Ensure that modifying has_and_belongs_to_many actions clear the query cache. Closes #10840 [john.andrews]
-
-* Fix issue where Table#references doesn't pass a :null option to a *_type attribute for polymorphic associations. Closes #10753 [railsjitsu]
-
-* Fixtures: removed support for the ancient pre-YAML file format. #10736 [John Barnette]
-
-* More thoroughly quote table names. #10698 [dimdenis, lotswholetime, Jeremy Kemper]
-
-* update_all ignores scoped :order and :limit, so post.comments.update_all doesn't try to include the comment order in the update statement. #10686 [Brendan Ribera]
-
-* Added ActiveRecord::Base.cache_key to make it easier to cache Active Records in combination with the new ActiveSupport::Cache::* libraries [DHH]
-
-* Make sure CSV fixtures are compatible with ruby 1.9's new csv implementation. [JEG2]
-
-* Added by parameter to increment, decrement, and their bang varieties so you can do player1.increment!(:points, 5) #10542 [Sam]
-
-* Optimize ActiveRecord::Base#exists? to use #select_all instead of #find. Closes #10605 [jamesh, fcheung, protocool]
-
-* Don't unnecessarily load has_many associations in after_update callbacks. Closes #6822 [stopdropandrew, canadaduane]
-
-* Eager belongs_to :include infers the foreign key from the association name rather than the class name. #10517 [Jonathan Viney]
-
-* SQLite: fix rename_ and remove_column for columns with unique indexes. #10576 [Brandon Keepers]
-
-* Ruby 1.9 compatibility. #10655 [Jeremy Kemper, Dirkjan Bussink]
-
-
-*2.0.2* (December 16th, 2007)
-
-* Ensure optimistic locking handles nil #lock_version values properly. Closes #10510 [rick]
-
-* Make the Fixtures Test::Unit enhancements more supporting for double-loaded test cases. Closes #10379 [brynary]
-
-* Fix that validates_acceptance_of still works for non-existent tables (useful for bootstrapping new databases). Closes #10474 [hasmanyjosh]
-
-* Ensure that the :uniq option for has_many :through associations retains the order. #10463 [remvee]
-
-* Base.exists? doesn't rescue exceptions to avoid hiding SQL errors. #10458 [Michael Klishin]
-
-* Documentation: Active Record exceptions, destroy_all and delete_all. #10444, #10447 [Michael Klishin]
-
-
-*2.0.1* (December 7th, 2007)
-
-* Removed query cache rescue as it could cause code to be run twice (closes #10408) [DHH]
-
-
-*2.0.0* (December 6th, 2007)
-
-* Anchor DateTimeTest to fixed DateTime instead of a variable value based on Time.now#advance#to_datetime, so that this test passes on 64-bit platforms running Ruby 1.8.6+ [Geoff Buesing]
-
-* Fixed that the Query Cache should just be ignored if the database is misconfigured (so that the "About your applications environment" works even before the database has been created) [DHH]
-
-* Fixed that the truncation of strings longer than 50 chars should use inspect
-so newlines etc are escaped #10385 [Norbert Crombach]
-
-* Fixed that habtm associations should be able to set :select as part of their definition and have that honored [DHH]
-
-* Document how the :include option can be used in Calculations::calculate. Closes #7446 [adamwiggins, ultimoamore]
-
-* Fix typo in documentation for polymorphic associations w/STI. Closes #7461 [johnjosephbachir]
-
-* Reveal that the type option in migrations can be any supported column type for your database but also include caveat about agnosticism. Closes #7531 [adamwiggins, mikong]
-
-* More complete documentation for find_by_sql. Closes #7912 [fearoffish]
-
-* Added ActiveRecord::Base#becomes to turn a record into one of another class (mostly relevant for STIs) [DHH]. Example:
-
- render :partial => @client.becomes(Company) # renders companies/company instead of clients/client
-
-* Fixed that to_xml should not automatically pass :procs to associations included with :include #10162 [Cheah Chu Yeow]
-
-* Fix documentation typo introduced in [8250]. Closes #10339 [Henrik N]
-
-* Foxy fixtures: support single-table inheritance. #10234 [tom]
-
-* Foxy fixtures: allow mixed usage to make migration easier and more attractive. #10004 [lotswholetime]
-
-* Make the record_timestamps class-inheritable so it can be set per model. #10004 [tmacedo]
-
-* Allow validates_acceptance_of to use a real attribute instead of only virtual (so you can record that the acceptance occured) #7457 [ambethia]
-
-* DateTimes use Ruby's default calendar reform setting. #10201 [Geoff Buesing]
-
-* Dynamic finders on association collections respect association :order and :limit. #10211, #10227 [Patrick Joyce, Rick Olson, Jack Danger Canty]
-
-* Add 'foxy' support for fixtures of polymorphic associations. #10183 [John Barnette, David Lowenfels]
-
-* validates_inclusion_of and validates_exclusion_of allow formatted :message strings. #8132 [devrieda, Mike Naberezny]
-
-* attr_readonly behaves well with optimistic locking. #10188 [Nick Bugajski]
-
-* Base#to_xml supports the nil="true" attribute like Hash#to_xml. #8268 [Catfish]
-
-* Change plings to the more conventional quotes in the documentation. Closes #10104 [danger]
-
-* Fix HasManyThrough Association so it uses :conditions on the HasMany Association. Closes #9729 [danger]
-
-* Ensure that column names are quoted. Closes #10134 [wesley.moxam]
-
-* Smattering of grammatical fixes to documentation. Closes #10083 [BobSilva]
-
-* Enhance explanation with more examples for attr_accessible macro. Closes #8095 [fearoffish, Marcel Molina]
-
-* Update association/method mapping table to refected latest collection methods for has_many :through. Closes #8772 [Pratik Naik]
-
-* Explain semantics of having several different AR instances in a transaction block. Closes #9036 [jacobat, Marcel Molina]
-
-* Update Schema documentation to use updated sexy migration notation. Closes #10086 [sjgman9]
-
-* Make fixtures work with the new test subclasses. [Tarmo Tänav, Koz]
-
-* Introduce finder :joins with associations. Same :include syntax but with inner rather than outer joins. #10012 [RubyRedRick]
- # Find users with an avatar
- User.find(:all, :joins => :avatar)
-
- # Find posts with a high-rated comment.
- Post.find(:all, :joins => :comments, :conditions => 'comments.rating > 3')
-
-* Associations: speedup duplicate record check. #10011 [Pratik Naik]
-
-* Make sure that << works on has_many associations on unsaved records. Closes #9989 [hasmanyjosh]
-
-* Allow association redefinition in subclasses. #9346 [wildchild]
-
-* Fix has_many :through delete with custom foreign keys. #6466 [naffis]
-
-* Foxy fixtures, from rathole (http://svn.geeksomnia.com/rathole/trunk/README)
- - stable, autogenerated IDs
- - specify associations (belongs_to, has_one, has_many) by label, not ID
- - specify HABTM associations as inline lists
- - autofill timestamp columns
- - support YAML defaults
- - fixture label interpolation
- Enabled for fixtures that correspond to a model class and don't specify a primary key value. #9981 [John Barnette]
-
-* Add docs explaining how to protect all attributes using attr_accessible with no arguments. Closes #9631 [boone, rmm5t]
-
-* Update add_index documentation to use new options api. Closes #9787 [Kamal Fariz Mahyuddin]
-
-* Allow find on a has_many association defined with :finder_sql to accept id arguments as strings like regular find does. Closes #9916 [krishna]
-
-* Use VALID_FIND_OPTIONS when resolving :find scoping rather than hard coding the list of valid find options. Closes #9443 [sur]
-
-* Limited eager loading no longer ignores scoped :order. Closes #9561 [danger, Josh Peek]
-
-* Assigning an instance of a foreign class to a composed_of aggregate calls an optional conversion block. Refactor and simplify composed_of implementation. #6322 [brandon, Chris Cruft]
-
-* Assigning nil to a composed_of aggregate also sets its immediate value to nil. #9843 [Chris Cruft]
-
-* Ensure that mysql quotes table names with database names correctly. Closes #9911 [crayz]
-
- "foo.bar" => "`foo`.`bar`"
-
-* Complete the assimilation of Sexy Migrations from ErrFree [Chris Wanstrath, PJ Hyett]
- http://errtheblog.com/post/2381
-
-* Qualified column names work in hash conditions, like :conditions => { 'comments.created_at' => ... }. #9733 [danger]
-
-* Fix regression where the association would not construct new finder SQL on save causing bogus queries for "WHERE owner_id = NULL" even after owner was saved. #8713 [Bryan Helmkamp]
-
-* Refactor association create and build so before & after callbacks behave consistently. #8854 [Pratik Naik, mortent]
-
-* Quote table names. Defaults to column quoting. #4593 [Justin Lynn, gwcoffey, eadz, Dmitry V. Sabanin, Jeremy Kemper]
-
-* Alias association #build to #new so it behaves predictably. #8787 [Pratik Naik]
-
-* Add notes to documentation regarding attr_readonly behavior with counter caches and polymorphic associations. Closes #9835 [saimonmoore, rick]
-
-* Observers can observe model names as symbols properly now. Closes #9869 [queso]
-
-* find_and_(initialize|create)_by methods can now properly initialize protected attributes [Tobias Luetke]
-
-* belongs_to infers the foreign key from the association name instead of from the class name. [Jeremy Kemper]
-
-* PostgreSQL: support multiline default values. #7533 [Carl Lerche, aguynamedryan, Rein Henrichs, Tarmo Tänav]
-
-* MySQL: fix change_column on not-null columns that don't accept dfeault values of ''. #6663 [Jonathan Viney, Tarmo Tänav]
-
-* validates_uniqueness_of behaves well with abstract superclasses and
-single-table inheritance. #3833, #9886 [Gabriel Gironda, rramdas, François Beausoleil, Josh Peek, Tarmo Tänav, pat]
-
-* Warn about protected attribute assigments in development and test environments when mass-assigning to an attr_protected attribute. #9802 [Henrik N]
-
-* Speedup database date/time parsing. [Jeremy Kemper, Tarmo Tänav]
-
-* Fix calling .clear on a has_many :dependent=>:delete_all association. [Tarmo Tänav]
-
-* Allow change_column to set NOT NULL in the PostgreSQL adapter [Tarmo Tänav]
-
-* Fix that ActiveRecord would create attribute methods and override custom attribute getters if the method is also defined in Kernel.methods. [Rick]
-
-* Don't call attr_readonly on polymorphic belongs_to associations, in case it matches the name of some other non-ActiveRecord class/module. [Rick]
-
-* Try loading activerecord--adapter gem before trying a plain require so you can use custom gems for the bundled adapters. Also stops gems from requiring an adapter from an old Active Record gem. [Jeremy Kemper, Derrick Spell]
-
-
-*2.0.0 [Preview Release]* (September 29th, 2007) [Includes duplicates of changes from 1.14.2 - 1.15.3]
-
-* Add attr_readonly to specify columns that are skipped during a normal ActiveRecord #save operation. Closes #6896 [dcmanges]
-
- class Comment < ActiveRecord::Base
- # Automatically sets Article#comments_count as readonly.
- belongs_to :article, :counter_cache => :comments_count
- end
-
- class Article < ActiveRecord::Base
- attr_readonly :approved_comments_count
- end
-
-* Make size for has_many :through use counter cache if it exists. Closes #9734 [xaviershay]
-
-* Remove DB2 adapter since IBM chooses to maintain their own adapter instead. [Jeremy Kemper]
-
-* Extract Oracle, SQLServer, and Sybase adapters into gems. [Jeremy Kemper]
-
-* Added fixture caching that'll speed up a normal fixture-powered test suite between 50% and 100% #9682 [Frederick Cheung]
-
-* Correctly quote id list for limited eager loading. #7482 [tmacedo]
-
-* Fixed that using version-targetted migrates would fail on loggers other than the default one #7430 [valeksenko]
-
-* Fixed rename_column for SQLite when using symbols for the column names #8616 [drodriguez]
-
-* Added the possibility of using symbols in addition to concrete classes with ActiveRecord::Observer#observe. #3998 [Robby Russell, Tarmo Tänav]
-
-* Added ActiveRecord::Base#to_json/from_json [DHH, Cheah Chu Yeow]
-
-* Added ActiveRecord::Base#from_xml [DHH]. Example:
-
- xml = "David"
- Person.new.from_xml(xml).name # => "David"
-
-* Define dynamic finders as real methods after first usage. [bscofield]
-
-* Deprecation: remove deprecated threaded_connections methods. Use allow_concurrency instead. [Jeremy Kemper]
-
-* Associations macros accept extension blocks alongside modules. #9346 [Josh Peek]
-
-* Speed up and simplify query caching. [Jeremy Kemper]
-
-* connection.select_rows 'sql' returns an array (rows) of arrays (field values). #2329 [Michael Schuerig]
-
-* Eager loading respects explicit :joins. #9496 [dasil003]
-
-* Extract Firebird, FrontBase, and OpenBase adapters into gems. #9508, #9509, #9510 [Jeremy Kemper]
-
-* RubyGem database adapters: expects a gem named activerecord--adapter with active_record/connection_adapters/_adapter.rb in its load path. [Jeremy Kemper]
-
-* Fixed that altering join tables in migrations would fail w/ sqlite3 #7453 [TimoMihaljov/brandon]
-
-* Fix association writer with :dependent => :nullify. #7314 [Jonathan Viney]
-
-* OpenBase: update for new lib and latest Rails. Support migrations. #8748 [dcsesq]
-
-* Moved acts_as_tree into a plugin of the same name on the official Rails svn. #9514 [Pratik Naik]
-
-* Moved acts_as_nested_set into a plugin of the same name on the official Rails svn. #9516 [Josh Peek]
-
-* Moved acts_as_list into a plugin of the same name on the official Rails svn. [Josh Peek]
-
-* Explicitly require active_record/query_cache before using it. [Jeremy Kemper]
-
-* Fix bug where unserializing an attribute attempts to modify a frozen @attributes hash for a deleted record. [Rick, marclove]
-
-* Performance: absorb instantiate and initialize_with_callbacks into the Base methods. [Jeremy Kemper]
-
-* Fixed that eager loading queries and with_scope should respect the :group option [DHH]
-
-* Improve performance and functionality of the postgresql adapter. Closes #8049 [roderickvd]
-
- For more information see: http://dev.rubyonrails.org/ticket/8049
-
-* Don't clobber includes passed to has_many.count [danger]
-
-* Make sure has_many uses :include when counting [danger]
-
-* Change the implementation of ActiveRecord's attribute reader and writer methods [nzkoz]
- - Generate Reader and Writer methods which cache attribute values in hashes. This is to avoid repeatedly parsing the same date or integer columns.
- - Change exception raised when users use find with :select then try to access a skipped column. Plugins could override missing_attribute() to lazily load the columns.
- - Move method definition to the class, instead of the instance
- - Always generate the readers, writers and predicate methods.
-
-* Perform a deep #dup on query cache results so that modifying activerecord attributes does not modify the cached attributes. [Rick]
-
-# Ensure that has_many :through associations use a count query instead of loading the target when #size is called. Closes #8800 [Pratik Naik]
-
-* Added :unless clause to validations #8003 [monki]. Example:
-
- def using_open_id?
- !identity_url.blank?
- end
-
- validates_presence_of :identity_url, :if => using_open_id?
- validates_presence_of :username, :unless => using_open_id?
- validates_presence_of :password, :unless => using_open_id?
-
-* Fix #count on a has_many :through association so that it recognizes the :uniq option. Closes #8801 [Pratik Naik]
-
-* Fix and properly document/test count(column_name) usage. Closes #8999 [Pratik Naik]
-
-* Remove deprecated count(conditions=nil, joins=nil) usage. Closes #8993 [Pratik Naik]
-
-* Change belongs_to so that the foreign_key assumption is taken from the association name, not the class name. Closes #8992 [hasmanyjosh]
-
- OLD
- belongs_to :visitor, :class_name => 'User' # => inferred foreign_key is user_id
-
- NEW
- belongs_to :visitor, :class_name => 'User' # => inferred foreign_key is visitor_id
-
-* Remove spurious tests from deprecated_associations_test, most of these aren't deprecated, and are duplicated in associations_test. Closes #8987 [Pratik Naik]
-
-* Make create! on a has_many :through association return the association object. Not the collection. Closes #8786 [Pratik Naik]
-
-* Move from select * to select tablename.* to avoid clobbering IDs. Closes #8889 [dasil003]
-
-* Don't call unsupported methods on associated objects when using :include, :method with to_xml #7307, [manfred, jwilger]
-
-* Define collection singular ids method for has_many :through associations. #8763 [Pratik Naik]
-
-* Array attribute conditions work with proxied association collections. #8318 [Kamal Fariz Mahyuddin, theamazingrando]
-
-* Fix polymorphic has_one associations declared in an abstract class. #8638 [Pratik Naik, Dax Huiberts]
-
-* Fixed validates_associated should not stop on the first error. #4276 [mrj, Manfred Stienstra, Josh Peek]
-
-* Rollback if commit raises an exception. #8642 [kik, Jeremy Kemper]
-
-* Update tests' use of fixtures for the new collections api. #8726 [Kamal Fariz Mahyuddin]
-
-* Save associated records only if the association is already loaded. #8713 [blaine]
-
-* MySQL: fix show_variable. #8448 [matt, Jeremy Kemper]
-
-* Fixtures: correctly delete and insert fixtures in a single transaction. #8553 [Michael Schuerig]
-
-* Fixtures: people(:technomancy, :josh) returns both fixtures. #7880 [technomancy, Josh Peek]
-
-* Calculations support non-numeric foreign keys. #8154 [Kamal Fariz Mahyuddin]
-
-* with_scope is protected. #8524 [Josh Peek]
-
-* Quickref for association methods. #7723 [marclove, Mindsweeper]
-
-* Calculations: return nil average instead of 0 when there are no rows to average. #8298 [davidw]
-
-* acts_as_nested_set: direct_children is sorted correctly. #4761 [Josh Peek, rails@33lc0.net]
-
-* Raise an exception if both attr_protected and attr_accessible are declared. #8507 [stellsmi]
-
-* SQLite, MySQL, PostgreSQL, Oracle: quote column names in column migration SQL statements. #8466 [marclove, lorenjohnson]
-
-* Allow nil serialized attributes with a set class constraint. #7293 [sandofsky]
-
-* Oracle: support binary fixtures. #7987 [Michael Schoen]
-
-* Fixtures: pull fixture insertion into the database adapters. #7987 [Michael Schoen]
-
-* Announce migration versions as they're performed. [Jeremy Kemper]
-
-* find gracefully copes with blank :conditions. #7599 [Dan Manges, johnnyb]
-
-* validates_numericality_of takes :greater_than, :greater_than_or_equal_to, :equal_to, :less_than, :less_than_or_equal_to, :odd, and :even options. #3952 [Bob Silva, Dan Kubb, Josh Peek]
-
-* MySQL: create_database takes :charset and :collation options. Charset defaults to utf8. #8448 [matt]
-
-* Find with a list of ids supports limit/offset. #8437 [hrudududu]
-
-* Optimistic locking: revert the lock version when an update fails. #7840 [plang]
-
-* Migrations: add_column supports custom column types. #7742 [jsgarvin, Theory]
-
-* Load database adapters on demand. Eliminates config.connection_adapters and RAILS_CONNECTION_ADAPTERS. Add your lib directory to the $LOAD_PATH and put your custom adapter in lib/active_record/connection_adapters/adaptername_adapter.rb. This way you can provide custom adapters as plugins or gems without modifying Rails. [Jeremy Kemper]
-
-* Ensure that associations with :dependent => :delete_all respect :conditions option. Closes #8034 [danger, Josh Peek, Rick]
-
-* belongs_to assignment creates a new proxy rather than modifying its target in-place. #8412 [mmangino@elevatedrails.com]
-
-* Fix column type detection while loading fixtures. Closes #7987 [roderickvd]
-
-* Document deep eager includes. #6267 [Josh Susser, Dan Manges]
-
-* Document warning that associations names shouldn't be reserved words. #4378 [murphy@cYcnus.de, Josh Susser]
-
-* Sanitize Base#inspect. #8392, #8623 [Nik Wakelin, jnoon]
-
-* Replace the transaction {|transaction|..} semantics with a new Exception ActiveRecord::Rollback. [Koz]
-
-* Oracle: extract column length for CHAR also. #7866 [ymendel]
-
-* Document :allow_nil option for validates_acceptance_of since it defaults to true. [tzaharia]
-
-* Update documentation for :dependent declaration so that it explicitly uses the non-deprecated API. [danger]
-
-* Add documentation caveat about when to use count_by_sql. [fearoffish]
-
-* Enhance documentation for increment_counter and decrement_counter. [fearoffish]
-
-* Provide brief introduction to what optimistic locking is. [fearoffish]
-
-* Add documentation for :encoding option to mysql adapter. [marclove]
-
-* Added short-hand declaration style to migrations (inspiration from Sexy Migrations, http://errtheblog.com/post/2381) [DHH]. Example:
-
- create_table "products" do |t|
- t.column "shop_id", :integer
- t.column "creator_id", :integer
- t.column "name", :string, :default => "Untitled"
- t.column "value", :string, :default => "Untitled"
- t.column "created_at", :datetime
- t.column "updated_at", :datetime
- end
-
- ...can now be written as:
-
- create_table :products do |t|
- t.integer :shop_id, :creator_id
- t.string :name, :value, :default => "Untitled"
- t.timestamps
- end
-
-* Use association name for the wrapper element when using .to_xml. Previous behavior lead to non-deterministic situations with STI and polymorphic associations. [Koz, jstrachan]
-
-* Improve performance of calling .create on has_many :through associations. [evan]
-
-* Improved cloning performance by relying less on exception raising #8159 [Blaine]
-
-* Added ActiveRecord::Base.inspect to return a column-view like # [DHH]
-
-* Added yielding of Builder instance for ActiveRecord::Base#to_xml calls [DHH]
-
-* Small additions and fixes for ActiveRecord documentation. Closes #7342 [jeremymcanally]
-
-* Add helpful debugging info to the ActiveRecord::StatementInvalid exception in ActiveRecord::ConnectionAdapters::SqliteAdapter#table_structure. Closes #7925. [court3nay]
-
-* SQLite: binary escaping works with $KCODE='u'. #7862 [tsuka]
-
-* Base#to_xml supports serialized attributes. #7502 [jonathan]
-
-* Base.update_all :order and :limit options. Useful for MySQL updates that must be ordered to avoid violating unique constraints. [Jeremy Kemper]
-
-* Remove deprecated object transactions. People relying on this functionality should install the object_transactions plugin at http://code.bitsweat.net/svn/object_transactions. Closes #5637 [Koz, Jeremy Kemper]
-
-* PostgreSQL: remove DateTime -> Time downcast. Warning: do not enable translate_results for the C bindings if you have timestamps outside Time's domain. [Jeremy Kemper]
-
-* find_or_create_by_* takes a hash so you can create with more attributes than are in the method name. For example, Person.find_or_create_by_name(:name => 'Henry', :comments => 'Hi new user!') is equivalent to Person.find_by_name('Henry') || Person.create(:name => 'Henry', :comments => 'Hi new user!'). #7368 [Josh Susser]
-
-* Make sure with_scope takes both :select and :joins into account when setting :readonly. Allows you to save records you retrieve using method_missing on a has_many :through associations. [Koz]
-
-* Allow a polymorphic :source for has_many :through associations. Closes #7143 [protocool]
-
-* Consistent public/protected/private visibility for chained methods. #7813 [Dan Manges]
-
-* Oracle: fix quoted primary keys and datetime overflow. #7798 [Michael Schoen]
-
-* Consistently quote primary key column names. #7763 [toolmantim]
-
-* Fixtures: fix YAML ordered map support. #2665 [Manuel Holtgrewe, nfbuckley]
-
-* DateTimes assume the default timezone. #7764 [Geoff Buesing]
-
-* Sybase: hide timestamp columns since they're inherently read-only. #7716 [Mike Joyce]
-
-* Oracle: overflow Time to DateTime. #7718 [Michael Schoen]
-
-* PostgreSQL: don't use async_exec and async_query with postgres-pr. #7727, #7762 [flowdelic, toolmantim]
-
-* Fix has_many :through << with custom foreign keys. #6466, #7153 [naffis, Rich Collins]
-
-* Test DateTime native type in migrations, including an edge case with dates
-during calendar reform. #7649, #7724 [fedot, Geoff Buesing]
-
-* SQLServer: correctly schema-dump tables with no indexes or descending indexes. #7333, #7703 [Jakob S, Tom Ward]
-
-* SQLServer: recognize real column type as Ruby float. #7057 [sethladd, Tom Ward]
-
-* Added fixtures :all as a way of loading all fixtures in the fixture directory at once #7214 [manfred]
-
-* Added database connection as a yield parameter to ActiveRecord::Base.transaction so you can manually rollback [DHH]. Example:
-
- transaction do |transaction|
- david.withdrawal(100)
- mary.deposit(100)
- transaction.rollback! # rolls back the transaction that was otherwise going to be successful
- end
-
-* Made increment_counter/decrement_counter play nicely with optimistic locking, and added a more general update_counters method [Jamis Buck]
-
-* Reworked David's query cache to be available as Model.cache {...}. For the duration of the block no select query should be run more then once. Any inserts/deletes/executes will flush the whole cache however [Tobias Luetke]
- Task.cache { Task.find(1); Task.find(1) } #=> 1 query
-
-* When dealing with SQLite3, use the table_info pragma helper, so that the bindings can do some translation for when sqlite3 breaks incompatibly between point releases. [Jamis Buck]
-
-* Oracle: fix lob and text default handling. #7344 [gfriedrich, Michael Schoen]
-
-* SQLServer: don't choke on strings containing 'null'. #7083 [Jakob S]
-
-* MySQL: blob and text columns may not have defaults in 5.x. Update fixtures schema for strict mode. #6695 [Dan Kubb]
-
-* update_all can take a Hash argument. sanitize_sql splits into two methods for conditions and assignment since NULL values and delimiters are handled differently. #6583, #7365 [sandofsky, Assaf]
-
-* MySQL: SET SQL_AUTO_IS_NULL=0 so 'where id is null' doesn't select the last inserted id. #6778 [Jonathan Viney, timc]
-
-* Use Date#to_s(:db) for quoted dates. #7411 [Michael Schoen]
-
-* Don't create instance writer methods for class attributes. Closes #7401 [Rick]
-
-* Docs: validations examples. #7343 [zackchandler]
-
-* Add missing tests ensuring callbacks work with class inheritance. Closes #7339 [sandofsky]
-
-* Fixtures use the table name and connection from set_fixture_class. #7330 [Anthony Eden]
-
-* Remove useless code in #attribute_present? since 0 != blank?. Closes #7249 [Josh Susser]
-
-* Fix minor doc typos. Closes #7157 [Josh Susser]
-
-* Fix incorrect usage of #classify when creating the eager loading join statement. Closes #7044 [Josh Susser]
-
-* SQLServer: quote table name in indexes query. #2928 [keithm@infused.org]
-
-* Subclasses of an abstract class work with single-table inheritance. #5704, #7284 [BertG, nick+rails@ag.arizona.edu]
-
-* Make sure sqlite3 driver closes open connections on disconnect [Rob Rasmussen]
-
-* [DOC] clear up some ambiguity with the way has_and_belongs_to_many creates the default join table name. #7072 [jeremymcanally]
-
-* change_column accepts :default => nil. Skip column options for primary keys. #6956, #7048 [Dan Manges, Jeremy Kemper]
-
-* MySQL, PostgreSQL: change_column_default quotes the default value and doesn't lose column type information. #3987, #6664 [Jonathan Viney, manfred, altano@bigfoot.com]
-
-* Oracle: create_table takes a :sequence_name option to override the 'tablename_seq' default. #7000 [Michael Schoen]
-
-* MySQL: retain SSL settings on reconnect. #6976 [randyv2]
-
-* Apply scoping during initialize instead of create. Fixes setting of foreign key when using find_or_initialize_by with scoping. [Cody Fauser]
-
-* SQLServer: handle [quoted] table names. #6635 [rrich]
-
-* acts_as_nested_set works with single-table inheritance. #6030 [Josh Susser]
-
-* PostgreSQL, Oracle: correctly perform eager finds with :limit and :order. #4668, #7021 [eventualbuddha, Michael Schoen]
-
-* Pass a range in :conditions to use the SQL BETWEEN operator. #6974 [Dan Manges]
- Student.find(:all, :conditions => { :grade => 9..12 })
-
-* Fix the Oracle adapter for serialized attributes stored in CLOBs. Closes #6825 [mschoen, tdfowler]
-
-* [DOCS] Apply more documentation for ActiveRecord Reflection. Closes #4055 [Robby Russell]
-
-* [DOCS] Document :allow_nil option of #validate_uniqueness_of. Closes #3143 [Caio Chassot]
-
-* Bring the sybase adapter up to scratch for 1.2 release. [jsheets]
-
-* Rollback new_record? and id when an exception is raised in a save callback. #6910 [Ben Curren, outerim]
-
-* Pushing a record on an association collection doesn't unnecessarily load all the associated records. [Obie Fernandez, Jeremy Kemper]
-
-* Oracle: fix connection reset failure. #6846 [leonlleslie]
-
-* Subclass instantiation doesn't try to explicitly require the corresponding subclass. #6840 [leei, Jeremy Kemper]
-
-* fix faulty inheritance tests and that eager loading grabs the wrong inheritance column when the class of your association is an STI subclass. Closes #6859 [protocool]
-
-* Consolidated different create and create! versions to call through to the base class with scope. This fixes inconsistencies, especially related to protected attribtues. Closes #5847 [Alexander Dymo, Tobias Luetke]
-
-* find supports :lock with :include. Check whether your database allows SELECT ... FOR UPDATE with outer joins before using. #6764 [vitaly, Jeremy Kemper]
-
-* Add AssociationCollection#create! to be consistent with AssociationCollection#create when dealing with a foreign key that is a protected attribute [Cody Fauser]
-
-* Added counter optimization for AssociationCollection#any? so person.friends.any? won't actually load the full association if we have the count in a cheaper form [DHH]
-
-* Change fixture_path to a class inheritable accessor allowing test cases to have their own custom set of fixtures. #6672 [zdennis]
-
-* Quote ActiveSupport::Multibyte::Chars. #6653 [Julian Tarkhanov]
-
-* Simplify query_attribute by typecasting the attribute value and checking whether it's nil, false, zero or blank. #6659 [Jonathan Viney]
-
-* validates_numericality_of uses \A \Z to ensure the entire string matches rather than ^ $ which may match one valid line of a multiline string. #5716 [Andreas Schwarz]
-
-* Run validations in the order they were declared. #6657 [obrie]
-
-* MySQL: detect when a NOT NULL column without a default value is misreported as default ''. Can't detect for string, text, and binary columns since '' is a legitimate default. #6156 [simon@redhillconsulting.com.au, obrie, Jonathan Viney, Jeremy Kemper]
-
-* Simplify association proxy implementation by factoring construct_scope out of method_missing. #6643 [martin]
-
-* Oracle: automatically detect the primary key. #6594 [vesaria, Michael Schoen]
-
-* Oracle: to increase performance, prefetch 100 rows and enable similar cursor sharing. Both are configurable in database.yml. #6607 [philbogle@gmail.com, ray.fortna@jobster.com, Michael Schoen]
-
-* Don't inspect unloaded associations. #2905 [lmarlow]
-
-* SQLite: use AUTOINCREMENT primary key in >= 3.1.0. #6588, #6616 [careo, lukfugl]
-
-* Cache inheritance_column. #6592 [Stefan Kaes]
-
-* Firebird: decimal/numeric support. #6408 [macrnic]
-
-* make add_order a tad faster. #6567 [Stefan Kaes]
-
-* Find with :include respects scoped :order. #5850
-
-* Support nil and Array in :conditions => { attr => value } hashes. #6548 [Assaf, Jeremy Kemper]
- find(:all, :conditions => { :topic_id => [1, 2, 3], :last_read => nil }
-
-* Consistently use LOWER() for uniqueness validations (rather than mixing with UPPER()) so the database can always use a functional index on the lowercased column. #6495 [Si]
-
-* SQLite: fix calculations workaround, remove count(distinct) query rewrite, cleanup test connection scripts. [Jeremy Kemper]
-
-* SQLite: count(distinct) queries supported in >= 3.2.6. #6544 [Bob Silva]
-
-* Dynamically generate reader methods for serialized attributes. #6362 [Stefan Kaes]
-
-* Deprecation: object transactions warning. [Jeremy Kemper]
-
-* has_one :dependent => :nullify ignores nil associates. #4848, #6528 [bellis@deepthought.org, janovetz, Jeremy Kemper]
-
-* Oracle: resolve test failures, use prefetched primary key for inserts, check for null defaults, fix limited id selection for eager loading. Factor out some common methods from all adapters. #6515 [Michael Schoen]
-
-* Make add_column use the options hash with the Sqlite Adapter. Closes #6464 [obrie]
-
-* Document other options available to migration's add_column. #6419 [grg]
-
-* MySQL: all_hashes compatibility with old MysqlRes class. #6429, #6601 [Jeremy Kemper]
-
-* Fix has_many :through to add the appropriate conditions when going through an association using STI. Closes #5783. [Jonathan Viney]
-
-* fix select_limited_ids_list issues in postgresql, retain current behavior in other adapters [Rick]
-
-* Restore eager condition interpolation, document it's differences [Rick]
-
-* Don't rollback in teardown unless a transaction was started. Don't start a transaction in create_fixtures if a transaction is started. #6282 [Jacob Fugal, Jeremy Kemper]
-
-* Add #delete support to has_many :through associations. Closes #6049 [Martin Landers]
-
-* Reverted old select_limited_ids_list postgresql fix that caused issues in mysql. Closes #5851 [Rick]
-
-* Removes the ability for eager loaded conditions to be interpolated, since there is no model instance to use as a context for interpolation. #5553 [turnip@turnipspatch.com]
-
-* Added timeout option to SQLite3 configurations to deal more gracefully with SQLite3::BusyException, now the connection can instead retry for x seconds to see if the db clears up before throwing that exception #6126 [wreese@gmail.com]
-
-* Added update_attributes! which uses save! to raise an exception if a validation error prevents saving #6192 [jonathan]
-
-* Deprecated add_on_boundary_breaking (use validates_length_of instead) #6292 [BobSilva]
-
-* The has_many create method works with polymorphic associations. #6361 [Dan Peterson]
-
-* MySQL: introduce Mysql::Result#all_hashes to support further optimization. #5581 [Stefan Kaes]
-
-* save! shouldn't validate twice. #6324 [maiha, Bob Silva]
-
-* Association collections have an _ids reader method to match the existing writer for collection_select convenience (e.g. employee.task_ids). The writer method skips blank ids so you can safely do @employee.task_ids = params[:tasks] without checking every time for an empty list or blank values. #1887, #5780 [Michael Schuerig]
-
-* Add an attribute reader method for ActiveRecord::Base.observers [Rick Olson]
-
-* Deprecation: count class method should be called with an options hash rather than two args for conditions and joins. #6287 [Bob Silva]
-
-* has_one associations with a nil target may be safely marshaled. #6279 [norbauer, Jeremy Kemper]
-
-* Duplicate the hash provided to AR::Base#to_xml to prevent unexpected side effects [Koz]
-
-* Add a :namespace option to AR::Base#to_xml [Koz]
-
-* Deprecation tests. Remove warnings for dynamic finders and for the foo_count method if it's also an attribute. [Jeremy Kemper]
-
-* Mock Time.now for more accurate Touch mixin tests. #6213 [Dan Peterson]
-
-* Improve yaml fixtures error reporting. #6205 [Bruce Williams]
-
-* Rename AR::Base#quote so people can use that name in their models. #3628 [Koz]
-
-* Add deprecation warning for inferred foreign key. #6029 [Josh Susser]
-
-* Fixed the Ruby/MySQL adapter we ship with Active Record to work with the new authentication handshake that was introduced in MySQL 4.1, along with the other protocol changes made at that time #5723 [jimw@mysql.com]
-
-* Deprecation: use :dependent => :delete_all rather than :exclusively_dependent => true. #6024 [Josh Susser]
-
-* Document validates_presences_of behavior with booleans: you probably want validates_inclusion_of :attr, :in => [true, false]. #2253 [Bob Silva]
-
-* Optimistic locking: gracefully handle nil versions, treat as zero. #5908 [Tom Ward]
-
-* to_xml: the :methods option works on arrays of records. #5845 [Josh Starcher]
-
-* Deprecation: update docs. #5998 [jakob@mentalized.net, Kevin Clark]
-
-* Add some XmlSerialization tests for ActiveRecord [Rick Olson]
-
-* has_many :through conditions are sanitized by the associating class. #5971 [martin.emde@gmail.com]
-
-* Tighten rescue clauses. #5985 [james@grayproductions.net]
-
-* Fix spurious newlines and spaces in AR::Base#to_xml output [Jamis Buck]
-
-* has_one supports the :dependent => :delete option which skips the typical callback chain and deletes the associated object directly from the database. #5927 [Chris Mear, Jonathan Viney]
-
-* Nested subclasses are not prefixed with the parent class' table_name since they should always use the base class' table_name. #5911 [Jonathan Viney]
-
-* SQLServer: work around bug where some unambiguous date formats are not correctly identified if the session language is set to german. #5894 [Tom Ward, kruth@bfpi]
-
-* SQLServer: fix eager association test. #5901 [Tom Ward]
-
-* Clashing type columns due to a sloppy join shouldn't wreck single-table inheritance. #5838 [Kevin Clark]
-
-* Fixtures: correct escaping of \n and \r. #5859 [evgeny.zislis@gmail.com]
-
-* Migrations: gracefully handle missing migration files. #5857 [eli.gordon@gmail.com]
-
-* MySQL: update test schema for MySQL 5 strict mode. #5861 [Tom Ward]
-
-* to_xml: correct naming of included associations. #5831 [josh.starcher@gmail.com]
-
-* Pushing a record onto a has_many :through sets the association's foreign key to the associate's primary key and adds it to the correct association. #5815, #5829 [josh@hasmanythrough.com]
-
-* Add records to has_many :through using <<, push, and concat by creating the association record. Raise if base or associate are new records since both ids are required to create the association. #build raises since you can't associate an unsaved record. #create! takes an attributes hash and creates the associated record and its association in a transaction. [Jeremy Kemper]
-
- # Create a tagging to associate the post and tag.
- post.tags << Tag.find_by_name('old')
- post.tags.create! :name => 'general'
-
- # Would have been:
- post.taggings.create!(:tag => Tag.find_by_name('finally')
- transaction do
- post.taggings.create!(:tag => Tag.create!(:name => 'general'))
- end
-
-* Cache nil results for :included has_one associations also. #5787 [Michael Schoen]
-
-* Fixed a bug which would cause .save to fail after trying to access a empty has_one association on a unsaved record. [Tobias Luetke]
-
-* Nested classes are given table names prefixed by the singular form of the parent's table name. [Jeremy Kemper]
- Example: Invoice::Lineitem is given table name invoice_lineitems
-
-* Migrations: uniquely name multicolumn indexes so you don't have to. [Jeremy Kemper]
- # people_active_last_name_index, people_active_deactivated_at_index
- add_index :people, [:active, :last_name]
- add_index :people, [:active, :deactivated_at]
- remove_index :people, [:active, :last_name]
- remove_index :people, [:active, :deactivated_at]
-
- WARNING: backward-incompatibility. Multicolumn indexes created before this
- revision were named using the first column name only. Now they're uniquely
- named using all indexed columns.
-
- To remove an old multicolumn index, remove_index :table_name, :first_column
-
-* Fix for deep includes on the same association. [richcollins@gmail.com]
-
-* Tweak fixtures so they don't try to use a non-ActiveRecord class. [Kevin Clark]
-
-* Remove ActiveRecord::Base.reset since Dispatcher doesn't use it anymore. [Rick Olson]
-
-* Document find's :from option. Closes #5762. [andrew@redlinesoftware.com]
-
-* PostgreSQL: autodetected sequences work correctly with multiple schemas. Rely on the schema search_path instead of explicitly qualifying the sequence name with its schema. #5280 [guy.naor@famundo.com]
-
-* Replace Reloadable with Reloadable::Deprecated. [Nicholas Seckar]
-
-* Cache nil results for has_one associations so multiple calls don't call the database. Closes #5757. [Michael A. Schoen]
-
-* Add documentation for how to disable timestamps on a per model basis. Closes #5684. [matt@mattmargolis.net Marcel Molina Jr.]
-
-* Don't save has_one associations unnecessarily. #5735 [Jonathan Viney]
-
-* Refactor ActiveRecord::Base.reset_subclasses to #reset, and add global observer resetting. [Rick Olson]
-
-* Formally deprecate the deprecated finders. [Koz]
-
-* Formally deprecate rich associations. [Koz]
-
-* Fixed that default timezones for new / initialize should uphold utc setting #5709 [daniluk@yahoo.com]
-
-* Fix announcement of very long migration names. #5722 [blake@near-time.com]
-
-* The exists? class method should treat a string argument as an id rather than as conditions. #5698 [jeremy@planetargon.com]
-
-* Fixed to_xml with :include misbehaviors when invoked on array of model instances #5690 [alexkwolfe@gmail.com]
-
-* Added support for conditions on Base.exists? #5689 [Josh Peek]. Examples:
-
- assert (Topic.exists?(:author_name => "David"))
- assert (Topic.exists?(:author_name => "Mary", :approved => true))
- assert (Topic.exists?(["parent_id = ?", 1]))
-
-* Schema dumper quotes date :default values. [Dave Thomas]
-
-* Calculate sum with SQL, not Enumerable on HasManyThrough Associations. [Dan Peterson]
-
-* Factor the attribute#{suffix} methods out of method_missing for easier extension. [Jeremy Kemper]
-
-* Patch sql injection vulnerability when using integer or float columns. [Jamis Buck]
-
-* Allow #count through a has_many association to accept :include. [Dan Peterson]
-
-* create_table rdoc: suggest :id => false for habtm join tables. [Zed Shaw]
-
-* PostgreSQL: return array fields as strings. #4664 [Robby Russell]
-
-* SQLServer: added tests to ensure all database statements are closed, refactored identity_insert management code to use blocks, removed update/delete rowcount code out of execute and into update/delete, changed insert to go through execute method, removed unused quoting methods, disabled pessimistic locking tests as feature is currently unsupported, fixed RakeFile to load sqlserver specific tests whether running in ado or odbc mode, fixed support for recently added decimal types, added support for limits on integer types. #5670 [Tom Ward]
-
-* SQLServer: fix db:schema:dump case-sensitivity. #4684 [Will Rogers]
-
-* Oracle: BigDecimal support. #5667 [schoenm@earthlink.net]
-
-* Numeric and decimal columns map to BigDecimal instead of Float. Those with scale 0 map to Integer. #5454 [robbat2@gentoo.org, work@ashleymoran.me.uk]
-
-* Firebird migrations support. #5337 [Ken Kunz ]
-
-* PostgreSQL: create/drop as postgres user. #4790 [mail@matthewpainter.co.uk, mlaster@metavillage.com]
-
-* Update callbacks documentation. #3970 [Robby Russell ]
-
-* PostgreSQL: correctly quote the ' in pk_and_sequence_for. #5462 [tietew@tietew.net]
-
-* PostgreSQL: correctly quote microseconds in timestamps. #5641 [rick@rickbradley.com]
-
-* Clearer has_one/belongs_to model names (account has_one :user). #5632 [matt@mattmargolis.net]
-
-* Oracle: use nonblocking queries if allow_concurrency is set, fix pessimistic locking, don't guess date vs. time by default (set OracleAdapter.emulate_dates = true for the old behavior), adapter cleanup. #5635 [schoenm@earthlink.net]
-
-* Fixed a few Oracle issues: Allows Oracle's odd date handling to still work consistently within #to_xml, Passes test that hardcode insert statement by dropping the :id column, Updated RUNNING_UNIT_TESTS with Oracle instructions, Corrects method signature for #exec #5294 [schoenm@earthlink.net]
-
-* Added :group to available options for finds done on associations #5516 [mike@michaeldewey.org]
-
-* Minor tweak to improve performance of ActiveRecord::Base#to_param.
-
-* Observers also watch subclasses created after they are declared. #5535 [daniels@pronto.com.au]
-
-* Removed deprecated timestamps_gmt class methods. [Jeremy Kemper]
-
-* rake build_mysql_database grants permissions to rails@localhost. #5501 [brianegge@yahoo.com]
-
-* PostgreSQL: support microsecond time resolution. #5492 [alex@msgpad.com]
-
-* Add AssociationCollection#sum since the method_missing invokation has been shadowed by Enumerable#sum.
-
-* Added find_or_initialize_by_X which works like find_or_create_by_X but doesn't save the newly instantiated record. [Sam Stephenson]
-
-* Row locking. Provide a locking clause with the :lock finder option or true for the default "FOR UPDATE". Use the #lock! method to obtain a row lock on a single record (reloads the record with :lock => true). [Shugo Maeda]
- # Obtain an exclusive lock on person 1 so we can safely increment visits.
- Person.transaction do
- # select * from people where id=1 for update
- person = Person.find(1, :lock => true)
- person.visits += 1
- person.save!
- end
-
-* PostgreSQL: introduce allow_concurrency option which determines whether to use blocking or asynchronous #execute. Adapters with blocking #execute will deadlock Ruby threads. The default value is ActiveRecord::Base.allow_concurrency. [Jeremy Kemper]
-
-* Use a per-thread (rather than global) transaction mutex so you may execute concurrent transactions on separate connections. [Jeremy Kemper]
-
-* Change AR::Base#to_param to return a String instead of a Fixnum. Closes #5320. [Nicholas Seckar]
-
-* Use explicit delegation instead of method aliasing for AR::Base.to_param -> AR::Base.id. #5299 (skaes@web.de)
-
-* Refactored ActiveRecord::Base.to_xml to become a delegate for XmlSerializer, which restores sanity to the mega method. This refactoring also reinstates the opinions that type="string" is redundant and ugly and nil-differentiation is not a concern of serialization [DHH]
-
-* Added simple hash conditions to find that'll just convert hash to an AND-based condition string #5143 [hcatlin@gmail.com]. Example:
-
- Person.find(:all, :conditions => { :last_name => "Catlin", :status => 1 }, :limit => 2)
-
-...is the same as:
-
- Person.find(:all, :conditions => [ "last_name = ? and status = ?", "Catlin", 1 ], :limit => 2)
-
- This makes it easier to pass in the options from a form or otherwise outside.
-
-
-* Fixed issues with BLOB limits, charsets, and booleans for Firebird #5194, #5191, #5189 [kennethkunz@gmail.com]
-
-* Fixed usage of :limit and with_scope when the association in scope is a 1:m #5208 [alex@purefiction.net]
-
-* Fixed migration trouble with SQLite when NOT NULL is used in the new definition #5215 [greg@lapcominc.com]
-
-* Fixed problems with eager loading and counting on SQL Server #5212 [kajism@yahoo.com]
-
-* Fixed that count distinct should use the selected column even when using :include #5251 [anna@wota.jp]
-
-* Fixed that :includes merged from with_scope won't cause the same association to be loaded more than once if repetition occurs in the clauses #5253 [alex@purefiction.net]
-
-* Allow models to override to_xml. #4989 [Blair Zajac ]
-
-* PostgreSQL: don't ignore port when host is nil since it's often used to label the domain socket. #5247 [shimbo@is.naist.jp]
-
-* Records and arrays of records are bound as quoted ids. [Jeremy Kemper]
- Foo.find(:all, :conditions => ['bar_id IN (?)', bars])
- Foo.find(:first, :conditions => ['bar_id = ?', bar])
-
-* Fixed that Base.find :all, :conditions => [ "id IN (?)", collection ] would fail if collection was empty [DHH]
-
-* Add a list of regexes assert_queries skips in the ActiveRecord test suite. [Rick]
-
-* Fix the has_and_belongs_to_many #create doesn't populate the join for new records. Closes #3692 [josh@hasmanythrough.com]
-
-* Provide Association Extensions access to the instance that the association is being accessed from.
- Closes #4433 [josh@hasmanythrough.com]
-
-* Update OpenBase adaterp's maintainer's email address. Closes #5176. [Derrick Spell]
-
-* Add a quick note about :select and eagerly included associations. [Rick]
-
-* Add docs for the :as option in has_one associations. Closes #5144 [cdcarter@gmail.com]
-
-* Fixed that has_many collections shouldn't load the entire association to do build or create [DHH]
-
-* Added :allow_nil option for aggregations #5091 [ian.w.white@gmail.com]
-
-* Fix Oracle boolean support and tests. Closes #5139. [schoenm@earthlink.net]
-
-* create! no longer blows up when no attributes are passed and a :create scope is in effect (e.g. foo.bars.create! failed whereas foo.bars.create!({}) didn't.) [Jeremy Kemper]
-
-* Call Inflector#demodulize on the class name when eagerly including an STI model. Closes #5077 [info@loobmedia.com]
-
-* Preserve MySQL boolean column defaults when changing a column in a migration. Closes #5015. [pdcawley@bofh.org.uk]
-
-* PostgreSQL: migrations support :limit with :integer columns by mapping limit < 4 to smallint, > 4 to bigint, and anything else to integer. #2900 [keegan@thebasement.org]
-
-* Dates and times interpret empty strings as nil rather than 2000-01-01. #4830 [kajism@yahoo.com]
-
-* Allow :uniq => true with has_many :through associations. [Jeremy Kemper]
-
-* Ensure that StringIO is always available for the Schema dumper. [Marcel Molina Jr.]
-
-* Allow AR::Base#to_xml to include methods too. Closes #4921. [johan@textdrive.com]
-
-* Replace superfluous name_to_class_name variant with camelize. [Marcel Molina Jr.]
-
-* Replace alias method chaining with Module#alias_method_chain. [Marcel Molina Jr.]
-
-* Replace Ruby's deprecated append_features in favor of included. [Marcel Molina Jr.]
-
-* Remove duplicate fixture entry in comments.yml. Closes #4923. [Blair Zajac ]
-
-* Update FrontBase adapter to check binding version. Closes #4920. [mlaster@metavillage.com]
-
-* New Frontbase connections don't start in auto-commit mode. Closes #4922. [mlaster@metavillage.com]
-
-* When grouping, use the appropriate option key. [Marcel Molina Jr.]
-
-* Only modify the sequence name in the FrontBase adapter if the FrontBase adapter is actually being used. [Marcel Molina Jr.]
-
-* Add support for FrontBase (http://www.frontbase.com/) with a new adapter thanks to the hard work of one Mike Laster. Closes #4093. [mlaster@metavillage.com]
-
-* Add warning about the proper way to validate the presence of a foreign key. Closes #4147. [Francois Beausoleil ]
-
-* Fix syntax error in documentation. Closes #4679. [mislav@nippur.irb.hr]
-
-* Add Oracle support for CLOB inserts. Closes #4748. [schoenm@earthlink.net sandra.metz@duke.edu]
-
-* Various fixes for sqlserver_adapter (odbc statement finishing, ado schema dumper, drop index). Closes #4831. [kajism@yahoo.com]
-
-* Add support for :order option to with_scope. Closes #3887. [eric.daspet@survol.net]
-
-* Prettify output of schema_dumper by making things line up. Closes #4241 [Caio Chassot ]
-
-* Make build_postgresql_databases task make databases owned by the postgres user. Closes #4790. [mlaster@metavillage.com]
-
-* Sybase Adapter type conversion cleanup. Closes #4736. [dev@metacasa.net]
-
-* Fix bug where calculations with long alias names return null. [Rick]
-
-* Raise error when trying to add to a has_many :through association. Use the Join Model instead. [Rick]
-
- @post.tags << @tag # BAD
- @post.taggings.create(:tag => @tag) # GOOD
-
-* Allow all calculations to take the :include option, not just COUNT (closes #4840) [Rick]
-
-* Update inconsistent migrations documentation. #4683 [machomagna@gmail.com]
-
-* Add ActiveRecord::Errors#to_xml [Jamis Buck]
-
-* Properly quote index names in migrations (closes #4764) [John Long]
-
-* Fix the HasManyAssociation#count method so it uses the new ActiveRecord::Base#count syntax, while maintaining backwards compatibility. [Rick]
-
-* Ensure that Associations#include_eager_conditions? checks both scoped and explicit conditions [Rick]
-
-* Associations#select_limited_ids_list adds the ORDER BY columns to the SELECT DISTINCT List for postgresql. [Rick]
-
-* DRY up association collection reader method generation. [Marcel Molina Jr.]
-
-* DRY up and tweak style of the validation error object. [Marcel Molina Jr.]
-
-* Add :case_sensitive option to validates_uniqueness_of (closes #3090) [Rick]
-
- class Account < ActiveRecord::Base
- validates_uniqueness_of :email, :case_sensitive => false
- end
-
-* Allow multiple association extensions with :extend option (closes #4666) [Josh Susser]
-
- class Account < ActiveRecord::Base
- has_many :people, :extend => [FindOrCreateByNameExtension, FindRecentExtension]
- end
-
- *1.15.3* (March 12th, 2007)
-
- * Allow a polymorphic :source for has_many :through associations. Closes #7143 [protocool]
-
- * Consistently quote primary key column names. #7763 [toolmantim]
-
- * Fixtures: fix YAML ordered map support. #2665 [Manuel Holtgrewe, nfbuckley]
-
- * Fix has_many :through << with custom foreign keys. #6466, #7153 [naffis, Rich Collins]
-
-
-*1.15.2* (February 5th, 2007)
-
-* Pass a range in :conditions to use the SQL BETWEEN operator. #6974 [dcmanges]
- Student.find(:all, :conditions => { :grade => 9..12 })
-
-* Don't create instance writer methods for class attributes. [Rick]
-
-* When dealing with SQLite3, use the table_info pragma helper, so that the bindings can do some translation for when sqlite3 breaks incompatibly between point releases. [Jamis Buck]
-
-* SQLServer: don't choke on strings containing 'null'. #7083 [Jakob S]
-
-* Consistently use LOWER() for uniqueness validations (rather than mixing with UPPER()) so the database can always use a functional index on the lowercased column. #6495 [Si]
-
-* MySQL: SET SQL_AUTO_IS_NULL=0 so 'where id is null' doesn't select the last inserted id. #6778 [Jonathan Viney, timc]
-
-* Fixtures use the table name and connection from set_fixture_class. #7330 [Anthony Eden]
-
-* SQLServer: quote table name in indexes query. #2928 [keithm@infused.org]
-
-
-*1.15.1* (January 17th, 2007)
-
-* Fix nodoc breaking of adapters
-
-
-*1.15.0* (January 16th, 2007)
-
-* [DOC] clear up some ambiguity with the way has_and_belongs_to_many creates the default join table name. #7072 [jeremymcanally]
-
-* change_column accepts :default => nil. Skip column options for primary keys. #6956, #7048 [dcmanges, Jeremy Kemper]
-
-* MySQL, PostgreSQL: change_column_default quotes the default value and doesn't lose column type information. #3987, #6664 [Jonathan Viney, manfred, altano@bigfoot.com]
-
-* Oracle: create_table takes a :sequence_name option to override the 'tablename_seq' default. #7000 [Michael Schoen]
-
-* MySQL: retain SSL settings on reconnect. #6976 [randyv2]
-
-* SQLServer: handle [quoted] table names. #6635 [rrich]
-
-* acts_as_nested_set works with single-table inheritance. #6030 [Josh Susser]
-
-* PostgreSQL, Oracle: correctly perform eager finds with :limit and :order. #4668, #7021 [eventualbuddha, Michael Schoen]
-
-* Fix the Oracle adapter for serialized attributes stored in CLOBs. Closes #6825 [mschoen, tdfowler]
-
-* [DOCS] Apply more documentation for ActiveRecord Reflection. Closes #4055 [Robby Russell]
-
-* [DOCS] Document :allow_nil option of #validate_uniqueness_of. Closes #3143 [Caio Chassot]
-
-* Bring the sybase adapter up to scratch for 1.2 release. [jsheets]
-
-* Oracle: fix connection reset failure. #6846 [leonlleslie]
-
-* Subclass instantiation doesn't try to explicitly require the corresponding subclass. #6840 [leei, Jeremy Kemper]
-
-* fix faulty inheritance tests and that eager loading grabs the wrong inheritance column when the class of your association is an STI subclass. Closes #6859 [protocool]
-
-* find supports :lock with :include. Check whether your database allows SELECT ... FOR UPDATE with outer joins before using. #6764 [vitaly, Jeremy Kemper]
-
-* Support nil and Array in :conditions => { attr => value } hashes. #6548 [Assaf, Jeremy Kemper]
- find(:all, :conditions => { :topic_id => [1, 2, 3], :last_read => nil }
-
-* Quote ActiveSupport::Multibyte::Chars. #6653 [Julian Tarkhanov]
-
-* MySQL: detect when a NOT NULL column without a default value is misreported as default ''. Can't detect for string, text, and binary columns since '' is a legitimate default. #6156 [simon@redhillconsulting.com.au, obrie, Jonathan Viney, Jeremy Kemper]
-
-* validates_numericality_of uses \A \Z to ensure the entire string matches rather than ^ $ which may match one valid line of a multiline string. #5716 [Andreas Schwarz]
-
-* Oracle: automatically detect the primary key. #6594 [vesaria, Michael Schoen]
-
-* Oracle: to increase performance, prefetch 100 rows and enable similar cursor sharing. Both are configurable in database.yml. #6607 [philbogle@gmail.com, ray.fortna@jobster.com, Michael Schoen]
-
-* Firebird: decimal/numeric support. #6408 [macrnic]
-
-* Find with :include respects scoped :order. #5850
-
-* Dynamically generate reader methods for serialized attributes. #6362 [Stefan Kaes]
-
-* Deprecation: object transactions warning. [Jeremy Kemper]
-
-* has_one :dependent => :nullify ignores nil associates. #6528 [janovetz, Jeremy Kemper]
-
-* Oracle: resolve test failures, use prefetched primary key for inserts, check for null defaults, fix limited id selection for eager loading. Factor out some common methods from all adapters. #6515 [Michael Schoen]
-
-* Make add_column use the options hash with the Sqlite Adapter. Closes #6464 [obrie]
-
-* Document other options available to migration's add_column. #6419 [grg]
-
-* MySQL: all_hashes compatibility with old MysqlRes class. #6429, #6601 [Jeremy Kemper]
-
-* Fix has_many :through to add the appropriate conditions when going through an association using STI. Closes #5783. [Jonathan Viney]
-
-* fix select_limited_ids_list issues in postgresql, retain current behavior in other adapters [Rick]
-
-* Restore eager condition interpolation, document it's differences [Rick]
-
-* Don't rollback in teardown unless a transaction was started. Don't start a transaction in create_fixtures if a transaction is started. #6282 [Jacob Fugal, Jeremy Kemper]
-
-* Add #delete support to has_many :through associations. Closes #6049 [Martin Landers]
-
-* Reverted old select_limited_ids_list postgresql fix that caused issues in mysql. Closes #5851 [Rick]
-
-* Removes the ability for eager loaded conditions to be interpolated, since there is no model instance to use as a context for interpolation. #5553 [turnip@turnipspatch.com]
-
-* Added timeout option to SQLite3 configurations to deal more gracefully with SQLite3::BusyException, now the connection can instead retry for x seconds to see if the db clears up before throwing that exception #6126 [wreese@gmail.com]
-
-* Added update_attributes! which uses save! to raise an exception if a validation error prevents saving #6192 [jonathan]
-
-* Deprecated add_on_boundary_breaking (use validates_length_of instead) #6292 [BobSilva]
-
-* The has_many create method works with polymorphic associations. #6361 [Dan Peterson]
-
-* MySQL: introduce Mysql::Result#all_hashes to support further optimization. #5581 [Stefan Kaes]
-
-* save! shouldn't validate twice. #6324 [maiha, Bob Silva]
-
-* Association collections have an _ids reader method to match the existing writer for collection_select convenience (e.g. employee.task_ids). The writer method skips blank ids so you can safely do @employee.task_ids = params[:tasks] without checking every time for an empty list or blank values. #1887, #5780 [Michael Schuerig]
-
-* Add an attribute reader method for ActiveRecord::Base.observers [Rick Olson]
-
-* Deprecation: count class method should be called with an options hash rather than two args for conditions and joins. #6287 [Bob Silva]
-
-* has_one associations with a nil target may be safely marshaled. #6279 [norbauer, Jeremy Kemper]
-
-* Duplicate the hash provided to AR::Base#to_xml to prevent unexpected side effects [Koz]
-
-* Add a :namespace option to AR::Base#to_xml [Koz]
-
-* Deprecation tests. Remove warnings for dynamic finders and for the foo_count method if it's also an attribute. [Jeremy Kemper]
-
-* Mock Time.now for more accurate Touch mixin tests. #6213 [Dan Peterson]
-
-* Improve yaml fixtures error reporting. #6205 [Bruce Williams]
-
-* Rename AR::Base#quote so people can use that name in their models. #3628 [Koz]
-
-* Add deprecation warning for inferred foreign key. #6029 [Josh Susser]
-
-* Fixed the Ruby/MySQL adapter we ship with Active Record to work with the new authentication handshake that was introduced in MySQL 4.1, along with the other protocol changes made at that time #5723 [jimw@mysql.com]
-
-* Deprecation: use :dependent => :delete_all rather than :exclusively_dependent => true. #6024 [Josh Susser]
-
-* Optimistic locking: gracefully handle nil versions, treat as zero. #5908 [Tom Ward]
-
-* to_xml: the :methods option works on arrays of records. #5845 [Josh Starcher]
-
-* has_many :through conditions are sanitized by the associating class. #5971 [martin.emde@gmail.com]
-
-* Fix spurious newlines and spaces in AR::Base#to_xml output [Jamis Buck]
-
-* has_one supports the :dependent => :delete option which skips the typical callback chain and deletes the associated object directly from the database. #5927 [Chris Mear, Jonathan Viney]
-
-* Nested subclasses are not prefixed with the parent class' table_name since they should always use the base class' table_name. #5911 [Jonathan Viney]
-
-* SQLServer: work around bug where some unambiguous date formats are not correctly identified if the session language is set to german. #5894 [Tom Ward, kruth@bfpi]
-
-* Clashing type columns due to a sloppy join shouldn't wreck single-table inheritance. #5838 [Kevin Clark]
-
-* Fixtures: correct escaping of \n and \r. #5859 [evgeny.zislis@gmail.com]
-
-* Migrations: gracefully handle missing migration files. #5857 [eli.gordon@gmail.com]
-
-* MySQL: update test schema for MySQL 5 strict mode. #5861 [Tom Ward]
-
-* to_xml: correct naming of included associations. #5831 [josh.starcher@gmail.com]
-
-* Pushing a record onto a has_many :through sets the association's foreign key to the associate's primary key and adds it to the correct association. #5815, #5829 [josh@hasmanythrough.com]
-
-* Add records to has_many :through using <<, push, and concat by creating the association record. Raise if base or associate are new records since both ids are required to create the association. #build raises since you can't associate an unsaved record. #create! takes an attributes hash and creates the associated record and its association in a transaction. [Jeremy Kemper]
-
- # Create a tagging to associate the post and tag.
- post.tags << Tag.find_by_name('old')
- post.tags.create! :name => 'general'
-
- # Would have been:
- post.taggings.create!(:tag => Tag.find_by_name('finally')
- transaction do
- post.taggings.create!(:tag => Tag.create!(:name => 'general'))
- end
-
-* Cache nil results for :included has_one associations also. #5787 [Michael Schoen]
-
-* Fixed a bug which would cause .save to fail after trying to access a empty has_one association on a unsaved record. [Tobias Luetke]
-
-* Nested classes are given table names prefixed by the singular form of the parent's table name. [Jeremy Kemper]
- Example: Invoice::Lineitem is given table name invoice_lineitems
-
-* Migrations: uniquely name multicolumn indexes so you don't have to. [Jeremy Kemper]
- # people_active_last_name_index, people_active_deactivated_at_index
- add_index :people, [:active, :last_name]
- add_index :people, [:active, :deactivated_at]
- remove_index :people, [:active, :last_name]
- remove_index :people, [:active, :deactivated_at]
-
- WARNING: backward-incompatibility. Multicolumn indexes created before this
- revision were named using the first column name only. Now they're uniquely
- named using all indexed columns.
-
- To remove an old multicolumn index, remove_index :table_name, :first_column
-
-* Fix for deep includes on the same association. [richcollins@gmail.com]
-
-* Tweak fixtures so they don't try to use a non-ActiveRecord class. [Kevin Clark]
-
-* Remove ActiveRecord::Base.reset since Dispatcher doesn't use it anymore. [Rick Olson]
-
-* PostgreSQL: autodetected sequences work correctly with multiple schemas. Rely on the schema search_path instead of explicitly qualifying the sequence name with its schema. #5280 [guy.naor@famundo.com]
-
-* Replace Reloadable with Reloadable::Deprecated. [Nicholas Seckar]
-
-* Cache nil results for has_one associations so multiple calls don't call the database. Closes #5757. [Michael A. Schoen]
-
-* Don't save has_one associations unnecessarily. #5735 [Jonathan Viney]
-
-* Refactor ActiveRecord::Base.reset_subclasses to #reset, and add global observer resetting. [Rick Olson]
-
-* Formally deprecate the deprecated finders. [Koz]
-
-* Formally deprecate rich associations. [Koz]
-
-* Fixed that default timezones for new / initialize should uphold utc setting #5709 [daniluk@yahoo.com]
-
-* Fix announcement of very long migration names. #5722 [blake@near-time.com]
-
-* The exists? class method should treat a string argument as an id rather than as conditions. #5698 [jeremy@planetargon.com]
-
-* Fixed to_xml with :include misbehaviors when invoked on array of model instances #5690 [alexkwolfe@gmail.com]
-
-* Added support for conditions on Base.exists? #5689 [Josh Peek]. Examples:
-
- assert (Topic.exists?(:author_name => "David"))
- assert (Topic.exists?(:author_name => "Mary", :approved => true))
- assert (Topic.exists?(["parent_id = ?", 1]))
-
-* Schema dumper quotes date :default values. [Dave Thomas]
-
-* Calculate sum with SQL, not Enumerable on HasManyThrough Associations. [Dan Peterson]
-
-* Factor the attribute#{suffix} methods out of method_missing for easier extension. [Jeremy Kemper]
-
-* Patch sql injection vulnerability when using integer or float columns. [Jamis Buck]
-
-* Allow #count through a has_many association to accept :include. [Dan Peterson]
-
-* create_table rdoc: suggest :id => false for habtm join tables. [Zed Shaw]
-
-* PostgreSQL: return array fields as strings. #4664 [Robby Russell]
-
-* SQLServer: added tests to ensure all database statements are closed, refactored identity_insert management code to use blocks, removed update/delete rowcount code out of execute and into update/delete, changed insert to go through execute method, removed unused quoting methods, disabled pessimistic locking tests as feature is currently unsupported, fixed RakeFile to load sqlserver specific tests whether running in ado or odbc mode, fixed support for recently added decimal types, added support for limits on integer types. #5670 [Tom Ward]
-
-* SQLServer: fix db:schema:dump case-sensitivity. #4684 [Will Rogers]
-
-* Oracle: BigDecimal support. #5667 [schoenm@earthlink.net]
-
-* Numeric and decimal columns map to BigDecimal instead of Float. Those with scale 0 map to Integer. #5454 [robbat2@gentoo.org, work@ashleymoran.me.uk]
-
-* Firebird migrations support. #5337 [Ken Kunz ]
-
-* PostgreSQL: create/drop as postgres user. #4790 [mail@matthewpainter.co.uk, mlaster@metavillage.com]
-
-* PostgreSQL: correctly quote the ' in pk_and_sequence_for. #5462 [tietew@tietew.net]
-
-* PostgreSQL: correctly quote microseconds in timestamps. #5641 [rick@rickbradley.com]
-
-* Clearer has_one/belongs_to model names (account has_one :user). #5632 [matt@mattmargolis.net]
-
-* Oracle: use nonblocking queries if allow_concurrency is set, fix pessimistic locking, don't guess date vs. time by default (set OracleAdapter.emulate_dates = true for the old behavior), adapter cleanup. #5635 [schoenm@earthlink.net]
-
-* Fixed a few Oracle issues: Allows Oracle's odd date handling to still work consistently within #to_xml, Passes test that hardcode insert statement by dropping the :id column, Updated RUNNING_UNIT_TESTS with Oracle instructions, Corrects method signature for #exec #5294 [schoenm@earthlink.net]
-
-* Added :group to available options for finds done on associations #5516 [mike@michaeldewey.org]
-
-* Observers also watch subclasses created after they are declared. #5535 [daniels@pronto.com.au]
-
-* Removed deprecated timestamps_gmt class methods. [Jeremy Kemper]
-
-* rake build_mysql_database grants permissions to rails@localhost. #5501 [brianegge@yahoo.com]
-
-* PostgreSQL: support microsecond time resolution. #5492 [alex@msgpad.com]
-
-* Add AssociationCollection#sum since the method_missing invokation has been shadowed by Enumerable#sum.
-
-* Added find_or_initialize_by_X which works like find_or_create_by_X but doesn't save the newly instantiated record. [Sam Stephenson]
-
-* Row locking. Provide a locking clause with the :lock finder option or true for the default "FOR UPDATE". Use the #lock! method to obtain a row lock on a single record (reloads the record with :lock => true). [Shugo Maeda]
- # Obtain an exclusive lock on person 1 so we can safely increment visits.
- Person.transaction do
- # select * from people where id=1 for update
- person = Person.find(1, :lock => true)
- person.visits += 1
- person.save!
- end
-
-* PostgreSQL: introduce allow_concurrency option which determines whether to use blocking or asynchronous #execute. Adapters with blocking #execute will deadlock Ruby threads. The default value is ActiveRecord::Base.allow_concurrency. [Jeremy Kemper]
-
-* Use a per-thread (rather than global) transaction mutex so you may execute concurrent transactions on separate connections. [Jeremy Kemper]
-
-* Change AR::Base#to_param to return a String instead of a Fixnum. Closes #5320. [Nicholas Seckar]
-
-* Use explicit delegation instead of method aliasing for AR::Base.to_param -> AR::Base.id. #5299 (skaes@web.de)
-
-* Refactored ActiveRecord::Base.to_xml to become a delegate for XmlSerializer, which restores sanity to the mega method. This refactoring also reinstates the opinions that type="string" is redundant and ugly and nil-differentiation is not a concern of serialization [DHH]
-
-* Added simple hash conditions to find that'll just convert hash to an AND-based condition string #5143 [hcatlin@gmail.com]. Example:
-
- Person.find(:all, :conditions => { :last_name => "Catlin", :status => 1 }, :limit => 2)
-
-...is the same as:
-
- Person.find(:all, :conditions => [ "last_name = ? and status = ?", "Catlin", 1 ], :limit => 2)
-
- This makes it easier to pass in the options from a form or otherwise outside.
-
-
-* Fixed issues with BLOB limits, charsets, and booleans for Firebird #5194, #5191, #5189 [kennethkunz@gmail.com]
-
-* Fixed usage of :limit and with_scope when the association in scope is a 1:m #5208 [alex@purefiction.net]
-
-* Fixed migration trouble with SQLite when NOT NULL is used in the new definition #5215 [greg@lapcominc.com]
-
-* Fixed problems with eager loading and counting on SQL Server #5212 [kajism@yahoo.com]
-
-* Fixed that count distinct should use the selected column even when using :include #5251 [anna@wota.jp]
-
-* Fixed that :includes merged from with_scope won't cause the same association to be loaded more than once if repetition occurs in the clauses #5253 [alex@purefiction.net]
-
-* Allow models to override to_xml. #4989 [Blair Zajac ]
-
-* PostgreSQL: don't ignore port when host is nil since it's often used to label the domain socket. #5247 [shimbo@is.naist.jp]
-
-* Records and arrays of records are bound as quoted ids. [Jeremy Kemper]
- Foo.find(:all, :conditions => ['bar_id IN (?)', bars])
- Foo.find(:first, :conditions => ['bar_id = ?', bar])
-
-* Fixed that Base.find :all, :conditions => [ "id IN (?)", collection ] would fail if collection was empty [DHH]
-
-* Add a list of regexes assert_queries skips in the ActiveRecord test suite. [Rick]
-
-* Fix the has_and_belongs_to_many #create doesn't populate the join for new records. Closes #3692 [josh@hasmanythrough.com]
-
-* Provide Association Extensions access to the instance that the association is being accessed from.
- Closes #4433 [josh@hasmanythrough.com]
-
-* Update OpenBase adaterp's maintainer's email address. Closes #5176. [Derrick Spell]
-
-* Add a quick note about :select and eagerly included associations. [Rick]
-
-* Add docs for the :as option in has_one associations. Closes #5144 [cdcarter@gmail.com]
-
-* Fixed that has_many collections shouldn't load the entire association to do build or create [DHH]
-
-* Added :allow_nil option for aggregations #5091 [ian.w.white@gmail.com]
-
-* Fix Oracle boolean support and tests. Closes #5139. [schoenm@earthlink.net]
-
-* create! no longer blows up when no attributes are passed and a :create scope is in effect (e.g. foo.bars.create! failed whereas foo.bars.create!({}) didn't.) [Jeremy Kemper]
-
-* Call Inflector#demodulize on the class name when eagerly including an STI model. Closes #5077 [info@loobmedia.com]
-
-* Preserve MySQL boolean column defaults when changing a column in a migration. Closes #5015. [pdcawley@bofh.org.uk]
-
-* PostgreSQL: migrations support :limit with :integer columns by mapping limit < 4 to smallint, > 4 to bigint, and anything else to integer. #2900 [keegan@thebasement.org]
-
-* Dates and times interpret empty strings as nil rather than 2000-01-01. #4830 [kajism@yahoo.com]
-
-* Allow :uniq => true with has_many :through associations. [Jeremy Kemper]
-
-* Ensure that StringIO is always available for the Schema dumper. [Marcel Molina Jr.]
-
-* Allow AR::Base#to_xml to include methods too. Closes #4921. [johan@textdrive.com]
-
-* Remove duplicate fixture entry in comments.yml. Closes #4923. [Blair Zajac ]
-
-* When grouping, use the appropriate option key. [Marcel Molina Jr.]
-
-* Add support for FrontBase (http://www.frontbase.com/) with a new adapter thanks to the hard work of one Mike Laster. Closes #4093. [mlaster@metavillage.com]
-
-* Add warning about the proper way to validate the presence of a foreign key. Closes #4147. [Francois Beausoleil ]
-
-* Fix syntax error in documentation. Closes #4679. [mislav@nippur.irb.hr]
-
-* Add Oracle support for CLOB inserts. Closes #4748. [schoenm@earthlink.net sandra.metz@duke.edu]
-
-* Various fixes for sqlserver_adapter (odbc statement finishing, ado schema dumper, drop index). Closes #4831. [kajism@yahoo.com]
-
-* Add support for :order option to with_scope. Closes #3887. [eric.daspet@survol.net]
-
-* Prettify output of schema_dumper by making things line up. Closes #4241 [Caio Chassot ]
-
-* Make build_postgresql_databases task make databases owned by the postgres user. Closes #4790. [mlaster@metavillage.com]
-
-* Sybase Adapter type conversion cleanup. Closes #4736. [dev@metacasa.net]
-
-* Fix bug where calculations with long alias names return null. [Rick]
-
-* Raise error when trying to add to a has_many :through association. Use the Join Model instead. [Rick]
-
- @post.tags << @tag # BAD
- @post.taggings.create(:tag => @tag) # GOOD
-
-* Allow all calculations to take the :include option, not just COUNT (closes #4840) [Rick]
-
-* Add ActiveRecord::Errors#to_xml [Jamis Buck]
-
-* Properly quote index names in migrations (closes #4764) [John Long]
-
-* Fix the HasManyAssociation#count method so it uses the new ActiveRecord::Base#count syntax, while maintaining backwards compatibility. [Rick]
-
-* Ensure that Associations#include_eager_conditions? checks both scoped and explicit conditions [Rick]
-
-* Associations#select_limited_ids_list adds the ORDER BY columns to the SELECT DISTINCT List for postgresql. [Rick]
-
-* Add :case_sensitive option to validates_uniqueness_of (closes #3090) [Rick]
-
- class Account < ActiveRecord::Base
- validates_uniqueness_of :email, :case_sensitive => false
- end
-
-* Allow multiple association extensions with :extend option (closes #4666) [Josh Susser]
-
- class Account < ActiveRecord::Base
- has_many :people, :extend => [FindOrCreateByNameExtension, FindRecentExtension]
- end
-
-
-*1.14.4* (August 8th, 2006)
-
-* Add warning about the proper way to validate the presence of a foreign key. #4147 [Francois Beausoleil ]
-
-* Fix syntax error in documentation. #4679 [mislav@nippur.irb.hr]
-
-* Update inconsistent migrations documentation. #4683 [machomagna@gmail.com]
-
-
-*1.14.3* (June 27th, 2006)
-
-* Fix announcement of very long migration names. #5722 [blake@near-time.com]
-
-* Update callbacks documentation. #3970 [Robby Russell ]
-
-* Properly quote index names in migrations (closes #4764) [John Long]
-
-* Ensure that Associations#include_eager_conditions? checks both scoped and explicit conditions [Rick]
-
-* Associations#select_limited_ids_list adds the ORDER BY columns to the SELECT DISTINCT List for postgresql. [Rick]
-
-
-*1.14.2* (April 9th, 2006)
-
-* Fixed calculations for the Oracle Adapter (closes #4626) [Michael Schoen]
-
-
-*1.14.1* (April 6th, 2006)
-
-* Fix type_name_with_module to handle type names that begin with '::'. Closes #4614. [Nicholas Seckar]
-
-* Fixed that that multiparameter assignment doesn't work with aggregations (closes #4620) [Lars Pind]
-
-* Enable Limit/Offset in Calculations (closes #4558) [lmarlow@yahoo.com]
-
-* Fixed that loading including associations returns all results if Load IDs For Limited Eager Loading returns none (closes #4528) [Rick]
-
-* Fixed HasManyAssociation#find bugs when :finder_sql is set #4600 [lagroue@free.fr]
-
-* Allow AR::Base#respond_to? to behave when @attributes is nil [zenspider]
-
-* Support eager includes when going through a polymorphic has_many association. [Rick]
-
-* Added support for eagerly including polymorphic has_one associations. (closes #4525) [Rick]
-
- class Post < ActiveRecord::Base
- has_one :tagging, :as => :taggable
- end
-
- Post.find :all, :include => :tagging
-
-* Added descriptive error messages for invalid has_many :through associations: going through :has_one or :has_and_belongs_to_many [Rick]
-
-* Added support for going through a polymorphic has_many association: (closes #4401) [Rick]
-
- class PhotoCollection < ActiveRecord::Base
- has_many :photos, :as => :photographic
- belongs_to :firm
- end
-
- class Firm < ActiveRecord::Base
- has_many :photo_collections
- has_many :photos, :through => :photo_collections
- end
-
-* Multiple fixes and optimizations in PostgreSQL adapter, allowing ruby-postgres gem to work properly. [ruben.nine@gmail.com]
-
-* Fixed that AssociationCollection#delete_all should work even if the records of the association are not loaded yet. [Florian Weber]
-
-* Changed those private ActiveRecord methods to take optional third argument :auto instead of nil for performance optimizations. (closes #4456) [Stefan]
-
-* Private ActiveRecord methods add_limit!, add_joins!, and add_conditions! take an OPTIONAL third argument 'scope' (closes #4456) [Rick]
-
-* DEPRECATED: Using additional attributes on has_and_belongs_to_many associations. Instead upgrade your association to be a real join model [DHH]
-
-* Fixed that records returned from has_and_belongs_to_many associations with additional attributes should be marked as read only (fixes #4512) [DHH]
-
-* Do not implicitly mark recordss of has_many :through as readonly but do mark habtm records as readonly (eventually only on join tables without rich attributes). [Marcel Mollina Jr.]
-
-* Fixed broken OCIAdapter #4457 [schoenm@earthlink.net]
-
-
-*1.14.0* (March 27th, 2006)
-
-* Replace 'rescue Object' with a finer grained rescue. Closes #4431. [Nicholas Seckar]
-
-* Fixed eager loading so that an aliased table cannot clash with a has_and_belongs_to_many join table [Rick]
-
-* Add support for :include to with_scope [andrew@redlinesoftware.com]
-
-* Support the use of public synonyms with the Oracle adapter; required ruby-oci8 v0.1.14 #4390 [schoenm@earthlink.net]
-
-* Change periods (.) in table aliases to _'s. Closes #4251 [jeff@ministrycentered.com]
-
-* Changed has_and_belongs_to_many join to INNER JOIN for Mysql 3.23.x. Closes #4348 [Rick]
-
-* Fixed issue that kept :select options from being scoped [Rick]
-
-* Fixed db_schema_import when binary types are present #3101 [DHH]
-
-* Fixed that MySQL enums should always be returned as strings #3501 [DHH]
-
-* Change has_many :through to use the :source option to specify the source association. :class_name is now ignored. [Rick Olson]
-
- class Connection < ActiveRecord::Base
- belongs_to :user
- belongs_to :channel
- end
-
- class Channel < ActiveRecord::Base
- has_many :connections
- has_many :contacts, :through => :connections, :class_name => 'User' # OLD
- has_many :contacts, :through => :connections, :source => :user # NEW
- end
-
-* Fixed DB2 adapter so nullable columns will be determines correctly now and quotes from column default values will be removed #4350 [contact@maik-schmidt.de]
-
-* Allow overriding of find parameters in scoped has_many :through calls [Rick Olson]
-
- In this example, :include => false disables the default eager association from loading. :select changes the standard
- select clause. :joins specifies a join that is added to the end of the has_many :through query.
-
- class Post < ActiveRecord::Base
- has_many :tags, :through => :taggings, :include => :tagging do
- def add_joins_and_select
- find :all, :select => 'tags.*, authors.id as author_id', :include => false,
- :joins => 'left outer join posts on taggings.taggable_id = posts.id left outer join authors on posts.author_id = authors.id'
- end
- end
- end
-
-* Fixed that schema changes while the database was open would break any connections to a SQLite database (now we reconnect if that error is throw) [DHH]
-
-* Don't classify the has_one class when eager loading, it is already singular. Add tests. (closes #4117) [jonathan@bluewire.net.nz]
-
-* Quit ignoring default :include options in has_many :through calls [Mark James]
-
-* Allow has_many :through associations to find the source association by setting a custom class (closes #4307) [jonathan@bluewire.net.nz]
-
-* Eager Loading support added for has_many :through => :has_many associations (see below). [Rick Olson]
-
-* Allow has_many :through to work on has_many associations (closes #3864) [sco@scottraymond.net] Example:
-
- class Firm < ActiveRecord::Base
- has_many :clients
- has_many :invoices, :through => :clients
- end
-
- class Client < ActiveRecord::Base
- belongs_to :firm
- has_many :invoices
- end
-
- class Invoice < ActiveRecord::Base
- belongs_to :client
- end
-
-* Raise error when trying to select many polymorphic objects with has_many :through or :include (closes #4226) [josh@hasmanythrough.com]
-
-* Fixed has_many :through to include :conditions set on the :through association. closes #4020 [jonathan@bluewire.net.nz]
-
-* Fix that has_many :through honors the foreign key set by the belongs_to association in the join model (closes #4259) [andylien@gmail.com / Rick]
-
-* SQL Server adapter gets some love #4298 [rtomayko@gmail.com]
-
-* Added OpenBase database adapter that builds on top of the http://www.spice-of-life.net/ruby-openbase/ driver. All functionality except LIMIT/OFFSET is supported #3528 [derrickspell@cdmplus.com]
-
-* Rework table aliasing to account for truncated table aliases. Add smarter table aliasing when doing eager loading of STI associations. This allows you to use the association name in the order/where clause. [Jonathan Viney / Rick Olson] #4108 Example (SpecialComment is using STI):
-
- Author.find(:all, :include => { :posts => :special_comments }, :order => 'special_comments.body')
-
-* Add AbstractAdapter#table_alias_for to create table aliases according to the rules of the current adapter. [Rick]
-
-* Provide access to the underlying database connection through Adapter#raw_connection. Enables the use of db-specific methods without complicating the adapters. #2090 [Koz]
-
-* Remove broken attempts at handling columns with a default of 'now()' in the postgresql adapter. #2257 [Koz]
-
-* Added connection#current_database that'll return of the current database (only works in MySQL, SQL Server, and Oracle so far -- please help implement for the rest of the adapters) #3663 [Tom ward]
-
-* Fixed that Migration#execute would have the table name prefix appended to its query #4110 [mark.imbriaco@pobox.com]
-
-* Make all tinyint(1) variants act like boolean in mysql (tinyint(1) unsigned, etc.) [Jamis Buck]
-
-* Use association's :conditions when eager loading. [jeremyevans0@gmail.com] #4144
-
-* Alias the has_and_belongs_to_many join table on eager includes. #4106 [jeremyevans0@gmail.com]
-
- This statement would normally error because the projects_developers table is joined twice, and therefore joined_on would be ambiguous.
-
- Developer.find(:all, :include => {:projects => :developers}, :conditions => 'join_project_developers.joined_on IS NOT NULL')
-
-* Oracle adapter gets some love #4230 [schoenm@earthlink.net]
-
- * Changes :text to CLOB rather than BLOB [Moses Hohman]
- * Fixes an issue with nil numeric length/scales (several)
- * Implements support for XMLTYPE columns [wilig / Kubo Takehiro]
- * Tweaks a unit test to get it all green again
- * Adds support for #current_database
-
-* Added Base.abstract_class? that marks which classes are not part of the Active Record hierarchy #3704 [Rick Olson]
-
- class CachedModel < ActiveRecord::Base
- self.abstract_class = true
- end
-
- class Post < CachedModel
- end
-
- CachedModel.abstract_class?
- => true
-
- Post.abstract_class?
- => false
-
- Post.base_class
- => Post
-
- Post.table_name
- => 'posts'
-
-* Allow :dependent options to be used with polymorphic joins. #3820 [Rick Olson]
-
- class Foo < ActiveRecord::Base
- has_many :attachments, :as => :attachable, :dependent => :delete_all
- end
-
-* Nicer error message on has_many :through when :through reflection can not be found. #4042 [court3nay@gmail.com]
-
-* Upgrade to Transaction::Simple 1.3 [Jamis Buck]
-
-* Catch FixtureClassNotFound when using instantiated fixtures on a fixture that has no ActiveRecord model [Rick Olson]
-
-* Allow ordering of calculated results and/or grouped fields in calculations [solo@gatelys.com]
-
-* Make ActiveRecord::Base#save! return true instead of nil on success. #4173 [johan@johansorensen.com]
-
-* Dynamically set allow_concurrency. #4044 [Stefan Kaes]
-
-* Added Base#to_xml that'll turn the current record into a XML representation [DHH]. Example:
-
- topic.to_xml
-
- ...returns:
-
-
-
- The First Topic
- David
- 1
- false
- 0
- 2000-01-01 08:28:00
- 2003-07-16 09:28:00
- Have a nice day
- david@loudthinking.com
-
- 2004-04-15
-
-
- ...and you can configure with:
-
- topic.to_xml(:skip_instruct => true, :except => [ :id, bonus_time, :written_on, replies_count ])
-
- ...that'll return:
-
-
- The First Topic
- David
- false
- Have a nice day
- david@loudthinking.com
-
- 2004-04-15
-
-
- You can even do load first-level associations as part of the document:
-
- firm.to_xml :include => [ :account, :clients ]
-
- ...that'll return something like:
-
-
-
- 1
- 1
- 37signals
-
-
- 1
- Summit
-
-
- 1
- Microsoft
-
-
-
- 1
- 50
-
-
-
-* Allow :counter_cache to take a column name for custom counter cache columns [Jamis Buck]
-
-* Documentation fixes for :dependent [robby@planetargon.com]
-
-* Stop the MySQL adapter crashing when views are present. #3782 [Jonathan Viney]
-
-* Don't classify the belongs_to class, it is already singular #4117 [keithm@infused.org]
-
-* Allow set_fixture_class to take Classes instead of strings for a class in a module. Raise FixtureClassNotFound if a fixture can't load. [Rick Olson]
-
-* Fix quoting of inheritance column for STI eager loading #4098 [Jonathan Viney ]
-
-* Added smarter table aliasing for eager associations for multiple self joins #3580 [Rick Olson]
-
- * The first time a table is referenced in a join, no alias is used.
- * After that, the parent class name and the reflection name are used.
-
- Tree.find(:all, :include => :children) # LEFT OUTER JOIN trees AS tree_children ...
-
- * Any additional join references get a numerical suffix like '_2', '_3', etc.
-
-* Fixed eager loading problems with single-table inheritance #3580 [Rick Olson]. Post.find(:all, :include => :special_comments) now returns all posts, and any special comments that the posts may have. And made STI work with has_many :through and polymorphic belongs_to.
-
-* Added cascading eager loading that allows for queries like Author.find(:all, :include=> { :posts=> :comments }), which will fetch all authors, their posts, and the comments belonging to those posts in a single query (using LEFT OUTER JOIN) #3913 [anna@wota.jp]. Examples:
-
- # cascaded in two levels
- >> Author.find(:all, :include=>{:posts=>:comments})
- => authors
- +- posts
- +- comments
-
- # cascaded in two levels and normal association
- >> Author.find(:all, :include=>[{:posts=>:comments}, :categorizations])
- => authors
- +- posts
- +- comments
- +- categorizations
-
- # cascaded in two levels with two has_many associations
- >> Author.find(:all, :include=>{:posts=>[:comments, :categorizations]})
- => authors
- +- posts
- +- comments
- +- categorizations
-
- # cascaded in three levels
- >> Company.find(:all, :include=>{:groups=>{:members=>{:favorites}}})
- => companies
- +- groups
- +- members
- +- favorites
-
-* Make counter cache work when replacing an association #3245 [eugenol@gmail.com]
-
-* Make migrations verbose [Jamis Buck]
-
-* Make counter_cache work with polymorphic belongs_to [Jamis Buck]
-
-* Fixed that calling HasOneProxy#build_model repeatedly would cause saving to happen #4058 [anna@wota.jp]
-
-* Added Sybase database adapter that relies on the Sybase Open Client bindings (see http://raa.ruby-lang.org/project/sybase-ctlib) #3765 [John Sheets]. It's almost completely Active Record compliant (including migrations), but has the following caveats:
-
- * Does not support DATE SQL column types; use DATETIME instead.
- * Date columns on HABTM join tables are returned as String, not Time.
- * Insertions are potentially broken for :polymorphic join tables
- * BLOB column access not yet fully supported
-
-* Clear stale, cached connections left behind by defunct threads. [Jeremy Kemper]
-
-* CHANGED DEFAULT: set ActiveRecord::Base.allow_concurrency to false. Most AR usage is in single-threaded applications. [Jeremy Kemper]
-
-* Renamed the "oci" adapter to "oracle", but kept the old name as an alias #4017 [schoenm@earthlink.net]
-
-* Fixed that Base.save should always return false if the save didn't succeed, including if it has halted by before_save's #1861, #2477 [DHH]
-
-* Speed up class -> connection caching and stale connection verification. #3979 [Stefan Kaes]
-
-* Add set_fixture_class to allow the use of table name accessors with models which use set_table_name. [Kevin Clark]
-
-* Added that fixtures to placed in subdirectories of the main fixture files are also loaded #3937 [dblack@wobblini.net]
-
-* Define attribute query methods to avoid method_missing calls. #3677 [jonathan@bluewire.net.nz]
-
-* ActiveRecord::Base.remove_connection explicitly closes database connections and doesn't corrupt the connection cache. Introducing the disconnect! instance method for the PostgreSQL, MySQL, and SQL Server adapters; implementations for the others are welcome. #3591 [Simon Stapleton, Tom Ward]
-
-* Added support for nested scopes #3407 [anna@wota.jp]. Examples:
-
- Developer.with_scope(:find => { :conditions => "salary > 10000", :limit => 10 }) do
- Developer.find(:all) # => SELECT * FROM developers WHERE (salary > 10000) LIMIT 10
-
- # inner rule is used. (all previous parameters are ignored)
- Developer.with_exclusive_scope(:find => { :conditions => "name = 'Jamis'" }) do
- Developer.find(:all) # => SELECT * FROM developers WHERE (name = 'Jamis')
- end
-
- # parameters are merged
- Developer.with_scope(:find => { :conditions => "name = 'Jamis'" }) do
- Developer.find(:all) # => SELECT * FROM developers WHERE (( salary > 10000 ) AND ( name = 'Jamis' )) LIMIT 10
- end
- end
-
-* Fixed db2 connection with empty user_name and auth options #3622 [phurley@gmail.com]
-
-* Fixed validates_length_of to work on UTF-8 strings by using characters instead of bytes #3699 [Masao Mutoh]
-
-* Fixed that reflections would bleed across class boundaries in single-table inheritance setups #3796 [lars@pind.com]
-
-* Added calculations: Base.count, Base.average, Base.sum, Base.minimum, Base.maxmium, and the generic Base.calculate. All can be used with :group and :having. Calculations and statitics need no longer require custom SQL. #3958 [Rick Olson]. Examples:
-
- Person.average :age
- Person.minimum :age
- Person.maximum :age
- Person.sum :salary, :group => :last_name
-
-* Renamed Errors#count to Errors#size but kept an alias for the old name (and included an alias for length too) #3920 [contact@lukeredpath.co.uk]
-
-* Reflections don't attempt to resolve module nesting of association classes. Simplify type computation. [Jeremy Kemper]
-
-* Improved the Oracle OCI Adapter with better performance for column reflection (from #3210), fixes to migrations (from #3476 and #3742), tweaks to unit tests (from #3610), and improved documentation (from #2446) #3879 [Aggregated by schoenm@earthlink.net]
-
-* Fixed that the schema_info table used by ActiveRecord::Schema.define should respect table pre- and suffixes #3834 [rubyonrails@atyp.de]
-
-* Added :select option to Base.count that'll allow you to select something else than * to be counted on. Especially important for count queries using DISTINCT #3839 [skaes]
-
-* Correct syntax error in mysql DDL, and make AAACreateTablesTest run first [Bob Silva]
-
-* Allow :include to be used with has_many :through associations #3611 [Michael Schoen]
-
-* PostgreSQL: smarter schema dumps using pk_and_sequence_for(table). #2920 [Blair Zajac]
-
-* SQLServer: more compatible limit/offset emulation. #3779 [Tom Ward]
-
-* Polymorphic join support for has_one associations (has_one :foo, :as => :bar) #3785 [Rick Olson]
-
-* PostgreSQL: correctly parse negative integer column defaults. #3776 [bellis@deepthought.org]
-
-* Fix problems with count when used with :include [Jeremy Hopple and Kevin Clark]
-
-* ActiveRecord::RecordInvalid now states which validations failed in its default error message [Tobias Luetke]
-
-* Using AssociationCollection#build with arrays of hashes should call build, not create [DHH]
-
-* Remove definition of reloadable? from ActiveRecord::Base to make way for new Reloadable code. [Nicholas Seckar]
-
-* Fixed schema handling for DB2 adapter that didn't work: an initial schema could be set, but it wasn't used when getting tables and indexes #3678 [Maik Schmidt]
-
-* Support the :column option for remove_index with the PostgreSQL adapter. #3661 [shugo@ruby-lang.org]
-
-* Add documentation for add_index and remove_index. #3600 [Manfred Stienstra ]
-
-* If the OCI library is not available, raise an exception indicating as much. #3593 [schoenm@earthlink.net]
-
-* Add explicit :order in finder tests as postgresql orders results differently by default. #3577. [Rick Olson]
-
-* Make dynamic finders honor additional passed in :conditions. #3569 [Oleg Pudeyev , Marcel Molina Jr.]
-
-* Show a meaningful error when the DB2 adapter cannot be loaded due to missing dependencies. [Nicholas Seckar]
-
-* Make .count work for has_many associations with multi line finder sql [schoenm@earthlink.net]
-
-* Add AR::Base.base_class for querying the ancestor AR::Base subclass [Jamis Buck]
-
-* Allow configuration of the column used for optimistic locking [wilsonb@gmail.com]
-
-* Don't hardcode 'id' in acts as list. [ror@philippeapril.com]
-
-* Fix date errors for SQLServer in association tests. #3406 [kevin.clark@gmal.com]
-
-* Escape database name in MySQL adapter when creating and dropping databases. #3409 [anna@wota.jp]
-
-* Disambiguate table names for columns in validates_uniquness_of's WHERE clause. #3423 [alex.borovsky@gmail.com]
-
-* .with_scope imposed create parameters now bypass attr_protected [Tobias Luetke]
-
-* Don't raise an exception when there are more keys than there are named bind variables when sanitizing conditions. [Marcel Molina Jr.]
-
-* Multiple enhancements and adjustments to DB2 adaptor. #3377 [contact@maik-schmidt.de]
-
-* Sanitize scoped conditions. [Marcel Molina Jr.]
-
-* Added option to Base.reflection_of_all_associations to specify a specific association to scope the call. For example Base.reflection_of_all_associations(:has_many) [DHH]
-
-* Added ActiveRecord::SchemaDumper.ignore_tables which tells SchemaDumper which tables to ignore. Useful for tables with funky column like the ones required for tsearch2. [TobiasLuetke]
-
-* SchemaDumper now doesn't fail anymore when there are unknown column types in the schema. Instead the table is ignored and a Comment is left in the schema.rb. [TobiasLuetke]
-
-* Fixed that saving a model with multiple habtm associations would only save the first one. #3244 [yanowitz-rubyonrails@quantumfoam.org, Florian Weber]
-
-* Fix change_column to work with PostgreSQL 7.x and 8.x. #3141 [wejn@box.cz, Rick Olson, Scott Barron]
-
-* removed :piggyback in favor of just allowing :select on :through associations. [Tobias Luetke]
-
-* made method missing delegation to class methods on relation target work on :through associations. [Tobias Luetke]
-
-* made .find() work on :through relations. [Tobias Luetke]
-
-* Fix typo in association docs. #3296. [Blair Zajac]
-
-* Fixed :through relations when using STI inherited classes would use the inherited class's name as foreign key on the join model [Tobias Luetke]
-
-*1.13.2* (December 13th, 2005)
-
-* Become part of Rails 1.0
-
-* MySQL: allow encoding option for mysql.rb driver. [Jeremy Kemper]
-
-* Added option inheritance for find calls on has_and_belongs_to_many and has_many assosociations [DHH]. Example:
-
- class Post
- has_many :recent_comments, :class_name => "Comment", :limit => 10, :include => :author
- end
-
- post.recent_comments.find(:all) # Uses LIMIT 10 and includes authors
- post.recent_comments.find(:all, :limit => nil) # Uses no limit but include authors
- post.recent_comments.find(:all, :limit => nil, :include => nil) # Uses no limit and doesn't include authors
-
-* Added option to specify :group, :limit, :offset, and :select options from find on has_and_belongs_to_many and has_many assosociations [DHH]
-
-* MySQL: fixes for the bundled mysql.rb driver. #3160 [Justin Forder]
-
-* SQLServer: fix obscure optimistic locking bug. #3068 [kajism@yahoo.com]
-
-* SQLServer: support uniqueidentifier columns. #2930 [keithm@infused.org]
-
-* SQLServer: cope with tables names qualified by owner. #3067 [jeff@ministrycentered.com]
-
-* SQLServer: cope with columns with "desc" in the name. #1950 [Ron Lusk, Ryan Tomayko]
-
-* SQLServer: cope with primary keys with "select" in the name. #3057 [rdifrango@captechventures.com]
-
-* Oracle: active? performs a select instead of a commit. #3133 [Michael Schoen]
-
-* MySQL: more robust test for nullified result hashes. #3124 [Stefan Kaes]
-
-* Reloading an instance refreshes its aggregations as well as its associations. #3024 [François Beausoleil]
-
-* Fixed that using :include together with :conditions array in Base.find would cause NoMethodError #2887 [Paul Hammmond]
-
-* PostgreSQL: more robust sequence name discovery. #3087 [Rick Olson]
-
-* Oracle: use syntax compatible with Oracle 8. #3131 [Michael Schoen]
-
-* MySQL: work around ruby-mysql/mysql-ruby inconsistency with mysql.stat. Eliminate usage of mysql.ping because it doesn't guarantee reconnect. Explicitly close and reopen the connection instead. [Jeremy Kemper]
-
-* Added preliminary support for polymorphic associations [DHH]
-
-* Added preliminary support for join models [DHH]
-
-* Allow validate_uniqueness_of to be scoped by more than just one column. #1559. [jeremy@jthopple.com, Marcel Molina Jr.]
-
-* Firebird: active? and reconnect! methods for handling stale connections. #428 [Ken Kunz ]
-
-* Firebird: updated for FireRuby 0.4.0. #3009 [Ken Kunz ]
-
-* MySQL and PostgreSQL: active? compatibility with the pure-Ruby driver. #428 [Jeremy Kemper]
-
-* Oracle: active? check pings the database rather than testing the last command status. #428 [Michael Schoen]
-
-* SQLServer: resolve column aliasing/quoting collision when using limit or offset in an eager find. #2974 [kajism@yahoo.com]
-
-* Reloading a model doesn't lose track of its connection. #2996 [junk@miriamtech.com, Jeremy Kemper]
-
-* Fixed bug where using update_attribute after pushing a record to a habtm association of the object caused duplicate rows in the join table. #2888 [colman@rominato.com, Florian Weber, Michael Schoen]
-
-* MySQL, PostgreSQL: reconnect! also reconfigures the connection. Otherwise, the connection 'loses' its settings if it times out and is reconnected. #2978 [Shugo Maeda]
-
-* has_and_belongs_to_many: use JOIN instead of LEFT JOIN. [Jeremy Kemper]
-
-* MySQL: introduce :encoding option to specify the character set for client, connection, and results. Only available for MySQL 4.1 and later with the mysql-ruby driver. Do SHOW CHARACTER SET in mysql client to see available encodings. #2975 [Shugo Maeda]
-
-* Add tasks to create, drop and rebuild the MySQL and PostgreSQL test databases. [Marcel Molina Jr.]
-
-* Correct boolean handling in generated reader methods. #2945 [don.park@gmail.com, Stefan Kaes]
-
-* Don't generate read methods for columns whose names are not valid ruby method names. #2946 [Stefan Kaes]
-
-* Document :force option to create_table. #2921 [Blair Zajac ]
-
-* Don't add the same conditions twice in has_one finder sql. #2916 [Jeremy Evans]
-
-* Rename Version constant to VERSION. #2802 [Marcel Molina Jr.]
-
-* Introducing the Firebird adapter. Quote columns and use attribute_condition more consistently. Setup guide: http://wiki.rubyonrails.com/rails/pages/Firebird+Adapter #1874 [Ken Kunz ]
-
-* SQLServer: active? and reconnect! methods for handling stale connections. #428 [kajism@yahoo.com, Tom Ward ]
-
-* Associations handle case-equality more consistently: item.parts.is_a?(Array) and item.parts === Array. #1345 [MarkusQ@reality.com]
-
-* SQLServer: insert uses given primary key value if not nil rather than SELECT @@IDENTITY. #2866 [kajism@yahoo.com, Tom Ward ]
-
-* Oracle: active? and reconnect! methods for handling stale connections. Optionally retry queries after reconnect. #428 [Michael Schoen ]
-
-* Correct documentation for Base.delete_all. #1568 [Newhydra]
-
-* Oracle: test case for column default parsing. #2788 [Michael Schoen ]
-
-* Update documentation for Migrations. #2861 [Tom Werner ]
-
-* When AbstractAdapter#log rescues an exception, attempt to detect and reconnect to an inactive database connection. Connection adapter must respond to the active? and reconnect! instance methods. Initial support for PostgreSQL, MySQL, and SQLite. Make certain that all statements which may need reconnection are performed within a logged block: for example, this means no avoiding log(sql, name) { } if @logger.nil? #428 [Jeremy Kemper]
-
-* Oracle: Much faster column reflection. #2848 [Michael Schoen ]
-
-* Base.reset_sequence_name analogous to reset_table_name (mostly useful for testing). Base.define_attr_method allows nil values. [Jeremy Kemper]
-
-* PostgreSQL: smarter sequence name defaults, stricter last_insert_id, warn on pk without sequence. [Jeremy Kemper]
-
-* PostgreSQL: correctly discover custom primary key sequences. #2594 [Blair Zajac , meadow.nnick@gmail.com, Jeremy Kemper]
-
-* SQLServer: don't report limits for unsupported field types. #2835 [Ryan Tomayko]
-
-* Include the Enumerable module in ActiveRecord::Errors. [Rick Bradley ]
-
-* Add :group option, correspond to GROUP BY, to the find method and to the has_many association. #2818 [rubyonrails@atyp.de]
-
-* Don't cast nil or empty strings to a dummy date. #2789 [Rick Bradley ]
-
-* acts_as_list plays nicely with inheritance by remembering the class which declared it. #2811 [rephorm@rephorm.com]
-
-* Fix sqlite adaptor's detection of missing dbfile or database declaration. [Nicholas Seckar]
-
-* Fixed acts_as_list for definitions without an explicit :order #2803 [jonathan@bluewire.net.nz]
-
-* Upgrade bundled ruby-mysql 0.2.4 with mysql411 shim (see #440) to ruby-mysql 0.2.6 with a patchset for 4.1 protocol support. Local change [301] is now a part of the main driver; reapplied local change [2182]. Removed GC.start from Result.free. [tommy@tmtm.org, akuroda@gmail.com, Doug Fales , Jeremy Kemper]
-
-* Correct handling of complex order clauses with SQL Server limit emulation. #2770 [Tom Ward , Matt B.]
-
-* Correct whitespace problem in Oracle default column value parsing. #2788 [rick@rickbradley.com]
-
-* Destroy associated has_and_belongs_to_many records after all before_destroy callbacks but before destroy. This allows you to act on the habtm association as you please while preserving referential integrity. #2065 [larrywilliams1@gmail.com, sam.kirchmeier@gmail.com, elliot@townx.org, Jeremy Kemper]
-
-* Deprecate the old, confusing :exclusively_dependent option in favor of :dependent => :delete_all. [Jeremy Kemper]
-
-* More compatible Oracle column reflection. #2771 [Ryan Davis , Michael Schoen ]
-
-
-*1.13.0* (November 7th, 2005)
-
-* Fixed faulty regex in get_table_name method (SQLServerAdapter) #2639 [Ryan Tomayko]
-
-* Added :include as an option for association declarations [DHH]. Example:
-
- has_many :posts, :include => [ :author, :comments ]
-
-* Rename Base.constrain to Base.with_scope so it doesn't conflict with existing concept of database constraints. Make scoping more robust: uniform method => parameters, validated method names and supported finder parameters, raise exception on nested scopes. [Jeremy Kemper] Example:
-
- Comment.with_scope(:find => { :conditions => 'active=true' }, :create => { :post_id => 5 }) do
- # Find where name = ? and active=true
- Comment.find :all, :conditions => ['name = ?', name]
- # Create comment associated with :post_id
- Comment.create :body => "Hello world"
- end
-
-* Fixed that SQL Server should ignore :size declarations on anything but integer and string in the agnostic schema representation #2756 [Ryan Tomayko]
-
-* Added constrain scoping for creates using a hash of attributes bound to the :creation key [DHH]. Example:
-
- Comment.constrain(:creation => { :post_id => 5 }) do
- # Associated with :post_id
- Comment.create :body => "Hello world"
- end
-
- This is rarely used directly, but allows for find_or_create on associations. So you can do:
-
- # If the tag doesn't exist, a new one is created that's associated with the person
- person.tags.find_or_create_by_name("Summer")
-
-* Added find_or_create_by_X as a second type of dynamic finder that'll create the record if it doesn't already exist [DHH]. Example:
-
- # No 'Summer' tag exists
- Tag.find_or_create_by_name("Summer") # equal to Tag.create(:name => "Summer")
-
- # Now the 'Summer' tag does exist
- Tag.find_or_create_by_name("Summer") # equal to Tag.find_by_name("Summer")
-
-* Added extension capabilities to has_many and has_and_belongs_to_many proxies [DHH]. Example:
-
- class Account < ActiveRecord::Base
- has_many :people do
- def find_or_create_by_name(name)
- first_name, *last_name = name.split
- last_name = last_name.join " "
-
- find_or_create_by_first_name_and_last_name(first_name, last_name)
- end
- end
- end
-
- person = Account.find(:first).people.find_or_create_by_name("David Heinemeier Hansson")
- person.first_name # => "David"
- person.last_name # => "Heinemeier Hansson"
-
- Note that the anoymous module must be declared using brackets, not do/end (due to order of evaluation).
-
-* Omit internal dtproperties table from SQLServer table list. #2729 [rtomayko@gmail.com]
-
-* Quote column names in generated SQL. #2728 [rtomayko@gmail.com]
-
-* Correct the pure-Ruby MySQL 4.1.1 shim's version test. #2718 [Jeremy Kemper]
-
-* Add Model.create! to match existing model.save! method. When save! raises RecordInvalid, you can catch the exception, retrieve the invalid record (invalid_exception.record), and see its errors (invalid_exception.record.errors). [Jeremy Kemper]
-
-* Correct fixture behavior when table name pluralization is off. #2719 [Rick Bradley ]
-
-* Changed :dbfile to :database for SQLite adapter for consistency (old key still works as an alias) #2644 [Dan Peterson]
-
-* Added migration support for Oracle #2647 [Michael Schoen]
-
-* Worked around that connection can't be reset if allow_concurrency is off. #2648 [Michael Schoen ]
-
-* Fixed SQL Server adapter to pass even more tests and do even better #2634 [rtomayko@gmail.com]
-
-* Fixed SQL Server adapter so it honors options[:conditions] when applying :limits #1978 [Tom Ward]
-
-* Added migration support to SQL Server adapter (please someone do the same for Oracle and DB2) #2625 [Tom Ward]
-
-* Use AR::Base.silence rather than AR::Base.logger.silence in fixtures to preserve Log4r compatibility. #2618 [dansketcher@gmail.com]
-
-* Constraints are cloned so they can't be inadvertently modified while they're
-in effect. Added :readonly finder constraint. Calling an association collection's class method (Part.foobar via item.parts.foobar) constrains :readonly => false since the collection's :joins constraint would otherwise force it to true. [Jeremy Kemper ]
-
-* Added :offset and :limit to the kinds of options that Base.constrain can use #2466 [duane.johnson@gmail.com]
-
-* Fixed handling of nil number columns on Oracle and cleaned up tests for Oracle in general #2555 [schoenm@earthlink.net]
-
-* Added quoted_true and quoted_false methods and tables to db2_adapter and cleaned up tests for DB2 #2493, #2624 [maik schmidt]
-
-
-*1.12.2* (October 26th, 2005)
-
-* Allow symbols to rename columns when using SQLite adapter. #2531 [kevin.clark@gmail.com]
-
-* Map Active Record time to SQL TIME. #2575, #2576 [Robby Russell ]
-
-* Clarify semantics of ActiveRecord::Base#respond_to? #2560 [skaes@web.de]
-
-* Fixed Association#clear for associations which have not yet been accessed. #2524 [Patrick Lenz ]
-
-* HABTM finders shouldn't return readonly records. #2525 [Patrick Lenz ]
-
-* Make all tests runnable on their own. #2521. [Blair Zajac ]
-
-
-*1.12.1* (October 19th, 2005)
-
-* Always parenthesize :conditions options so they may be safely combined with STI and constraints.
-
-* Correct PostgreSQL primary key sequence detection. #2507 [tmornini@infomania.com]
-
-* Added support for using limits in eager loads that involve has_many and has_and_belongs_to_many associations
-
-
-*1.12.0* (October 16th, 2005)
-
-* Update/clean up documentation (rdoc)
-
-* PostgreSQL sequence support. Use set_sequence_name in your model class to specify its primary key sequence. #2292 [Rick Olson , Robby Russell ]
-
-* Change default logging colors to work on both white and black backgrounds. [Sam Stephenson]
-
-* YAML fixtures support ordered hashes for fixtures with foreign key dependencies in the same table. #1896 [purestorm@ggnore.net]
-
-* :dependent now accepts :nullify option. Sets the foreign key of the related objects to NULL instead of deleting them. #2015 [Robby Russell ]
-
-* Introduce read-only records. If you call object.readonly! then it will mark the object as read-only and raise ReadOnlyRecord if you call object.save. object.readonly? reports whether the object is read-only. Passing :readonly => true to any finder method will mark returned records as read-only. The :joins option now implies :readonly, so if you use this option, saving the same record will now fail. Use find_by_sql to work around.
-
-* Avoid memleak in dev mode when using fcgi
-
-* Simplified .clear on active record associations by using the existing delete_records method. #1906 [Caleb ]
-
-* Delegate access to a customized primary key to the conventional id method. #2444. [Blair Zajac ]
-
-* Fix errors caused by assigning a has-one or belongs-to property to itself
-
-* Add ActiveRecord::Base.schema_format setting which specifies how databases should be dumped [Sam Stephenson]
-
-* Update DB2 adapter. #2206. [contact@maik-schmidt.de]
-
-* Corrections to SQLServer native data types. #2267. [rails.20.clarry@spamgourmet.com]
-
-* Deprecated ActiveRecord::Base.threaded_connection in favor of ActiveRecord::Base.allow_concurrency.
-
-* Protect id attribute from mass assigment even when the primary key is set to something else. #2438. [Blair Zajac ]
-
-* Misc doc fixes (typos/grammar/etc.). #2430. [coffee2code]
-
-* Add test coverage for content_columns. #2432. [coffee2code]
-
-* Speed up for unthreaded environments. #2431. [skaes@web.de]
-
-* Optimization for Mysql selects using mysql-ruby extension greater than 2.6.3. #2426. [skaes@web.de]
-
-* Speed up the setting of table_name. #2428. [skaes@web.de]
-
-* Optimize instantiation of STI subclass records. In partial fullfilment of #1236. [skaes@web.de]
-
-* Fix typo of 'constrains' to 'contraints'. #2069. [Michael Schuerig ]
-
-* Optimization refactoring for add_limit_offset!. In partial fullfilment of #1236. [skaes@web.de]
-
-* Add ability to get all siblings, including the current child, with acts_as_tree. Recloses #2140. [Michael Schuerig ]
-
-* Add geometric type for postgresql adapter. #2233 [akaspick@gmail.com]
-
-* Add option (true by default) to generate reader methods for each attribute of a record to avoid the overhead of calling method missing. In partial fullfilment of #1236. [skaes@web.de]
-
-* Add convenience predicate methods on Column class. In partial fullfilment of #1236. [skaes@web.de]
-
-* Raise errors when invalid hash keys are passed to ActiveRecord::Base.find. #2363 [Chad Fowler , Nicholas Seckar]
-
-* Added :force option to create_table that'll try to drop the table if it already exists before creating
-
-* Fix transactions so that calling return while inside a transaction will not leave an open transaction on the connection. [Nicholas Seckar]
-
-* Use foreign_key inflection uniformly. #2156 [Blair Zajac ]
-
-* model.association.clear should destroy associated objects if :dependent => true instead of nullifying their foreign keys. #2221 [joergd@pobox.com, ObieFernandez ]
-
-* Returning false from before_destroy should cancel the action. #1829 [Jeremy Huffman]
-
-* Recognize PostgreSQL NOW() default as equivalent to CURRENT_TIMESTAMP or CURRENT_DATE, depending on the column's type. #2256 [mat ]
-
-* Extensive documentation for the abstract database adapter. #2250 [François Beausoleil ]
-
-* Clean up Fixtures.reset_sequences for PostgreSQL. Handle tables with no rows and models with custom primary keys. #2174, #2183 [jay@jay.fm, Blair Zajac ]
-
-* Improve error message when nil is assigned to an attr which validates_size_of within a range. #2022 [Manuel Holtgrewe ]
-
-* Make update_attribute use the same writer method that update_attributes uses.
- #2237 [trevor@protocool.com]
-
-* Make migrations honor table name prefixes and suffixes. #2298 [Jakob S, Marcel Molina]
-
-* Correct and optimize PostgreSQL bytea escaping. #1745, #1837 [dave@cherryville.org, ken@miriamtech.com, bellis@deepthought.org]
-
-* Fixtures should only reset a PostgreSQL sequence if it corresponds to an integer primary key named id. #1749 [chris@chrisbrinker.com]
-
-* Standardize the interpretation of boolean columns in the Mysql and Sqlite adapters. (Use MysqlAdapter.emulate_booleans = false to disable this behavior)
-
-* Added new symbol-driven approach to activating observers with Base#observers= [DHH]. Example:
-
- ActiveRecord::Base.observers = :cacher, :garbage_collector
-
-* Added AbstractAdapter#select_value and AbstractAdapter#select_values as convenience methods for selecting single values, instead of hashes, of the first column in a SELECT #2283 [solo@gatelys.com]
-
-* Wrap :conditions in parentheses to prevent problems with OR's #1871 [Jamis Buck]
-
-* Allow the postgresql adapter to work with the SchemaDumper. [Jamis Buck]
-
-* Add ActiveRecord::SchemaDumper for dumping a DB schema to a pure-ruby file, making it easier to consolidate large migration lists and port database schemas between databases. [Jamis Buck]
-
-* Fixed migrations for Windows when using more than 10 [David Naseby]
-
-* Fixed that the create_x method from belongs_to wouldn't save the association properly #2042 [Florian Weber]
-
-* Fixed saving a record with two unsaved belongs_to associations pointing to the same object #2023 [Tobias Luetke]
-
-* Improved migrations' behavior when the schema_info table is empty. [Nicholas Seckar]
-
-* Fixed that Observers didn't observe sub-classes #627 [Florian Weber]
-
-* Fix eager loading error messages, allow :include to specify tables using strings or symbols. Closes #2222 [Marcel Molina]
-
-* Added check for RAILS_CONNECTION_ADAPTERS on startup and only load the connection adapters specified within if its present (available in Rails through config.connection_adapters using the new config) #1958 [skae]
-
-* Fixed various problems with has_and_belongs_to_many when using customer finder_sql #2094 [Florian Weber]
-
-* Added better exception error when unknown column types are used with migrations #1814 [fbeausoleil@ftml.net]
-
-* Fixed "connection lost" issue with the bundled Ruby/MySQL driver (would kill the app after 8 hours of inactivity) #2163, #428 [kajism@yahoo.com]
-
-* Fixed comparison of Active Record objects so two new objects are not equal #2099 [deberg]
-
-* Fixed that the SQL Server adapter would sometimes return DBI::Timestamp objects instead of Time #2127 [Tom Ward]
-
-* Added the instance methods #root and #ancestors on acts_as_tree and fixed siblings to not include the current node #2142, #2140 [coffee2code]
-
-* Fixed that Active Record would call SHOW FIELDS twice (or more) for the same model when the cached results were available #1947 [sd@notso.net]
-
-* Added log_level and use_silence parameter to ActiveRecord::Base.benchmark. The first controls at what level the benchmark statement will be logged (now as debug, instead of info) and the second that can be passed false to include all logging statements during the benchmark block/
-
-* Make sure the schema_info table is created before querying the current version #1903
-
-* Fixtures ignore table name prefix and suffix #1987 [Jakob S]
-
-* Add documentation for index_type argument to add_index method for migrations #2005 [blaine@odeo.com]
-
-* Modify read_attribute to allow a symbol argument #2024 [Ken Kunz]
-
-* Make destroy return self #1913 [sebastian.kanthak@muehlheim.de]
-
-* Fix typo in validations documentation #1938 [court3nay]
-
-* Make acts_as_list work for insert_at(1) #1966 [hensleyl@papermountain.org]
-
-* Fix typo in count_by_sql documentation #1969 [Alexey Verkhovsky]
-
-* Allow add_column and create_table to specify NOT NULL #1712 [emptysands@gmail.com]
-
-* Fix create_table so that id column is implicitly added [Rick Olson]
-
-* Default sequence names for Oracle changed to #{table_name}_seq, which is the most commonly used standard. In addition, a new method ActiveRecord::Base#set_sequence_name allows the developer to set the sequence name per model. This is a non-backwards-compatible change -- anyone using the old-style "rails_sequence" will need to either create new sequences, or set: ActiveRecord::Base.set_sequence_name = "rails_sequence" #1798
-
-* OCIAdapter now properly handles synonyms, which are commonly used to separate out the schema owner from the application user #1798
-
-* Fixed the handling of camelCase columns names in Oracle #1798
-
-* Implemented for OCI the Rakefile tasks of :clone_structure_to_test, :db_structure_dump, and :purge_test_database, which enable Oracle folks to enjoy all the agile goodness of Rails for testing. Note that the current implementation is fairly limited -- only tables and sequences are cloned, not constraints or indexes. A full clone in Oracle generally requires some manual effort, and is version-specific. Post 9i, Oracle recommends the use of the DBMS_METADATA package, though that approach requires editing of the physical characteristics generated #1798
-
-* Fixed the handling of multiple blob columns in Oracle if one or more of them are null #1798
-
-* Added support for calling constrained class methods on has_many and has_and_belongs_to_many collections #1764 [Tobias Luetke]
-
- class Comment < AR:B
- def self.search(q)
- find(:all, :conditions => ["body = ?", q])
- end
- end
-
- class Post < AR:B
- has_many :comments
- end
-
- Post.find(1).comments.search('hi') # => SELECT * from comments WHERE post_id = 1 AND body = 'hi'
-
- NOTICE: This patch changes the underlying SQL generated by has_and_belongs_to_many queries. If your relying on that, such as
- by explicitly referencing the old t and j aliases, you'll need to update your code. Of course, you _shouldn't_ be relying on
- details like that no less than you should be diving in to touch private variables. But just in case you do, consider yourself
- noticed :)
-
-* Added migration support for SQLite (using temporary tables to simulate ALTER TABLE) #1771 [Sam Stephenson]
-
-* Remove extra definition of supports_migrations? from abstract_adaptor.rb [Nicholas Seckar]
-
-* Fix acts_as_list so that moving next-to-last item to the bottom does not result in duplicate item positions
-
-* Fixed incompatibility in DB2 adapter with the new limit/offset approach #1718 [Maik Schmidt]
-
-* Added :select option to find which can specify a different value than the default *, like find(:all, :select => "first_name, last_name"), if you either only want to select part of the columns or exclude columns otherwise included from a join #1338 [Stefan Kaes]
-
-
-*1.11.1* (11 July, 2005)
-
-* Added support for limit and offset with eager loading of has_one and belongs_to associations. Using the options with has_many and has_and_belongs_to_many associations will now raise an ActiveRecord::ConfigurationError #1692 [Rick Olsen]
-
-* Fixed that assume_bottom_position (in acts_as_list) could be called on items already last in the list and they would move one position away from the list #1648 [tyler@kianta.com]
-
-* Added ActiveRecord::Base.threaded_connections flag to turn off 1-connection per thread (required for thread safety). By default it's on, but WEBrick in Rails need it off #1685 [Sam Stephenson]
-
-* Correct reflected table name for singular associations. #1688 [court3nay@gmail.com]
-
-* Fixed optimistic locking with SQL Server #1660 [tom@popdog.net]
-
-* Added ActiveRecord::Migrator.migrate that can figure out whether to go up or down based on the target version and the current
-
-* Added better error message for "packets out of order" #1630 [courtenay]
-
-* Fixed first run of "rake migrate" on PostgreSQL by not expecting a return value on the id #1640
-
-
-*1.11.0* (6 July, 2005)
-
-* Fixed that Yaml error message in fixtures hid the real error #1623 [Nicholas Seckar]
-
-* Changed logging of SQL statements to use the DEBUG level instead of INFO
-
-* Added new Migrations framework for describing schema transformations in a way that can be easily applied across multiple databases #1604 [Tobias Luetke] See documentation under ActiveRecord::Migration and the additional support in the Rails rakefile/generator.
-
-* Added callback hooks to association collections #1549 [Florian Weber]. Example:
-
- class Project
- has_and_belongs_to_many :developers, :before_add => :evaluate_velocity
-
- def evaluate_velocity(developer)
- ...
- end
- end
-
- ..raising an exception will cause the object not to be added (or removed, with before_remove).
-
-
-* Fixed Base.content_columns call for SQL Server adapter #1450 [DeLynn Berry]
-
-* Fixed Base#write_attribute to work with both symbols and strings #1190 [Paul Legato]
-
-* Fixed that has_and_belongs_to_many didn't respect single table inheritance types #1081 [Florian Weber]
-
-* Speed up ActiveRecord#method_missing for the common case (read_attribute).
-
-* Only notify observers on after_find and after_initialize if these methods are defined on the model. #1235 [skaes@web.de]
-
-* Fixed that single-table inheritance sub-classes couldn't be used to limit the result set with eager loading #1215 [Chris McGrath]
-
-* Fixed validates_numericality_of to work with overrided getter-method when :allow_nil is on #1316 [raidel@onemail.at]
-
-* Added roots, root, and siblings to the batch of methods added by acts_as_tree #1541 [michael@schuerig.de]
-
-* Added support for limit/offset with the MS SQL Server driver so that pagination will now work #1569 [DeLynn Berry]
-
-* Added support for ODBC connections to MS SQL Server so you can connect from a non-Windows machine #1569 [Mark Imbriaco/DeLynn Berry]
-
-* Fixed that multiparameter posts ignored attr_protected #1532 [alec+rails@veryclever.net]
-
-* Fixed problem with eager loading when using a has_and_belongs_to_many association using :association_foreign_key #1504 [flash@vanklinkenbergsoftware.nl]
-
-* Fixed Base#find to honor the documentation on how :joins work and make them consistent with Base#count #1405 [pritchie@gmail.com]. What used to be:
-
- Developer.find :all, :joins => 'developers_projects', :conditions => 'id=developer_id AND project_id=1'
-
- ...should instead be:
-
- Developer.find(
- :all,
- :joins => 'LEFT JOIN developers_projects ON developers.id = developers_projects.developer_id',
- :conditions => 'project_id=1'
- )
-
-* Fixed that validations didn't respecting custom setting for too_short, too_long messages #1437 [Marcel Molina]
-
-* Fixed that clear_association_cache doesn't delete new associations on new records (so you can safely place new records in the session with Action Pack without having new associations wiped) #1494 [cluon]
-
-* Fixed that calling Model.find([]) returns [] and doesn't throw an exception #1379
-
-* Fixed that adding a record to a has_and_belongs_to collection would always save it -- now it only saves if its a new record #1203 [Alisdair McDiarmid]
-
-* Fixed saving of in-memory association structures to happen as a after_create/after_update callback instead of after_save -- that way you can add new associations in after_create/after_update callbacks without getting them saved twice
-
-* Allow any Enumerable, not just Array, to work as bind variables #1344 [Jeremy Kemper]
-
-* Added actual database-changing behavior to collection assigment for has_many and has_and_belongs_to_many #1425 [Sebastian Kanthak].
- Example:
-
- david.projects = [Project.find(1), Project.new("name" => "ActionWebSearch")]
- david.save
-
- If david.projects already contain the project with ID 1, this is left unchanged. Any other projects are dropped. And the new
- project is saved when david.save is called.
-
- Also included is a way to do assignments through IDs, which is perfect for checkbox updating, so you get to do:
-
- david.project_ids = [1, 5, 7]
-
-* Corrected typo in find SQL for has_and_belongs_to_many. #1312 [ben@bensinclair.com]
-
-* Fixed sanitized conditions for has_many finder method. #1281 [jackc@hylesanderson.com, pragdave, Tobias Luetke]
-
-* Comprehensive PostgreSQL schema support. Use the optional schema_search_path directive in database.yml to give a comma-separated list of schemas to search for your tables. This allows you, for example, to have tables in a shared schema without having to use a custom table name. See http://www.postgresql.org/docs/8.0/interactive/ddl-schemas.html to learn more. #827 [dave@cherryville.org]
-
-* Corrected @@configurations typo #1410 [david@ruppconsulting.com]
-
-* Return PostgreSQL columns in the order they were declared #1374 [perlguy@gmail.com]
-
-* Allow before/after update hooks to work on models using optimistic locking
-
-* Eager loading of dependent has_one associations won't delete the association #1212
-
-* Added a second parameter to the build and create method for has_one that controls whether the existing association should be replaced (which means nullifying its foreign key as well). By default this is true, but false can be passed to prevent it.
-
-* Using transactional fixtures now causes the data to be loaded only once.
-
-* Added fixture accessor methods that can be used when instantiated fixtures are disabled.
-
- fixtures :web_sites
-
- def test_something
- assert_equal "Ruby on Rails", web_sites(:rubyonrails).name
- end
-
-* Added DoubleRenderError exception that'll be raised if render* is called twice #518 [Nicholas Seckar]
-
-* Fixed exceptions occuring after render has been called #1096 [Nicholas Seckar]
-
-* CHANGED: validates_presence_of now uses Errors#add_on_blank, which will make " " fail the validation where it didn't before #1309
-
-* Added Errors#add_on_blank which works like Errors#add_on_empty, but uses Object#blank? instead
-
-* Added the :if option to all validations that can either use a block or a method pointer to determine whether the validation should be run or not. #1324 [Duane Johnson/jhosteny]. Examples:
-
- Conditional validations such as the following are made possible:
- validates_numericality_of :income, :if => :employed?
-
- Conditional validations can also solve the salted login generator problem:
- validates_confirmation_of :password, :if => :new_password?
-
- Using blocks:
- validates_presence_of :username, :if => Proc.new { |user| user.signup_step > 1 }
-
-* Fixed use of construct_finder_sql when using :join #1288 [dwlt@dwlt.net]
-
-* Fixed that :delete_sql in has_and_belongs_to_many associations couldn't access record properties #1299 [Rick Olson]
-
-* Fixed that clone would break when an aggregate had the same name as one of its attributes #1307 [Jeremy Kemper]
-
-* Changed that destroying an object will only freeze the attributes hash, which keeps the object from having attributes changed (as that wouldn't make sense), but allows for the querying of associations after it has been destroyed.
-
-* Changed the callbacks such that observers are notified before the in-object callbacks are triggered. Without this change, it wasn't possible to act on the whole object in something like a before_destroy observer without having the objects own callbacks (like deleting associations) called first.
-
-* Added option for passing an array to the find_all version of the dynamic finders and have it evaluated as an IN fragment. Example:
-
- # SELECT * FROM topics WHERE title IN ('First', 'Second')
- Topic.find_all_by_title(["First", "Second"])
-
-* Added compatibility with camelCase column names for dynamic finders #533 [Dee.Zsombor]
-
-* Fixed extraneous comma in count() function that made it not work with joins #1156 [jarkko/Dee.Zsombor]
-
-* Fixed incompatibility with Base#find with an array of ids that would fail when using eager loading #1186 [Alisdair McDiarmid]
-
-* Fixed that validate_length_of lost :on option when :within was specified #1195 [jhosteny@mac.com]
-
-* Added encoding and min_messages options for PostgreSQL #1205 [shugo]. Configuration example:
-
- development:
- adapter: postgresql
- database: rails_development
- host: localhost
- username: postgres
- password:
- encoding: UTF8
- min_messages: ERROR
-
-* Fixed acts_as_list where deleting an item that was removed from the list would ruin the positioning of other list items #1197 [Jamis Buck]
-
-* Added validates_exclusion_of as a negative of validates_inclusion_of
-
-* Optimized counting of has_many associations by setting the association to empty if the count is 0 so repeated calls doesn't trigger database calls
-
-
-*1.10.1* (20th April, 2005)
-
-* Fixed frivilous database queries being triggered with eager loading on empty associations and other things
-
-* Fixed order of loading in eager associations
-
-* Fixed stray comma when using eager loading and ordering together from has_many associations #1143
-
-
-*1.10.0* (19th April, 2005)
-
-* Added eager loading of associations as a way to solve the N+1 problem more gracefully without piggy-back queries. Example:
-
- for post in Post.find(:all, :limit => 100)
- puts "Post: " + post.title
- puts "Written by: " + post.author.name
- puts "Last comment on: " + post.comments.first.created_on
- end
-
- This used to generate 301 database queries if all 100 posts had both author and comments. It can now be written as:
-
- for post in Post.find(:all, :limit => 100, :include => [ :author, :comments ])
-
- ...and the number of database queries needed is now 1.
-
-* Added new unified Base.find API and deprecated the use of find_first and find_all. See the documentation for Base.find. Examples:
-
- Person.find(1, :conditions => "administrator = 1", :order => "created_on DESC")
- Person.find(1, 5, 6, :conditions => "administrator = 1", :order => "created_on DESC")
- Person.find(:first, :order => "created_on DESC", :offset => 5)
- Person.find(:all, :conditions => [ "category IN (?)", categories], :limit => 50)
- Person.find(:all, :offset => 10, :limit => 10)
-
-* Added acts_as_nested_set #1000 [wschenk]. Introduction:
-
- This acts provides Nested Set functionality. Nested Set is similiar to Tree, but with
- the added feature that you can select the children and all of it's descendants with
- a single query. A good use case for this is a threaded post system, where you want
- to display every reply to a comment without multiple selects.
-
-* Added Base.save! that attempts to save the record just like Base.save but will raise a RecordInvalid exception instead of returning false if the record is not valid [After much pestering from Dave Thomas]
-
-* Fixed PostgreSQL usage of fixtures with regards to public schemas and table names with dots #962 [gnuman1@gmail.com]
-
-* Fixed that fixtures were being deleted in the same order as inserts causing FK errors #890 [andrew.john.peters@gmail.com]
-
-* Fixed loading of fixtures in to be in the right order (or PostgreSQL would bark) #1047 [stephenh@chase3000.com]
-
-* Fixed page caching for non-vhost applications living underneath the root #1004 [Ben Schumacher]
-
-* Fixes a problem with the SQL Adapter which was resulting in IDENTITY_INSERT not being set to ON when it should be #1104 [adelle]
-
-* Added the option to specify the acceptance string in validates_acceptance_of #1106 [caleb@aei-tech.com]
-
-* Added insert_at(position) to acts_as_list #1083 [DeLynnB]
-
-* Removed the default order by id on has_and_belongs_to_many queries as it could kill performance on large sets (you can still specify by hand with :order)
-
-* Fixed that Base.silence should restore the old logger level when done, not just set it to DEBUG #1084 [yon@milliped.com]
-
-* Fixed boolean saving on Oracle #1093 [mparrish@pearware.org]
-
-* Moved build_association and create_association for has_one and belongs_to out of deprecation as they work when the association is nil unlike association.build and association.create, which require the association to be already in place #864
-
-* Added rollbacks of transactions if they're active as the dispatcher is killed gracefully (TERM signal) #1054 [Leon Bredt]
-
-* Added quoting of column names for fixtures #997 [jcfischer@gmail.com]
-
-* Fixed counter_sql when no records exist in database for PostgreSQL (would give error, not 0) #1039 [Caleb Tennis]
-
-* Fixed that benchmarking times for rendering included db runtimes #987 [skaes@web.de]
-
-* Fixed boolean queries for t/f fields in PostgreSQL #995 [dave@cherryville.org]
-
-* Added that model.items.delete(child) will delete the child, not just set the foreign key to nil, if the child is dependent on the model #978 [Jeremy Kemper]
-
-* Fixed auto-stamping of dates (created_on/updated_on) for PostgreSQL #985 [dave@cherryville.org]
-
-* Fixed Base.silence/benchmark to only log if a logger has been configured #986 [skaes@web.de]
-
-* Added a join parameter as the third argument to Base.find_first and as the second to Base.count #426, #988 [skaes@web.de]
-
-* Fixed bug in Base#hash method that would treat records with the same string-based id as different [Dave Thomas]
-
-* Renamed DateHelper#distance_of_time_in_words_to_now to DateHelper#time_ago_in_words (old method name is still available as a deprecated alias)
-
-
-*1.9.1* (27th March, 2005)
-
-* Fixed that Active Record objects with float attribute could not be cloned #808
-
-* Fixed that MissingSourceFile's wasn't properly detected in production mode #925 [Nicholas Seckar]
-
-* Fixed that :counter_cache option would look for a line_items_count column for a LineItem object instead of lineitems_count
-
-* Fixed that AR exists?() would explode on postgresql if the passed id did not match the PK type #900 [Scott Barron]
-
-* Fixed the MS SQL adapter to work with the new limit/offset approach and with binary data (still suffering from 7KB limit, though) #901 [delynnb]
-
-
-*1.9.0* (22th March, 2005)
-
-* Added adapter independent limit clause as a two-element array with the first being the limit, the second being the offset #795 [Sam Stephenson]. Example:
-
- Developer.find_all nil, 'id ASC', 5 # return the first five developers
- Developer.find_all nil, 'id ASC', [3, 8] # return three developers, starting from #8 and forward
-
- This doesn't yet work with the DB2 or MS SQL adapters. Patches to make that happen are encouraged.
-
-* Added alias_method :to_param, :id to Base, such that Active Record objects to be used as URL parameters in Action Pack automatically #812 [Nicholas Seckar/Sam Stephenson]
-
-* Improved the performance of the OCI8 adapter for Oracle #723 [pilx/gjenkins]
-
-* Added type conversion before saving a record, so string-based values like "10.0" aren't left for the database to convert #820 [dave@cherryville.org]
-
-* Added with additional settings for working with transactional fixtures and pre-loaded test databases #865 [mindel]
-
-* Fixed acts_as_list to trigger remove_from_list on destroy after the fact, not before, so a unique position can be maintained #871 [Alisdair McDiarmid]
-
-* Added the possibility of specifying fixtures in multiple calls #816 [kim@tinker.com]
-
-* Added Base.exists?(id) that'll return true if an object of the class with the given id exists #854 [stian@grytoyr.net]
-
-* Added optionally allow for nil or empty strings with validates_numericality_of #801 [Sebastian Kanthak]
-
-* Fixed problem with using slashes in validates_format_of regular expressions #801 [Sebastian Kanthak]
-
-* Fixed that SQLite3 exceptions are caught and reported properly #823 [yerejm]
-
-* Added that all types of after_find/after_initialized callbacks are triggered if the explicit implementation is present, not only the explicit implementation itself
-
-* Fixed that symbols can be used on attribute assignment, like page.emails.create(:subject => data.subject, :body => data.body)
-
-
-*1.8.0* (7th March, 2005)
-
-* Added ActiveRecord::Base.colorize_logging to control whether to use colors in logs or not (on by default)
-
-* Added support for timestamp with time zone in PostgreSQL #560 [Scott Barron]
-
-* Added MultiparameterAssignmentErrors and AttributeAssignmentError exceptions #777 [demetrius]. Documentation:
-
- * +MultiparameterAssignmentErrors+ -- collection of errors that occurred during a mass assignment using the
- +attributes=+ method. The +errors+ property of this exception contains an array of +AttributeAssignmentError+
- objects that should be inspected to determine which attributes triggered the errors.
- * +AttributeAssignmentError+ -- an error occurred while doing a mass assignment through the +attributes=+ method.
- You can inspect the +attribute+ property of the exception object to determine which attribute triggered the error.
-
-* Fixed that postgresql adapter would fails when reading bytea fields with null value #771 [rodrigo k]
-
-* Added transactional fixtures that uses rollback to undo changes to fixtures instead of DELETE/INSERT -- it's much faster. See documentation under Fixtures #760 [Jeremy Kemper]
-
-* Added destruction of dependent objects in has_one associations when a new assignment happens #742 [mindel]. Example:
-
- class Account < ActiveRecord::Base
- has_one :credit_card, :dependent => true
- end
- class CreditCard < ActiveRecord::Base
- belongs_to :account
- end
-
- account.credit_card # => returns existing credit card, lets say id = 12
- account.credit_card = CreditCard.create("number" => "123")
- account.save # => CC with id = 12 is destroyed
-
-
-* Added validates_numericality_of #716 [skanthak/c.r.mcgrath]. Docuemntation:
-
- Validates whether the value of the specified attribute is numeric by trying to convert it to
- a float with Kernel.Float (if integer is false) or applying it to the regular expression
- /^[\+\-]?\d+$/ (if integer is set to true).
-
- class Person < ActiveRecord::Base
- validates_numericality_of :value, :on => :create
- end
-
- Configuration options:
- * message - A custom error message (default is: "is not a number")
- * on Specifies when this validation is active (default is :save, other options :create, :update)
- * only_integer Specifies whether the value has to be an integer, e.g. an integral value (default is false)
-
-
-* Fixed that HasManyAssociation#count was using :finder_sql rather than :counter_sql if it was available #445 [Scott Barron]
-
-* Added better defaults for composed_of, so statements like composed_of :time_zone, :mapping => %w( time_zone time_zone ) can be written without the mapping part (it's now assumed)
-
-* Added MacroReflection#macro which will return a symbol describing the macro used (like :composed_of or :has_many) #718, #248 [james@slashetc.com]
-
-
-*1.7.0* (24th February, 2005)
-
-* Changed the auto-timestamping feature to use ActiveRecord::Base.default_timezone instead of entertaining the parallel ActiveRecord::Base.timestamps_gmt method. The latter is now deprecated and will throw a warning on use (but still work) #710 [Jamis Buck]
-
-* Added a OCI8-based Oracle adapter that has been verified to work with Oracle 8 and 9 #629 [Graham Jenkins]. Usage notes:
-
- 1. Key generation uses a sequence "rails_sequence" for all tables. (I couldn't find a simple
- and safe way of passing table-specific sequence information to the adapter.)
- 2. Oracle uses DATE or TIMESTAMP datatypes for both dates and times. Consequently I have had to
- resort to some hacks to get data converted to Date or Time in Ruby.
- If the column_name ends in _at (like created_at, updated_at) it's created as a Ruby Time. Else if the
- hours/minutes/seconds are 0, I make it a Ruby Date. Else it's a Ruby Time.
- This is nasty - but if you use Duck Typing you'll probably not care very much.
- In 9i it's tempting to map DATE to Date and TIMESTAMP to Time but I don't think that is
- valid - too many databases use DATE for both.
- Timezones and sub-second precision on timestamps are not supported.
- 3. Default values that are functions (such as "SYSDATE") are not supported. This is a
- restriction of the way active record supports default values.
- 4. Referential integrity constraints are not fully supported. Under at least
- some circumstances, active record appears to delete parent and child records out of
- sequence and out of transaction scope. (Or this may just be a problem of test setup.)
-
- The OCI8 driver can be retrieved from http://rubyforge.org/projects/ruby-oci8/
-
-* Added option :schema_order to the PostgreSQL adapter to support the use of multiple schemas per database #697 [YuriSchimke]
-
-* Optimized the SQL used to generate has_and_belongs_to_many queries by listing the join table first #693 [yerejm]
-
-* Fixed that when using validation macros with a custom message, if you happened to use single quotes in the message string you would get a parsing error #657 [tonka]
-
-* Fixed that Active Record would throw Broken Pipe errors with FCGI when the MySQL connection timed out instead of reconnecting #428 [Nicholas Seckar]
-
-* Added options to specify an SSL connection for MySQL. Define the following attributes in the connection config (config/database.yml in Rails) to use it: sslkey, sslcert, sslca, sslcapath, sslcipher. To use SSL with no client certs, just set :sslca = '/dev/null'. http://dev.mysql.com/doc/mysql/en/secure-connections.html #604 [daniel@nightrunner.com]
-
-* Added automatic dropping/creating of test tables for running the unit tests on all databases #587 [adelle@bullet.net.au]
-
-* Fixed that find_by_* would fail when column names had numbers #670 [demetrius]
-
-* Fixed the SQL Server adapter on a bunch of issues #667 [DeLynn]
-
- 1. Created a new columns method that is much cleaner.
- 2. Corrected a problem with the select and select_all methods
- that didn't account for the LIMIT clause being passed into raw SQL statements.
- 3. Implemented the string_to_time method in order to create proper instances of the time class.
- 4. Added logic to the simplified_type method that allows the database to specify the scale of float data.
- 5. Adjusted the quote_column_name to account for the fact that MS SQL is bothered by a forward slash in the data string.
-
-* Fixed that the dynamic finder like find_all_by_something_boolean(false) didn't work #649 [lmarlow@yahoo.com]
-
-* Added validates_each that validates each specified attribute against a block #610 [Jeremy Kemper]. Example:
-
- class Person < ActiveRecord::Base
- validates_each :first_name, :last_name do |record, attr|
- record.errors.add attr, 'starts with z.' if attr[0] == ?z
- end
- end
-
-* Added :allow_nil as an explicit option for validates_length_of, so unless that's set to true having the attribute as nil will also return an error if a range is specified as :within #610 [Jeremy Kemper]
-
-* Added that validates_* now accept blocks to perform validations #618 [Tim Bates]. Example:
-
- class Person < ActiveRecord::Base
- validate { |person| person.errors.add("title", "will never be valid") if SHOULD_NEVER_BE_VALID }
- end
-
-* Addded validation for validate all the associated objects before declaring failure with validates_associated #618 [Tim Bates]
-
-* Added keyword-style approach to defining the custom relational bindings #545 [Jamis Buck]. Example:
-
- class Project < ActiveRecord::Base
- primary_key "sysid"
- table_name "XYZ_PROJECT"
- inheritance_column { original_inheritance_column + "_id" }
- end
-
-* Fixed Base#clone for use with PostgreSQL #565 [hanson@surgery.wisc.edu]
-
-
-*1.6.0* (January 25th, 2005)
-
-* Added that has_many association build and create methods can take arrays of record data like Base#create and Base#build to build/create multiple records at once.
-
-* Added that Base#delete and Base#destroy both can take an array of ids to delete/destroy #336
-
-* Added the option of supplying an array of attributes to Base#create, so that multiple records can be created at once.
-
-* Added the option of supplying an array of ids and attributes to Base#update, so that multiple records can be updated at once (inspired by #526/Duane Johnson). Example
-
- people = { 1 => { "first_name" => "David" }, 2 => { "first_name" => "Jeremy"} }
- Person.update(people.keys, people.values)
-
-* Added ActiveRecord::Base.timestamps_gmt that can be set to true to make the automated timestamping use GMT instead of local time #520 [Scott Baron]
-
-* Added that update_all calls sanitize_sql on its updates argument, so stuff like MyRecord.update_all(['time = ?', Time.now]) works #519 [notahat]
-
-* Fixed that the dynamic finders didn't treat nil as a "IS NULL" but rather "= NULL" case #515 [Demetrius]
-
-* Added bind-named arrays for interpolating a group of ids or strings in conditions #528 [Jeremy Kemper]
-
-* Added that has_and_belongs_to_many associations with additional attributes also can be created between unsaved objects and only committed to the database when Base#save is called on the associator #524 [Eric Anderson]
-
-* Fixed that records fetched with piggy-back attributes or through rich has_and_belongs_to_many associations couldn't be saved due to the extra attributes not part of the table #522 [Eric Anderson]
-
-* Added mass-assignment protection for the inheritance column -- regardless of a custom column is used or not
-
-* Fixed that association proxies would fail === tests like PremiumSubscription === @account.subscription
-
-* Fixed that column aliases didn't work as expected with the new MySql411 driver #507 [Demetrius]
-
-* Fixed that find_all would produce invalid sql when called sequentialy #490 [Scott Baron]
-
-
-*1.5.1* (January 18th, 2005)
-
-* Fixed that the belongs_to and has_one proxy would fail a test like 'if project.manager' -- this unfortunately also means that you can't call methods like project.manager.build unless there already is a manager on the project #492 [Tim Bates]
-
-* Fixed that the Ruby/MySQL adapter wouldn't connect if the password was empty #503 [Pelle]
-
-
-*1.5.0* (January 17th, 2005)
-
-* Fixed that unit tests for MySQL are now run as the "rails" user instead of root #455 [Eric Hodel]
-
-* Added validates_associated that enables validation of objects in an unsaved association #398 [Tim Bates]. Example:
-
- class Book < ActiveRecord::Base
- has_many :pages
- belongs_to :library
-
- validates_associated :pages, :library
- end
-
-* Added support for associating unsaved objects #402 [Tim Bates]. Rules that govern this addition:
-
- == Unsaved objects and associations
-
- You can manipulate objects and associations before they are saved to the database, but there is some special behaviour you should be
- aware of, mostly involving the saving of associated objects.
-
- === One-to-one associations
-
- * Assigning an object to a has_one association automatically saves that object, and the object being replaced (if there is one), in
- order to update their primary keys - except if the parent object is unsaved (new_record? == true).
- * If either of these saves fail (due to one of the objects being invalid) the assignment statement returns false and the assignment
- is cancelled.
- * If you wish to assign an object to a has_one association without saving it, use the #association.build method (documented below).
- * Assigning an object to a belongs_to association does not save the object, since the foreign key field belongs on the parent. It does
- not save the parent either.
-
- === Collections
-
- * Adding an object to a collection (has_many or has_and_belongs_to_many) automatically saves that object, except if the parent object
- (the owner of the collection) is not yet stored in the database.
- * If saving any of the objects being added to a collection (via #push or similar) fails, then #push returns false.
- * You can add an object to a collection without automatically saving it by using the #collection.build method (documented below).
- * All unsaved (new_record? == true) members of the collection are automatically saved when the parent is saved.
-
-* Added replace to associations, so you can do project.manager.replace(new_manager) or project.milestones.replace(new_milestones) #402 [Tim Bates]
-
-* Added build and create methods to has_one and belongs_to associations, so you can now do project.manager.build(attributes) #402 [Tim Bates]
-
-* Added that if a before_* callback returns false, all the later callbacks and the associated action are cancelled. If an after_* callback returns false, all the later callbacks are cancelled. Callbacks are generally run in the order they are defined, with the exception of callbacks defined as methods on the model, which are called last. #402 [Tim Bates]
-
-* Fixed that Base#== wouldn't work for multiple references to the same unsaved object #402 [Tim Bates]
-
-* Fixed binary support for PostgreSQL #444 [alex@byzantine.no]
-
-* Added a differenciation between AssociationCollection#size and -length. Now AssociationCollection#size returns the size of the
- collection by executing a SELECT COUNT(*) query if the collection hasn't been loaded and calling collection.size if it has. If
- it's more likely than not that the collection does have a size larger than zero and you need to fetch that collection afterwards,
- it'll take one less SELECT query if you use length.
-
-* Added Base#attributes that returns a hash of all the attributes with their names as keys and clones of their objects as values #433 [atyp.de]
-
-* Fixed that foreign keys named the same as the association would cause stack overflow #437 [Eric Anderson]
-
-* Fixed default scope of acts_as_list from "1" to "1 = 1", so it'll work in PostgreSQL (among other places) #427 [Alexey]
-
-* Added Base#reload that reloads the attributes of an object from the database #422 [Andreas Schwarz]
-
-* Added SQLite3 compatibility through the sqlite3-ruby adapter by Jamis Buck #381 [Jeremy Kemper]
-
-* Added support for the new protocol spoken by MySQL 4.1.1+ servers for the Ruby/MySQL adapter that ships with Rails #440 [Matt Mower]
-
-* Added that Observers can use the observes class method instead of overwriting self.observed_class().
-
- Before:
- class ListSweeper < ActiveRecord::Base
- def self.observed_class() [ List, Item ]
- end
-
- After:
- class ListSweeper < ActiveRecord::Base
- observes List, Item
- end
-
-* Fixed that conditions in has_many and has_and_belongs_to_many should be interpolated just like the finder_sql is
-
-* Fixed Base#update_attribute to be indifferent to whether a string or symbol is used to describe the name
-
-* Added Base#toggle(attribute) and Base#toggle!(attribute) that makes it easier to flip a switch or flag.
-
- Before: topic.update_attribute(:approved, !approved?)
- After : topic.toggle!(:approved)
-
-* Added Base#increment!(attribute) and Base#decrement!(attribute) that also saves the records. Example:
-
- page.views # => 1
- page.increment!(:views) # executes an UPDATE statement
- page.views # => 2
-
- page.increment(:views).increment!(:views)
- page.views # => 4
-
-* Added Base#increment(attribute) and Base#decrement(attribute) that encapsulates the += 1 and -= 1 patterns.
-
-
-
-
-*1.14.2* (April 9th, 2005)
-
-* Fixed calculations for the Oracle Adapter (closes #4626) [Michael Schoen]
-
-
-*1.14.1* (April 6th, 2006)
-
-* Fix type_name_with_module to handle type names that begin with '::'. Closes #4614. [Nicholas Seckar]
-
-* Fixed that that multiparameter assignment doesn't work with aggregations (closes #4620) [Lars Pind]
-
-* Enable Limit/Offset in Calculations (closes #4558) [lmarlow@yahoo.com]
-
-* Fixed that loading including associations returns all results if Load IDs For Limited Eager Loading returns none (closes #4528) [Rick]
-
-* Fixed HasManyAssociation#find bugs when :finder_sql is set #4600 [lagroue@free.fr]
-
-* Allow AR::Base#respond_to? to behave when @attributes is nil [zenspider]
-
-* Support eager includes when going through a polymorphic has_many association. [Rick]
-
-* Added support for eagerly including polymorphic has_one associations. (closes #4525) [Rick]
-
- class Post < ActiveRecord::Base
- has_one :tagging, :as => :taggable
- end
-
- Post.find :all, :include => :tagging
-
-* Added descriptive error messages for invalid has_many :through associations: going through :has_one or :has_and_belongs_to_many [Rick]
-
-* Added support for going through a polymorphic has_many association: (closes #4401) [Rick]
-
- class PhotoCollection < ActiveRecord::Base
- has_many :photos, :as => :photographic
- belongs_to :firm
- end
-
- class Firm < ActiveRecord::Base
- has_many :photo_collections
- has_many :photos, :through => :photo_collections
- end
-
-* Multiple fixes and optimizations in PostgreSQL adapter, allowing ruby-postgres gem to work properly. [ruben.nine@gmail.com]
-
-* Fixed that AssociationCollection#delete_all should work even if the records of the association are not loaded yet. [Florian Weber]
-
-* Changed those private ActiveRecord methods to take optional third argument :auto instead of nil for performance optimizations. (closes #4456) [Stefan]
-
-* Private ActiveRecord methods add_limit!, add_joins!, and add_conditions! take an OPTIONAL third argument 'scope' (closes #4456) [Rick]
-
-* DEPRECATED: Using additional attributes on has_and_belongs_to_many associations. Instead upgrade your association to be a real join model [DHH]
-
-* Fixed that records returned from has_and_belongs_to_many associations with additional attributes should be marked as read only (fixes #4512) [DHH]
-
-* Do not implicitly mark recordss of has_many :through as readonly but do mark habtm records as readonly (eventually only on join tables without rich attributes). [Marcel Mollina Jr.]
-
-* Fixed broken OCIAdapter #4457 [schoenm@earthlink.net]
-
-
-*1.14.0* (March 27th, 2006)
-
-* Replace 'rescue Object' with a finer grained rescue. Closes #4431. [Nicholas Seckar]
-
-* Fixed eager loading so that an aliased table cannot clash with a has_and_belongs_to_many join table [Rick]
-
-* Add support for :include to with_scope [andrew@redlinesoftware.com]
-
-* Support the use of public synonyms with the Oracle adapter; required ruby-oci8 v0.1.14 #4390 [schoenm@earthlink.net]
-
-* Change periods (.) in table aliases to _'s. Closes #4251 [jeff@ministrycentered.com]
-
-* Changed has_and_belongs_to_many join to INNER JOIN for Mysql 3.23.x. Closes #4348 [Rick]
-
-* Fixed issue that kept :select options from being scoped [Rick]
-
-* Fixed db_schema_import when binary types are present #3101 [DHH]
-
-* Fixed that MySQL enums should always be returned as strings #3501 [DHH]
-
-* Change has_many :through to use the :source option to specify the source association. :class_name is now ignored. [Rick Olson]
-
- class Connection < ActiveRecord::Base
- belongs_to :user
- belongs_to :channel
- end
-
- class Channel < ActiveRecord::Base
- has_many :connections
- has_many :contacts, :through => :connections, :class_name => 'User' # OLD
- has_many :contacts, :through => :connections, :source => :user # NEW
- end
-
-* Fixed DB2 adapter so nullable columns will be determines correctly now and quotes from column default values will be removed #4350 [contact@maik-schmidt.de]
-
-* Allow overriding of find parameters in scoped has_many :through calls [Rick Olson]
-
- In this example, :include => false disables the default eager association from loading. :select changes the standard
- select clause. :joins specifies a join that is added to the end of the has_many :through query.
-
- class Post < ActiveRecord::Base
- has_many :tags, :through => :taggings, :include => :tagging do
- def add_joins_and_select
- find :all, :select => 'tags.*, authors.id as author_id', :include => false,
- :joins => 'left outer join posts on taggings.taggable_id = posts.id left outer join authors on posts.author_id = authors.id'
- end
- end
- end
-
-* Fixed that schema changes while the database was open would break any connections to a SQLite database (now we reconnect if that error is throw) [DHH]
-
-* Don't classify the has_one class when eager loading, it is already singular. Add tests. (closes #4117) [jonathan@bluewire.net.nz]
-
-* Quit ignoring default :include options in has_many :through calls [Mark James]
-
-* Allow has_many :through associations to find the source association by setting a custom class (closes #4307) [jonathan@bluewire.net.nz]
-
-* Eager Loading support added for has_many :through => :has_many associations (see below). [Rick Olson]
-
-* Allow has_many :through to work on has_many associations (closes #3864) [sco@scottraymond.net] Example:
-
- class Firm < ActiveRecord::Base
- has_many :clients
- has_many :invoices, :through => :clients
- end
-
- class Client < ActiveRecord::Base
- belongs_to :firm
- has_many :invoices
- end
-
- class Invoice < ActiveRecord::Base
- belongs_to :client
- end
-
-* Raise error when trying to select many polymorphic objects with has_many :through or :include (closes #4226) [josh@hasmanythrough.com]
-
-* Fixed has_many :through to include :conditions set on the :through association. closes #4020 [jonathan@bluewire.net.nz]
-
-* Fix that has_many :through honors the foreign key set by the belongs_to association in the join model (closes #4259) [andylien@gmail.com / Rick]
-
-* SQL Server adapter gets some love #4298 [rtomayko@gmail.com]
-
-* Added OpenBase database adapter that builds on top of the http://www.spice-of-life.net/ruby-openbase/ driver. All functionality except LIMIT/OFFSET is supported #3528 [derrickspell@cdmplus.com]
-
-* Rework table aliasing to account for truncated table aliases. Add smarter table aliasing when doing eager loading of STI associations. This allows you to use the association name in the order/where clause. [Jonathan Viney / Rick Olson] #4108 Example (SpecialComment is using STI):
-
- Author.find(:all, :include => { :posts => :special_comments }, :order => 'special_comments.body')
-
-* Add AbstractAdapter#table_alias_for to create table aliases according to the rules of the current adapter. [Rick]
-
-* Provide access to the underlying database connection through Adapter#raw_connection. Enables the use of db-specific methods without complicating the adapters. #2090 [Koz]
-
-* Remove broken attempts at handling columns with a default of 'now()' in the postgresql adapter. #2257 [Koz]
-
-* Added connection#current_database that'll return of the current database (only works in MySQL, SQL Server, and Oracle so far -- please help implement for the rest of the adapters) #3663 [Tom ward]
-
-* Fixed that Migration#execute would have the table name prefix appended to its query #4110 [mark.imbriaco@pobox.com]
-
-* Make all tinyint(1) variants act like boolean in mysql (tinyint(1) unsigned, etc.) [Jamis Buck]
-
-* Use association's :conditions when eager loading. [jeremyevans0@gmail.com] #4144
-
-* Alias the has_and_belongs_to_many join table on eager includes. #4106 [jeremyevans0@gmail.com]
-
- This statement would normally error because the projects_developers table is joined twice, and therefore joined_on would be ambiguous.
-
- Developer.find(:all, :include => {:projects => :developers}, :conditions => 'join_project_developers.joined_on IS NOT NULL')
-
-* Oracle adapter gets some love #4230 [schoenm@earthlink.net]
-
- * Changes :text to CLOB rather than BLOB [Moses Hohman]
- * Fixes an issue with nil numeric length/scales (several)
- * Implements support for XMLTYPE columns [wilig / Kubo Takehiro]
- * Tweaks a unit test to get it all green again
- * Adds support for #current_database
-
-* Added Base.abstract_class? that marks which classes are not part of the Active Record hierarchy #3704 [Rick Olson]
-
- class CachedModel < ActiveRecord::Base
- self.abstract_class = true
- end
-
- class Post < CachedModel
- end
-
- CachedModel.abstract_class?
- => true
-
- Post.abstract_class?
- => false
-
- Post.base_class
- => Post
-
- Post.table_name
- => 'posts'
-
-* Allow :dependent options to be used with polymorphic joins. #3820 [Rick Olson]
-
- class Foo < ActiveRecord::Base
- has_many :attachments, :as => :attachable, :dependent => :delete_all
- end
-
-* Nicer error message on has_many :through when :through reflection can not be found. #4042 [court3nay@gmail.com]
-
-* Upgrade to Transaction::Simple 1.3 [Jamis Buck]
-
-* Catch FixtureClassNotFound when using instantiated fixtures on a fixture that has no ActiveRecord model [Rick Olson]
-
-* Allow ordering of calculated results and/or grouped fields in calculations [solo@gatelys.com]
-
-* Make ActiveRecord::Base#save! return true instead of nil on success. #4173 [johan@johansorensen.com]
-
-* Dynamically set allow_concurrency. #4044 [Stefan Kaes]
-
-* Added Base#to_xml that'll turn the current record into a XML representation [DHH]. Example:
-
- topic.to_xml
-
- ...returns:
-
-
-
- The First Topic
- David
- 1
- false
- 0
- 2000-01-01 08:28:00
- 2003-07-16 09:28:00
- Have a nice day
- david@loudthinking.com
-
- 2004-04-15
-
-
- ...and you can configure with:
-
- topic.to_xml(:skip_instruct => true, :except => [ :id, bonus_time, :written_on, replies_count ])
-
- ...that'll return:
-
-
- The First Topic
- David
- false
- Have a nice day
- david@loudthinking.com
-
- 2004-04-15
-
-
- You can even do load first-level associations as part of the document:
-
- firm.to_xml :include => [ :account, :clients ]
-
- ...that'll return something like:
-
-
-
- 1
- 1
- 37signals
-
-
- 1
- Summit
-
-
- 1
- Microsoft
-
-
-
- 1
- 50
-
-
-
-* Allow :counter_cache to take a column name for custom counter cache columns [Jamis Buck]
-
-* Documentation fixes for :dependent [robby@planetargon.com]
-
-* Stop the MySQL adapter crashing when views are present. #3782 [Jonathan Viney]
-
-* Don't classify the belongs_to class, it is already singular #4117 [keithm@infused.org]
-
-* Allow set_fixture_class to take Classes instead of strings for a class in a module. Raise FixtureClassNotFound if a fixture can't load. [Rick Olson]
-
-* Fix quoting of inheritance column for STI eager loading #4098 [Jonathan Viney ]
-
-* Added smarter table aliasing for eager associations for multiple self joins #3580 [Rick Olson]
-
- * The first time a table is referenced in a join, no alias is used.
- * After that, the parent class name and the reflection name are used.
-
- Tree.find(:all, :include => :children) # LEFT OUTER JOIN trees AS tree_children ...
-
- * Any additional join references get a numerical suffix like '_2', '_3', etc.
-
-* Fixed eager loading problems with single-table inheritance #3580 [Rick Olson]. Post.find(:all, :include => :special_comments) now returns all posts, and any special comments that the posts may have. And made STI work with has_many :through and polymorphic belongs_to.
-
-* Added cascading eager loading that allows for queries like Author.find(:all, :include=> { :posts=> :comments }), which will fetch all authors, their posts, and the comments belonging to those posts in a single query (using LEFT OUTER JOIN) #3913 [anna@wota.jp]. Examples:
-
- # cascaded in two levels
- >> Author.find(:all, :include=>{:posts=>:comments})
- => authors
- +- posts
- +- comments
-
- # cascaded in two levels and normal association
- >> Author.find(:all, :include=>[{:posts=>:comments}, :categorizations])
- => authors
- +- posts
- +- comments
- +- categorizations
-
- # cascaded in two levels with two has_many associations
- >> Author.find(:all, :include=>{:posts=>[:comments, :categorizations]})
- => authors
- +- posts
- +- comments
- +- categorizations
-
- # cascaded in three levels
- >> Company.find(:all, :include=>{:groups=>{:members=>{:favorites}}})
- => companies
- +- groups
- +- members
- +- favorites
-
-* Make counter cache work when replacing an association #3245 [eugenol@gmail.com]
-
-* Make migrations verbose [Jamis Buck]
-
-* Make counter_cache work with polymorphic belongs_to [Jamis Buck]
-
-* Fixed that calling HasOneProxy#build_model repeatedly would cause saving to happen #4058 [anna@wota.jp]
-
-* Added Sybase database adapter that relies on the Sybase Open Client bindings (see http://raa.ruby-lang.org/project/sybase-ctlib) #3765 [John Sheets]. It's almost completely Active Record compliant (including migrations), but has the following caveats:
-
- * Does not support DATE SQL column types; use DATETIME instead.
- * Date columns on HABTM join tables are returned as String, not Time.
- * Insertions are potentially broken for :polymorphic join tables
- * BLOB column access not yet fully supported
-
-* Clear stale, cached connections left behind by defunct threads. [Jeremy Kemper]
-
-* CHANGED DEFAULT: set ActiveRecord::Base.allow_concurrency to false. Most AR usage is in single-threaded applications. [Jeremy Kemper]
-
-* Renamed the "oci" adapter to "oracle", but kept the old name as an alias #4017 [schoenm@earthlink.net]
-
-* Fixed that Base.save should always return false if the save didn't succeed, including if it has halted by before_save's #1861, #2477 [DHH]
-
-* Speed up class -> connection caching and stale connection verification. #3979 [Stefan Kaes]
-
-* Add set_fixture_class to allow the use of table name accessors with models which use set_table_name. [Kevin Clark]
-
-* Added that fixtures to placed in subdirectories of the main fixture files are also loaded #3937 [dblack@wobblini.net]
-
-* Define attribute query methods to avoid method_missing calls. #3677 [jonathan@bluewire.net.nz]
-
-* ActiveRecord::Base.remove_connection explicitly closes database connections and doesn't corrupt the connection cache. Introducing the disconnect! instance method for the PostgreSQL, MySQL, and SQL Server adapters; implementations for the others are welcome. #3591 [Simon Stapleton, Tom Ward]
-
-* Added support for nested scopes #3407 [anna@wota.jp]. Examples:
-
- Developer.with_scope(:find => { :conditions => "salary > 10000", :limit => 10 }) do
- Developer.find(:all) # => SELECT * FROM developers WHERE (salary > 10000) LIMIT 10
-
- # inner rule is used. (all previous parameters are ignored)
- Developer.with_exclusive_scope(:find => { :conditions => "name = 'Jamis'" }) do
- Developer.find(:all) # => SELECT * FROM developers WHERE (name = 'Jamis')
- end
-
- # parameters are merged
- Developer.with_scope(:find => { :conditions => "name = 'Jamis'" }) do
- Developer.find(:all) # => SELECT * FROM developers WHERE (( salary > 10000 ) AND ( name = 'Jamis' )) LIMIT 10
- end
- end
-
-* Fixed db2 connection with empty user_name and auth options #3622 [phurley@gmail.com]
-
-* Fixed validates_length_of to work on UTF-8 strings by using characters instead of bytes #3699 [Masao Mutoh]
-
-* Fixed that reflections would bleed across class boundaries in single-table inheritance setups #3796 [lars@pind.com]
-
-* Added calculations: Base.count, Base.average, Base.sum, Base.minimum, Base.maxmium, and the generic Base.calculate. All can be used with :group and :having. Calculations and statitics need no longer require custom SQL. #3958 [Rick Olson]. Examples:
-
- Person.average :age
- Person.minimum :age
- Person.maximum :age
- Person.sum :salary, :group => :last_name
-
-* Renamed Errors#count to Errors#size but kept an alias for the old name (and included an alias for length too) #3920 [contact@lukeredpath.co.uk]
-
-* Reflections don't attempt to resolve module nesting of association classes. Simplify type computation. [Jeremy Kemper]
-
-* Improved the Oracle OCI Adapter with better performance for column reflection (from #3210), fixes to migrations (from #3476 and #3742), tweaks to unit tests (from #3610), and improved documentation (from #2446) #3879 [Aggregated by schoenm@earthlink.net]
-
-* Fixed that the schema_info table used by ActiveRecord::Schema.define should respect table pre- and suffixes #3834 [rubyonrails@atyp.de]
-
-* Added :select option to Base.count that'll allow you to select something else than * to be counted on. Especially important for count queries using DISTINCT #3839 [skaes]
-
-* Correct syntax error in mysql DDL, and make AAACreateTablesTest run first [Bob Silva]
-
-* Allow :include to be used with has_many :through associations #3611 [Michael Schoen]
-
-* PostgreSQL: smarter schema dumps using pk_and_sequence_for(table). #2920 [Blair Zajac]
-
-* SQLServer: more compatible limit/offset emulation. #3779 [Tom Ward]
-
-* Polymorphic join support for has_one associations (has_one :foo, :as => :bar) #3785 [Rick Olson]
-
-* PostgreSQL: correctly parse negative integer column defaults. #3776 [bellis@deepthought.org]
-
-* Fix problems with count when used with :include [Jeremy Hopple and Kevin Clark]
-
-* ActiveRecord::RecordInvalid now states which validations failed in its default error message [Tobias Luetke]
-
-* Using AssociationCollection#build with arrays of hashes should call build, not create [DHH]
-
-* Remove definition of reloadable? from ActiveRecord::Base to make way for new Reloadable code. [Nicholas Seckar]
-
-* Fixed schema handling for DB2 adapter that didn't work: an initial schema could be set, but it wasn't used when getting tables and indexes #3678 [Maik Schmidt]
-
-* Support the :column option for remove_index with the PostgreSQL adapter. #3661 [shugo@ruby-lang.org]
-
-* Add documentation for add_index and remove_index. #3600 [Manfred Stienstra ]
-
-* If the OCI library is not available, raise an exception indicating as much. #3593 [schoenm@earthlink.net]
-
-* Add explicit :order in finder tests as postgresql orders results differently by default. #3577. [Rick Olson]
-
-* Make dynamic finders honor additional passed in :conditions. #3569 [Oleg Pudeyev , Marcel Molina Jr.]
-
-* Show a meaningful error when the DB2 adapter cannot be loaded due to missing dependencies. [Nicholas Seckar]
-
-* Make .count work for has_many associations with multi line finder sql [schoenm@earthlink.net]
-
-* Add AR::Base.base_class for querying the ancestor AR::Base subclass [Jamis Buck]
-
-* Allow configuration of the column used for optimistic locking [wilsonb@gmail.com]
-
-* Don't hardcode 'id' in acts as list. [ror@philippeapril.com]
-
-* Fix date errors for SQLServer in association tests. #3406 [kevin.clark@gmal.com]
-
-* Escape database name in MySQL adapter when creating and dropping databases. #3409 [anna@wota.jp]
-
-* Disambiguate table names for columns in validates_uniquness_of's WHERE clause. #3423 [alex.borovsky@gmail.com]
-
-* .with_scope imposed create parameters now bypass attr_protected [Tobias Luetke]
-
-* Don't raise an exception when there are more keys than there are named bind variables when sanitizing conditions. [Marcel Molina Jr.]
-
-* Multiple enhancements and adjustments to DB2 adaptor. #3377 [contact@maik-schmidt.de]
-
-* Sanitize scoped conditions. [Marcel Molina Jr.]
-
-* Added option to Base.reflection_of_all_associations to specify a specific association to scope the call. For example Base.reflection_of_all_associations(:has_many) [DHH]
-
-* Added ActiveRecord::SchemaDumper.ignore_tables which tells SchemaDumper which tables to ignore. Useful for tables with funky column like the ones required for tsearch2. [TobiasLuetke]
-
-* SchemaDumper now doesn't fail anymore when there are unknown column types in the schema. Instead the table is ignored and a Comment is left in the schema.rb. [TobiasLuetke]
-
-* Fixed that saving a model with multiple habtm associations would only save the first one. #3244 [yanowitz-rubyonrails@quantumfoam.org, Florian Weber]
-
-* Fix change_column to work with PostgreSQL 7.x and 8.x. #3141 [wejn@box.cz, Rick Olson, Scott Barron]
-
-* removed :piggyback in favor of just allowing :select on :through associations. [Tobias Luetke]
-
-* made method missing delegation to class methods on relation target work on :through associations. [Tobias Luetke]
-
-* made .find() work on :through relations. [Tobias Luetke]
-
-* Fix typo in association docs. #3296. [Blair Zajac]
-
-* Fixed :through relations when using STI inherited classes would use the inherited class's name as foreign key on the join model [Tobias Luetke]
-
-*1.13.2* (December 13th, 2005)
-
-* Become part of Rails 1.0
-
-* MySQL: allow encoding option for mysql.rb driver. [Jeremy Kemper]
-
-* Added option inheritance for find calls on has_and_belongs_to_many and has_many assosociations [DHH]. Example:
-
- class Post
- has_many :recent_comments, :class_name => "Comment", :limit => 10, :include => :author
- end
-
- post.recent_comments.find(:all) # Uses LIMIT 10 and includes authors
- post.recent_comments.find(:all, :limit => nil) # Uses no limit but include authors
- post.recent_comments.find(:all, :limit => nil, :include => nil) # Uses no limit and doesn't include authors
-
-* Added option to specify :group, :limit, :offset, and :select options from find on has_and_belongs_to_many and has_many assosociations [DHH]
-
-* MySQL: fixes for the bundled mysql.rb driver. #3160 [Justin Forder]
-
-* SQLServer: fix obscure optimistic locking bug. #3068 [kajism@yahoo.com]
-
-* SQLServer: support uniqueidentifier columns. #2930 [keithm@infused.org]
-
-* SQLServer: cope with tables names qualified by owner. #3067 [jeff@ministrycentered.com]
-
-* SQLServer: cope with columns with "desc" in the name. #1950 [Ron Lusk, Ryan Tomayko]
-
-* SQLServer: cope with primary keys with "select" in the name. #3057 [rdifrango@captechventures.com]
-
-* Oracle: active? performs a select instead of a commit. #3133 [Michael Schoen]
-
-* MySQL: more robust test for nullified result hashes. #3124 [Stefan Kaes]
-
-* Reloading an instance refreshes its aggregations as well as its associations. #3024 [François Beausolei]
-
-* Fixed that using :include together with :conditions array in Base.find would cause NoMethodError #2887 [Paul Hammmond]
-
-* PostgreSQL: more robust sequence name discovery. #3087 [Rick Olson]
-
-* Oracle: use syntax compatible with Oracle 8. #3131 [Michael Schoen]
-
-* MySQL: work around ruby-mysql/mysql-ruby inconsistency with mysql.stat. Eliminate usage of mysql.ping because it doesn't guarantee reconnect. Explicitly close and reopen the connection instead. [Jeremy Kemper]
-
-* Added preliminary support for polymorphic associations [DHH]
-
-* Added preliminary support for join models [DHH]
-
-* Allow validate_uniqueness_of to be scoped by more than just one column. #1559. [jeremy@jthopple.com, Marcel Molina Jr.]
-
-* Firebird: active? and reconnect! methods for handling stale connections. #428 [Ken Kunz ]
-
-* Firebird: updated for FireRuby 0.4.0. #3009 [Ken Kunz ]
-
-* MySQL and PostgreSQL: active? compatibility with the pure-Ruby driver. #428 [Jeremy Kemper]
-
-* Oracle: active? check pings the database rather than testing the last command status. #428 [Michael Schoen]
-
-* SQLServer: resolve column aliasing/quoting collision when using limit or offset in an eager find. #2974 [kajism@yahoo.com]
-
-* Reloading a model doesn't lose track of its connection. #2996 [junk@miriamtech.com, Jeremy Kemper]
-
-* Fixed bug where using update_attribute after pushing a record to a habtm association of the object caused duplicate rows in the join table. #2888 [colman@rominato.com, Florian Weber, Michael Schoen]
-
-* MySQL, PostgreSQL: reconnect! also reconfigures the connection. Otherwise, the connection 'loses' its settings if it times out and is reconnected. #2978 [Shugo Maeda]
-
-* has_and_belongs_to_many: use JOIN instead of LEFT JOIN. [Jeremy Kemper]
-
-* MySQL: introduce :encoding option to specify the character set for client, connection, and results. Only available for MySQL 4.1 and later with the mysql-ruby driver. Do SHOW CHARACTER SET in mysql client to see available encodings. #2975 [Shugo Maeda]
-
-* Add tasks to create, drop and rebuild the MySQL and PostgreSQL test databases. [Marcel Molina Jr.]
-
-* Correct boolean handling in generated reader methods. #2945 [don.park@gmail.com, Stefan Kaes]
-
-* Don't generate read methods for columns whose names are not valid ruby method names. #2946 [Stefan Kaes]
-
-* Document :force option to create_table. #2921 [Blair Zajac ]
-
-* Don't add the same conditions twice in has_one finder sql. #2916 [Jeremy Evans]
-
-* Rename Version constant to VERSION. #2802 [Marcel Molina Jr.]
-
-* Introducing the Firebird adapter. Quote columns and use attribute_condition more consistently. Setup guide: http://wiki.rubyonrails.com/rails/pages/Firebird+Adapter #1874 [Ken Kunz ]
-
-* SQLServer: active? and reconnect! methods for handling stale connections. #428 [kajism@yahoo.com, Tom Ward ]
-
-* Associations handle case-equality more consistently: item.parts.is_a?(Array) and item.parts === Array. #1345 [MarkusQ@reality.com]
-
-* SQLServer: insert uses given primary key value if not nil rather than SELECT @@IDENTITY. #2866 [kajism@yahoo.com, Tom Ward ]
-
-* Oracle: active? and reconnect! methods for handling stale connections. Optionally retry queries after reconnect. #428 [Michael Schoen ]
-
-* Correct documentation for Base.delete_all. #1568 [Newhydra]
-
-* Oracle: test case for column default parsing. #2788 [Michael Schoen ]
-
-* Update documentation for Migrations. #2861 [Tom Werner ]
-
-* When AbstractAdapter#log rescues an exception, attempt to detect and reconnect to an inactive database connection. Connection adapter must respond to the active? and reconnect! instance methods. Initial support for PostgreSQL, MySQL, and SQLite. Make certain that all statements which may need reconnection are performed within a logged block: for example, this means no avoiding log(sql, name) { } if @logger.nil? #428 [Jeremy Kemper]
-
-* Oracle: Much faster column reflection. #2848 [Michael Schoen ]
-
-* Base.reset_sequence_name analogous to reset_table_name (mostly useful for testing). Base.define_attr_method allows nil values. [Jeremy Kemper]
-
-* PostgreSQL: smarter sequence name defaults, stricter last_insert_id, warn on pk without sequence. [Jeremy Kemper]
-
-* PostgreSQL: correctly discover custom primary key sequences. #2594 [Blair Zajac , meadow.nnick@gmail.com, Jeremy Kemper]
-
-* SQLServer: don't report limits for unsupported field types. #2835 [Ryan Tomayko]
-
-* Include the Enumerable module in ActiveRecord::Errors. [Rick Bradley ]
-
-* Add :group option, correspond to GROUP BY, to the find method and to the has_many association. #2818 [rubyonrails@atyp.de]
-
-* Don't cast nil or empty strings to a dummy date. #2789 [Rick Bradley ]
-
-* acts_as_list plays nicely with inheritance by remembering the class which declared it. #2811 [rephorm@rephorm.com]
-
-* Fix sqlite adaptor's detection of missing dbfile or database declaration. [Nicholas Seckar]
-
-* Fixed acts_as_list for definitions without an explicit :order #2803 [jonathan@bluewire.net.nz]
-
-* Upgrade bundled ruby-mysql 0.2.4 with mysql411 shim (see #440) to ruby-mysql 0.2.6 with a patchset for 4.1 protocol support. Local change [301] is now a part of the main driver; reapplied local change [2182]. Removed GC.start from Result.free. [tommy@tmtm.org, akuroda@gmail.com, Doug Fales , Jeremy Kemper]
-
-* Correct handling of complex order clauses with SQL Server limit emulation. #2770 [Tom Ward , Matt B.]
-
-* Correct whitespace problem in Oracle default column value parsing. #2788 [rick@rickbradley.com]
-
-* Destroy associated has_and_belongs_to_many records after all before_destroy callbacks but before destroy. This allows you to act on the habtm association as you please while preserving referential integrity. #2065 [larrywilliams1@gmail.com, sam.kirchmeier@gmail.com, elliot@townx.org, Jeremy Kemper]
-
-* Deprecate the old, confusing :exclusively_dependent option in favor of :dependent => :delete_all. [Jeremy Kemper]
-
-* More compatible Oracle column reflection. #2771 [Ryan Davis , Michael Schoen ]
-
-
-*1.13.0* (November 7th, 2005)
-
-* Fixed faulty regex in get_table_name method (SQLServerAdapter) #2639 [Ryan Tomayko]
-
-* Added :include as an option for association declarations [DHH]. Example:
-
- has_many :posts, :include => [ :author, :comments ]
-
-* Rename Base.constrain to Base.with_scope so it doesn't conflict with existing concept of database constraints. Make scoping more robust: uniform method => parameters, validated method names and supported finder parameters, raise exception on nested scopes. [Jeremy Kemper] Example:
-
- Comment.with_scope(:find => { :conditions => 'active=true' }, :create => { :post_id => 5 }) do
- # Find where name = ? and active=true
- Comment.find :all, :conditions => ['name = ?', name]
- # Create comment associated with :post_id
- Comment.create :body => "Hello world"
- end
-
-* Fixed that SQL Server should ignore :size declarations on anything but integer and string in the agnostic schema representation #2756 [Ryan Tomayko]
-
-* Added constrain scoping for creates using a hash of attributes bound to the :creation key [DHH]. Example:
-
- Comment.constrain(:creation => { :post_id => 5 }) do
- # Associated with :post_id
- Comment.create :body => "Hello world"
- end
-
- This is rarely used directly, but allows for find_or_create on associations. So you can do:
-
- # If the tag doesn't exist, a new one is created that's associated with the person
- person.tags.find_or_create_by_name("Summer")
-
-* Added find_or_create_by_X as a second type of dynamic finder that'll create the record if it doesn't already exist [DHH]. Example:
-
- # No 'Summer' tag exists
- Tag.find_or_create_by_name("Summer") # equal to Tag.create(:name => "Summer")
-
- # Now the 'Summer' tag does exist
- Tag.find_or_create_by_name("Summer") # equal to Tag.find_by_name("Summer")
-
-* Added extension capabilities to has_many and has_and_belongs_to_many proxies [DHH]. Example:
-
- class Account < ActiveRecord::Base
- has_many :people do
- def find_or_create_by_name(name)
- first_name, *last_name = name.split
- last_name = last_name.join " "
-
- find_or_create_by_first_name_and_last_name(first_name, last_name)
- end
- end
- end
-
- person = Account.find(:first).people.find_or_create_by_name("David Heinemeier Hansson")
- person.first_name # => "David"
- person.last_name # => "Heinemeier Hansson"
-
- Note that the anoymous module must be declared using brackets, not do/end (due to order of evaluation).
-
-* Omit internal dtproperties table from SQLServer table list. #2729 [rtomayko@gmail.com]
-
-* Quote column names in generated SQL. #2728 [rtomayko@gmail.com]
-
-* Correct the pure-Ruby MySQL 4.1.1 shim's version test. #2718 [Jeremy Kemper]
-
-* Add Model.create! to match existing model.save! method. When save! raises RecordInvalid, you can catch the exception, retrieve the invalid record (invalid_exception.record), and see its errors (invalid_exception.record.errors). [Jeremy Kemper]
-
-* Correct fixture behavior when table name pluralization is off. #2719 [Rick Bradley ]
-
-* Changed :dbfile to :database for SQLite adapter for consistency (old key still works as an alias) #2644 [Dan Peterson]
-
-* Added migration support for Oracle #2647 [Michael Schoen]
-
-* Worked around that connection can't be reset if allow_concurrency is off. #2648 [Michael Schoen ]
-
-* Fixed SQL Server adapter to pass even more tests and do even better #2634 [rtomayko@gmail.com]
-
-* Fixed SQL Server adapter so it honors options[:conditions] when applying :limits #1978 [Tom Ward]
-
-* Added migration support to SQL Server adapter (please someone do the same for Oracle and DB2) #2625 [Tom Ward]
-
-* Use AR::Base.silence rather than AR::Base.logger.silence in fixtures to preserve Log4r compatibility. #2618 [dansketcher@gmail.com]
-
-* Constraints are cloned so they can't be inadvertently modified while they're
-in effect. Added :readonly finder constraint. Calling an association collection's class method (Part.foobar via item.parts.foobar) constrains :readonly => false since the collection's :joins constraint would otherwise force it to true. [Jeremy Kemper ]
-
-* Added :offset and :limit to the kinds of options that Base.constrain can use #2466 [duane.johnson@gmail.com]
-
-* Fixed handling of nil number columns on Oracle and cleaned up tests for Oracle in general #2555 [schoenm@earthlink.net]
-
-* Added quoted_true and quoted_false methods and tables to db2_adapter and cleaned up tests for DB2 #2493, #2624 [maik schmidt]
-
-
-*1.12.2* (October 26th, 2005)
-
-* Allow symbols to rename columns when using SQLite adapter. #2531 [kevin.clark@gmail.com]
-
-* Map Active Record time to SQL TIME. #2575, #2576 [Robby Russell ]
-
-* Clarify semantics of ActiveRecord::Base#respond_to? #2560 [skaes@web.de]
-
-* Fixed Association#clear for associations which have not yet been accessed. #2524 [Patrick Lenz ]
-
-* HABTM finders shouldn't return readonly records. #2525 [Patrick Lenz ]
-
-* Make all tests runnable on their own. #2521. [Blair Zajac ]
-
-
-*1.12.1* (October 19th, 2005)
-
-* Always parenthesize :conditions options so they may be safely combined with STI and constraints.
-
-* Correct PostgreSQL primary key sequence detection. #2507 [tmornini@infomania.com]
-
-* Added support for using limits in eager loads that involve has_many and has_and_belongs_to_many associations
-
-
-*1.12.0* (October 16th, 2005)
-
-* Update/clean up documentation (rdoc)
-
-* PostgreSQL sequence support. Use set_sequence_name in your model class to specify its primary key sequence. #2292 [Rick Olson , Robby Russell ]
-
-* Change default logging colors to work on both white and black backgrounds. [Sam Stephenson]
-
-* YAML fixtures support ordered hashes for fixtures with foreign key dependencies in the same table. #1896 [purestorm@ggnore.net]
-
-* :dependent now accepts :nullify option. Sets the foreign key of the related objects to NULL instead of deleting them. #2015 [Robby Russell ]
-
-* Introduce read-only records. If you call object.readonly! then it will mark the object as read-only and raise ReadOnlyRecord if you call object.save. object.readonly? reports whether the object is read-only. Passing :readonly => true to any finder method will mark returned records as read-only. The :joins option now implies :readonly, so if you use this option, saving the same record will now fail. Use find_by_sql to work around.
-
-* Avoid memleak in dev mode when using fcgi
-
-* Simplified .clear on active record associations by using the existing delete_records method. #1906 [Caleb ]
-
-* Delegate access to a customized primary key to the conventional id method. #2444. [Blair Zajac ]
-
-* Fix errors caused by assigning a has-one or belongs-to property to itself
-
-* Add ActiveRecord::Base.schema_format setting which specifies how databases should be dumped [Sam Stephenson]
-
-* Update DB2 adapter. #2206. [contact@maik-schmidt.de]
-
-* Corrections to SQLServer native data types. #2267. [rails.20.clarry@spamgourmet.com]
-
-* Deprecated ActiveRecord::Base.threaded_connection in favor of ActiveRecord::Base.allow_concurrency.
-
-* Protect id attribute from mass assigment even when the primary key is set to something else. #2438. [Blair Zajac ]
-
-* Misc doc fixes (typos/grammar/etc.). #2430. [coffee2code]
-
-* Add test coverage for content_columns. #2432. [coffee2code]
-
-* Speed up for unthreaded environments. #2431. [skaes@web.de]
-
-* Optimization for Mysql selects using mysql-ruby extension greater than 2.6.3. #2426. [skaes@web.de]
-
-* Speed up the setting of table_name. #2428. [skaes@web.de]
-
-* Optimize instantiation of STI subclass records. In partial fullfilment of #1236. [skaes@web.de]
-
-* Fix typo of 'constrains' to 'contraints'. #2069. [Michael Schuerig ]
-
-* Optimization refactoring for add_limit_offset!. In partial fullfilment of #1236. [skaes@web.de]
-
-* Add ability to get all siblings, including the current child, with acts_as_tree. Recloses #2140. [Michael Schuerig ]
-
-* Add geometric type for postgresql adapter. #2233 [akaspick@gmail.com]
-
-* Add option (true by default) to generate reader methods for each attribute of a record to avoid the overhead of calling method missing. In partial fullfilment of #1236. [skaes@web.de]
-
-* Add convenience predicate methods on Column class. In partial fullfilment of #1236. [skaes@web.de]
-
-* Raise errors when invalid hash keys are passed to ActiveRecord::Base.find. #2363 [Chad Fowler , Nicholas Seckar]
-
-* Added :force option to create_table that'll try to drop the table if it already exists before creating
-
-* Fix transactions so that calling return while inside a transaction will not leave an open transaction on the connection. [Nicholas Seckar]
-
-* Use foreign_key inflection uniformly. #2156 [Blair Zajac ]
-
-* model.association.clear should destroy associated objects if :dependent => true instead of nullifying their foreign keys. #2221 [joergd@pobox.com, ObieFernandez ]
-
-* Returning false from before_destroy should cancel the action. #1829 [Jeremy Huffman]
-
-* Recognize PostgreSQL NOW() default as equivalent to CURRENT_TIMESTAMP or CURRENT_DATE, depending on the column's type. #2256 [mat ]
-
-* Extensive documentation for the abstract database adapter. #2250 [François Beausoleil ]
-
-* Clean up Fixtures.reset_sequences for PostgreSQL. Handle tables with no rows and models with custom primary keys. #2174, #2183 [jay@jay.fm, Blair Zajac ]
-
-* Improve error message when nil is assigned to an attr which validates_size_of within a range. #2022 [Manuel Holtgrewe ]
-
-* Make update_attribute use the same writer method that update_attributes uses.
- #2237 [trevor@protocool.com]
-
-* Make migrations honor table name prefixes and suffixes. #2298 [Jakob S, Marcel Molina]
-
-* Correct and optimize PostgreSQL bytea escaping. #1745, #1837 [dave@cherryville.org, ken@miriamtech.com, bellis@deepthought.org]
-
-* Fixtures should only reset a PostgreSQL sequence if it corresponds to an integer primary key named id. #1749 [chris@chrisbrinker.com]
-
-* Standardize the interpretation of boolean columns in the Mysql and Sqlite adapters. (Use MysqlAdapter.emulate_booleans = false to disable this behavior)
-
-* Added new symbol-driven approach to activating observers with Base#observers= [DHH]. Example:
-
- ActiveRecord::Base.observers = :cacher, :garbage_collector
-
-* Added AbstractAdapter#select_value and AbstractAdapter#select_values as convenience methods for selecting single values, instead of hashes, of the first column in a SELECT #2283 [solo@gatelys.com]
-
-* Wrap :conditions in parentheses to prevent problems with OR's #1871 [Jamis Buck]
-
-* Allow the postgresql adapter to work with the SchemaDumper. [Jamis Buck]
-
-* Add ActiveRecord::SchemaDumper for dumping a DB schema to a pure-ruby file, making it easier to consolidate large migration lists and port database schemas between databases. [Jamis Buck]
-
-* Fixed migrations for Windows when using more than 10 [David Naseby]
-
-* Fixed that the create_x method from belongs_to wouldn't save the association properly #2042 [Florian Weber]
-
-* Fixed saving a record with two unsaved belongs_to associations pointing to the same object #2023 [Tobias Luetke]
-
-* Improved migrations' behavior when the schema_info table is empty. [Nicholas Seckar]
-
-* Fixed that Observers didn't observe sub-classes #627 [Florian Weber]
-
-* Fix eager loading error messages, allow :include to specify tables using strings or symbols. Closes #2222 [Marcel Molina]
-
-* Added check for RAILS_CONNECTION_ADAPTERS on startup and only load the connection adapters specified within if its present (available in Rails through config.connection_adapters using the new config) #1958 [skae]
-
-* Fixed various problems with has_and_belongs_to_many when using customer finder_sql #2094 [Florian Weber]
-
-* Added better exception error when unknown column types are used with migrations #1814 [fbeausoleil@ftml.net]
-
-* Fixed "connection lost" issue with the bundled Ruby/MySQL driver (would kill the app after 8 hours of inactivity) #2163, #428 [kajism@yahoo.com]
-
-* Fixed comparison of Active Record objects so two new objects are not equal #2099 [deberg]
-
-* Fixed that the SQL Server adapter would sometimes return DBI::Timestamp objects instead of Time #2127 [Tom Ward]
-
-* Added the instance methods #root and #ancestors on acts_as_tree and fixed siblings to not include the current node #2142, #2140 [coffee2code]
-
-* Fixed that Active Record would call SHOW FIELDS twice (or more) for the same model when the cached results were available #1947 [sd@notso.net]
-
-* Added log_level and use_silence parameter to ActiveRecord::Base.benchmark. The first controls at what level the benchmark statement will be logged (now as debug, instead of info) and the second that can be passed false to include all logging statements during the benchmark block/
-
-* Make sure the schema_info table is created before querying the current version #1903
-
-* Fixtures ignore table name prefix and suffix #1987 [Jakob S]
-
-* Add documentation for index_type argument to add_index method for migrations #2005 [blaine@odeo.com]
-
-* Modify read_attribute to allow a symbol argument #2024 [Ken Kunz]
-
-* Make destroy return self #1913 [sebastian.kanthak@muehlheim.de]
-
-* Fix typo in validations documentation #1938 [court3nay]
-
-* Make acts_as_list work for insert_at(1) #1966 [hensleyl@papermountain.org]
-
-* Fix typo in count_by_sql documentation #1969 [Alexey Verkhovsky]
-
-* Allow add_column and create_table to specify NOT NULL #1712 [emptysands@gmail.com]
-
-* Fix create_table so that id column is implicitly added [Rick Olson]
-
-* Default sequence names for Oracle changed to #{table_name}_seq, which is the most commonly used standard. In addition, a new method ActiveRecord::Base#set_sequence_name allows the developer to set the sequence name per model. This is a non-backwards-compatible change -- anyone using the old-style "rails_sequence" will need to either create new sequences, or set: ActiveRecord::Base.set_sequence_name = "rails_sequence" #1798
-
-* OCIAdapter now properly handles synonyms, which are commonly used to separate out the schema owner from the application user #1798
-
-* Fixed the handling of camelCase columns names in Oracle #1798
-
-* Implemented for OCI the Rakefile tasks of :clone_structure_to_test, :db_structure_dump, and :purge_test_database, which enable Oracle folks to enjoy all the agile goodness of Rails for testing. Note that the current implementation is fairly limited -- only tables and sequences are cloned, not constraints or indexes. A full clone in Oracle generally requires some manual effort, and is version-specific. Post 9i, Oracle recommends the use of the DBMS_METADATA package, though that approach requires editing of the physical characteristics generated #1798
-
-* Fixed the handling of multiple blob columns in Oracle if one or more of them are null #1798
-
-* Added support for calling constrained class methods on has_many and has_and_belongs_to_many collections #1764 [Tobias Luetke]
-
- class Comment < AR:B
- def self.search(q)
- find(:all, :conditions => ["body = ?", q])
- end
- end
-
- class Post < AR:B
- has_many :comments
- end
-
- Post.find(1).comments.search('hi') # => SELECT * from comments WHERE post_id = 1 AND body = 'hi'
-
- NOTICE: This patch changes the underlying SQL generated by has_and_belongs_to_many queries. If your relying on that, such as
- by explicitly referencing the old t and j aliases, you'll need to update your code. Of course, you _shouldn't_ be relying on
- details like that no less than you should be diving in to touch private variables. But just in case you do, consider yourself
- noticed :)
-
-* Added migration support for SQLite (using temporary tables to simulate ALTER TABLE) #1771 [Sam Stephenson]
-
-* Remove extra definition of supports_migrations? from abstract_adaptor.rb [Nicholas Seckar]
-
-* Fix acts_as_list so that moving next-to-last item to the bottom does not result in duplicate item positions
-
-* Fixed incompatibility in DB2 adapter with the new limit/offset approach #1718 [Maik Schmidt]
-
-* Added :select option to find which can specify a different value than the default *, like find(:all, :select => "first_name, last_name"), if you either only want to select part of the columns or exclude columns otherwise included from a join #1338 [Stefan Kaes]
-
-
-*1.11.1* (11 July, 2005)
-
-* Added support for limit and offset with eager loading of has_one and belongs_to associations. Using the options with has_many and has_and_belongs_to_many associations will now raise an ActiveRecord::ConfigurationError #1692 [Rick Olsen]
-
-* Fixed that assume_bottom_position (in acts_as_list) could be called on items already last in the list and they would move one position away from the list #1648 [tyler@kianta.com]
-
-* Added ActiveRecord::Base.threaded_connections flag to turn off 1-connection per thread (required for thread safety). By default it's on, but WEBrick in Rails need it off #1685 [Sam Stephenson]
-
-* Correct reflected table name for singular associations. #1688 [court3nay@gmail.com]
-
-* Fixed optimistic locking with SQL Server #1660 [tom@popdog.net]
-
-* Added ActiveRecord::Migrator.migrate that can figure out whether to go up or down based on the target version and the current
-
-* Added better error message for "packets out of order" #1630 [courtenay]
-
-* Fixed first run of "rake migrate" on PostgreSQL by not expecting a return value on the id #1640
-
-
-*1.11.0* (6 July, 2005)
-
-* Fixed that Yaml error message in fixtures hid the real error #1623 [Nicholas Seckar]
-
-* Changed logging of SQL statements to use the DEBUG level instead of INFO
-
-* Added new Migrations framework for describing schema transformations in a way that can be easily applied across multiple databases #1604 [Tobias Luetke] See documentation under ActiveRecord::Migration and the additional support in the Rails rakefile/generator.
-
-* Added callback hooks to association collections #1549 [Florian Weber]. Example:
-
- class Project
- has_and_belongs_to_many :developers, :before_add => :evaluate_velocity
-
- def evaluate_velocity(developer)
- ...
- end
- end
-
- ..raising an exception will cause the object not to be added (or removed, with before_remove).
-
-
-* Fixed Base.content_columns call for SQL Server adapter #1450 [DeLynn Berry]
-
-* Fixed Base#write_attribute to work with both symbols and strings #1190 [Paul Legato]
-
-* Fixed that has_and_belongs_to_many didn't respect single table inheritance types #1081 [Florian Weber]
-
-* Speed up ActiveRecord#method_missing for the common case (read_attribute).
-
-* Only notify observers on after_find and after_initialize if these methods are defined on the model. #1235 [skaes@web.de]
-
-* Fixed that single-table inheritance sub-classes couldn't be used to limit the result set with eager loading #1215 [Chris McGrath]
-
-* Fixed validates_numericality_of to work with overrided getter-method when :allow_nil is on #1316 [raidel@onemail.at]
-
-* Added roots, root, and siblings to the batch of methods added by acts_as_tree #1541 [michael@schuerig.de]
-
-* Added support for limit/offset with the MS SQL Server driver so that pagination will now work #1569 [DeLynn Berry]
-
-* Added support for ODBC connections to MS SQL Server so you can connect from a non-Windows machine #1569 [Mark Imbriaco/DeLynn Berry]
-
-* Fixed that multiparameter posts ignored attr_protected #1532 [alec+rails@veryclever.net]
-
-* Fixed problem with eager loading when using a has_and_belongs_to_many association using :association_foreign_key #1504 [flash@vanklinkenbergsoftware.nl]
-
-* Fixed Base#find to honor the documentation on how :joins work and make them consistent with Base#count #1405 [pritchie@gmail.com]. What used to be:
-
- Developer.find :all, :joins => 'developers_projects', :conditions => 'id=developer_id AND project_id=1'
-
- ...should instead be:
-
- Developer.find(
- :all,
- :joins => 'LEFT JOIN developers_projects ON developers.id = developers_projects.developer_id',
- :conditions => 'project_id=1'
- )
-
-* Fixed that validations didn't respecting custom setting for too_short, too_long messages #1437 [Marcel Molina]
-
-* Fixed that clear_association_cache doesn't delete new associations on new records (so you can safely place new records in the session with Action Pack without having new associations wiped) #1494 [cluon]
-
-* Fixed that calling Model.find([]) returns [] and doesn't throw an exception #1379
-
-* Fixed that adding a record to a has_and_belongs_to collection would always save it -- now it only saves if its a new record #1203 [Alisdair McDiarmid]
-
-* Fixed saving of in-memory association structures to happen as a after_create/after_update callback instead of after_save -- that way you can add new associations in after_create/after_update callbacks without getting them saved twice
-
-* Allow any Enumerable, not just Array, to work as bind variables #1344 [Jeremy Kemper]
-
-* Added actual database-changing behavior to collection assigment for has_many and has_and_belongs_to_many #1425 [Sebastian Kanthak].
- Example:
-
- david.projects = [Project.find(1), Project.new("name" => "ActionWebSearch")]
- david.save
-
- If david.projects already contain the project with ID 1, this is left unchanged. Any other projects are dropped. And the new
- project is saved when david.save is called.
-
- Also included is a way to do assignments through IDs, which is perfect for checkbox updating, so you get to do:
-
- david.project_ids = [1, 5, 7]
-
-* Corrected typo in find SQL for has_and_belongs_to_many. #1312 [ben@bensinclair.com]
-
-* Fixed sanitized conditions for has_many finder method. #1281 [jackc@hylesanderson.com, pragdave, Tobias Luetke]
-
-* Comprehensive PostgreSQL schema support. Use the optional schema_search_path directive in database.yml to give a comma-separated list of schemas to search for your tables. This allows you, for example, to have tables in a shared schema without having to use a custom table name. See http://www.postgresql.org/docs/8.0/interactive/ddl-schemas.html to learn more. #827 [dave@cherryville.org]
-
-* Corrected @@configurations typo #1410 [david@ruppconsulting.com]
-
-* Return PostgreSQL columns in the order they were declared #1374 [perlguy@gmail.com]
-
-* Allow before/after update hooks to work on models using optimistic locking
-
-* Eager loading of dependent has_one associations won't delete the association #1212
-
-* Added a second parameter to the build and create method for has_one that controls whether the existing association should be replaced (which means nullifying its foreign key as well). By default this is true, but false can be passed to prevent it.
-
-* Using transactional fixtures now causes the data to be loaded only once.
-
-* Added fixture accessor methods that can be used when instantiated fixtures are disabled.
-
- fixtures :web_sites
-
- def test_something
- assert_equal "Ruby on Rails", web_sites(:rubyonrails).name
- end
-
-* Added DoubleRenderError exception that'll be raised if render* is called twice #518 [Nicholas Seckar]
-
-* Fixed exceptions occuring after render has been called #1096 [Nicholas Seckar]
-
-* CHANGED: validates_presence_of now uses Errors#add_on_blank, which will make " " fail the validation where it didn't before #1309
-
-* Added Errors#add_on_blank which works like Errors#add_on_empty, but uses Object#blank? instead
-
-* Added the :if option to all validations that can either use a block or a method pointer to determine whether the validation should be run or not. #1324 [Duane Johnson/jhosteny]. Examples:
-
- Conditional validations such as the following are made possible:
- validates_numericality_of :income, :if => :employed?
-
- Conditional validations can also solve the salted login generator problem:
- validates_confirmation_of :password, :if => :new_password?
-
- Using blocks:
- validates_presence_of :username, :if => Proc.new { |user| user.signup_step > 1 }
-
-* Fixed use of construct_finder_sql when using :join #1288 [dwlt@dwlt.net]
-
-* Fixed that :delete_sql in has_and_belongs_to_many associations couldn't access record properties #1299 [Rick Olson]
-
-* Fixed that clone would break when an aggregate had the same name as one of its attributes #1307 [Jeremy Kemper]
-
-* Changed that destroying an object will only freeze the attributes hash, which keeps the object from having attributes changed (as that wouldn't make sense), but allows for the querying of associations after it has been destroyed.
-
-* Changed the callbacks such that observers are notified before the in-object callbacks are triggered. Without this change, it wasn't possible to act on the whole object in something like a before_destroy observer without having the objects own callbacks (like deleting associations) called first.
-
-* Added option for passing an array to the find_all version of the dynamic finders and have it evaluated as an IN fragment. Example:
-
- # SELECT * FROM topics WHERE title IN ('First', 'Second')
- Topic.find_all_by_title(["First", "Second"])
-
-* Added compatibility with camelCase column names for dynamic finders #533 [Dee.Zsombor]
-
-* Fixed extraneous comma in count() function that made it not work with joins #1156 [jarkko/Dee.Zsombor]
-
-* Fixed incompatibility with Base#find with an array of ids that would fail when using eager loading #1186 [Alisdair McDiarmid]
-
-* Fixed that validate_length_of lost :on option when :within was specified #1195 [jhosteny@mac.com]
-
-* Added encoding and min_messages options for PostgreSQL #1205 [shugo]. Configuration example:
-
- development:
- adapter: postgresql
- database: rails_development
- host: localhost
- username: postgres
- password:
- encoding: UTF8
- min_messages: ERROR
-
-* Fixed acts_as_list where deleting an item that was removed from the list would ruin the positioning of other list items #1197 [Jamis Buck]
-
-* Added validates_exclusion_of as a negative of validates_inclusion_of
-
-* Optimized counting of has_many associations by setting the association to empty if the count is 0 so repeated calls doesn't trigger database calls
-
-
-*1.10.1* (20th April, 2005)
-
-* Fixed frivilous database queries being triggered with eager loading on empty associations and other things
-
-* Fixed order of loading in eager associations
-
-* Fixed stray comma when using eager loading and ordering together from has_many associations #1143
-
-
-*1.10.0* (19th April, 2005)
-
-* Added eager loading of associations as a way to solve the N+1 problem more gracefully without piggy-back queries. Example:
-
- for post in Post.find(:all, :limit => 100)
- puts "Post: " + post.title
- puts "Written by: " + post.author.name
- puts "Last comment on: " + post.comments.first.created_on
- end
-
- This used to generate 301 database queries if all 100 posts had both author and comments. It can now be written as:
-
- for post in Post.find(:all, :limit => 100, :include => [ :author, :comments ])
-
- ...and the number of database queries needed is now 1.
-
-* Added new unified Base.find API and deprecated the use of find_first and find_all. See the documentation for Base.find. Examples:
-
- Person.find(1, :conditions => "administrator = 1", :order => "created_on DESC")
- Person.find(1, 5, 6, :conditions => "administrator = 1", :order => "created_on DESC")
- Person.find(:first, :order => "created_on DESC", :offset => 5)
- Person.find(:all, :conditions => [ "category IN (?)", categories], :limit => 50)
- Person.find(:all, :offset => 10, :limit => 10)
-
-* Added acts_as_nested_set #1000 [wschenk]. Introduction:
-
- This acts provides Nested Set functionality. Nested Set is similiar to Tree, but with
- the added feature that you can select the children and all of it's descendants with
- a single query. A good use case for this is a threaded post system, where you want
- to display every reply to a comment without multiple selects.
-
-* Added Base.save! that attempts to save the record just like Base.save but will raise a RecordInvalid exception instead of returning false if the record is not valid [After much pestering from Dave Thomas]
-
-* Fixed PostgreSQL usage of fixtures with regards to public schemas and table names with dots #962 [gnuman1@gmail.com]
-
-* Fixed that fixtures were being deleted in the same order as inserts causing FK errors #890 [andrew.john.peters@gmail.com]
-
-* Fixed loading of fixtures in to be in the right order (or PostgreSQL would bark) #1047 [stephenh@chase3000.com]
-
-* Fixed page caching for non-vhost applications living underneath the root #1004 [Ben Schumacher]
-
-* Fixes a problem with the SQL Adapter which was resulting in IDENTITY_INSERT not being set to ON when it should be #1104 [adelle]
-
-* Added the option to specify the acceptance string in validates_acceptance_of #1106 [caleb@aei-tech.com]
-
-* Added insert_at(position) to acts_as_list #1083 [DeLynnB]
-
-* Removed the default order by id on has_and_belongs_to_many queries as it could kill performance on large sets (you can still specify by hand with :order)
-
-* Fixed that Base.silence should restore the old logger level when done, not just set it to DEBUG #1084 [yon@milliped.com]
-
-* Fixed boolean saving on Oracle #1093 [mparrish@pearware.org]
-
-* Moved build_association and create_association for has_one and belongs_to out of deprecation as they work when the association is nil unlike association.build and association.create, which require the association to be already in place #864
-
-* Added rollbacks of transactions if they're active as the dispatcher is killed gracefully (TERM signal) #1054 [Leon Bredt]
-
-* Added quoting of column names for fixtures #997 [jcfischer@gmail.com]
-
-* Fixed counter_sql when no records exist in database for PostgreSQL (would give error, not 0) #1039 [Caleb Tennis]
-
-* Fixed that benchmarking times for rendering included db runtimes #987 [skaes@web.de]
-
-* Fixed boolean queries for t/f fields in PostgreSQL #995 [dave@cherryville.org]
-
-* Added that model.items.delete(child) will delete the child, not just set the foreign key to nil, if the child is dependent on the model #978 [Jeremy Kemper]
-
-* Fixed auto-stamping of dates (created_on/updated_on) for PostgreSQL #985 [dave@cherryville.org]
-
-* Fixed Base.silence/benchmark to only log if a logger has been configured #986 [skaes@web.de]
-
-* Added a join parameter as the third argument to Base.find_first and as the second to Base.count #426, #988 [skaes@web.de]
-
-* Fixed bug in Base#hash method that would treat records with the same string-based id as different [Dave Thomas]
-
-* Renamed DateHelper#distance_of_time_in_words_to_now to DateHelper#time_ago_in_words (old method name is still available as a deprecated alias)
-
-
-*1.9.1* (27th March, 2005)
-
-* Fixed that Active Record objects with float attribute could not be cloned #808
-
-* Fixed that MissingSourceFile's wasn't properly detected in production mode #925 [Nicholas Seckar]
-
-* Fixed that :counter_cache option would look for a line_items_count column for a LineItem object instead of lineitems_count
-
-* Fixed that AR exists?() would explode on postgresql if the passed id did not match the PK type #900 [Scott Barron]
-
-* Fixed the MS SQL adapter to work with the new limit/offset approach and with binary data (still suffering from 7KB limit, though) #901 [delynnb]
-
-
-*1.9.0* (22th March, 2005)
-
-* Added adapter independent limit clause as a two-element array with the first being the limit, the second being the offset #795 [Sam Stephenson]. Example:
-
- Developer.find_all nil, 'id ASC', 5 # return the first five developers
- Developer.find_all nil, 'id ASC', [3, 8] # return three developers, starting from #8 and forward
-
- This doesn't yet work with the DB2 or MS SQL adapters. Patches to make that happen are encouraged.
-
-* Added alias_method :to_param, :id to Base, such that Active Record objects to be used as URL parameters in Action Pack automatically #812 [Nicholas Seckar/Sam Stephenson]
-
-* Improved the performance of the OCI8 adapter for Oracle #723 [pilx/gjenkins]
-
-* Added type conversion before saving a record, so string-based values like "10.0" aren't left for the database to convert #820 [dave@cherryville.org]
-
-* Added with additional settings for working with transactional fixtures and pre-loaded test databases #865 [mindel]
-
-* Fixed acts_as_list to trigger remove_from_list on destroy after the fact, not before, so a unique position can be maintained #871 [Alisdair McDiarmid]
-
-* Added the possibility of specifying fixtures in multiple calls #816 [kim@tinker.com]
-
-* Added Base.exists?(id) that'll return true if an object of the class with the given id exists #854 [stian@grytoyr.net]
-
-* Added optionally allow for nil or empty strings with validates_numericality_of #801 [Sebastian Kanthak]
-
-* Fixed problem with using slashes in validates_format_of regular expressions #801 [Sebastian Kanthak]
-
-* Fixed that SQLite3 exceptions are caught and reported properly #823 [yerejm]
-
-* Added that all types of after_find/after_initialized callbacks are triggered if the explicit implementation is present, not only the explicit implementation itself
-
-* Fixed that symbols can be used on attribute assignment, like page.emails.create(:subject => data.subject, :body => data.body)
-
-
-*1.8.0* (7th March, 2005)
-
-* Added ActiveRecord::Base.colorize_logging to control whether to use colors in logs or not (on by default)
-
-* Added support for timestamp with time zone in PostgreSQL #560 [Scott Barron]
-
-* Added MultiparameterAssignmentErrors and AttributeAssignmentError exceptions #777 [demetrius]. Documentation:
-
- * +MultiparameterAssignmentErrors+ -- collection of errors that occurred during a mass assignment using the
- +attributes=+ method. The +errors+ property of this exception contains an array of +AttributeAssignmentError+
- objects that should be inspected to determine which attributes triggered the errors.
- * +AttributeAssignmentError+ -- an error occurred while doing a mass assignment through the +attributes=+ method.
- You can inspect the +attribute+ property of the exception object to determine which attribute triggered the error.
-
-* Fixed that postgresql adapter would fails when reading bytea fields with null value #771 [rodrigo k]
-
-* Added transactional fixtures that uses rollback to undo changes to fixtures instead of DELETE/INSERT -- it's much faster. See documentation under Fixtures #760 [Jeremy Kemper]
-
-* Added destruction of dependent objects in has_one associations when a new assignment happens #742 [mindel]. Example:
-
- class Account < ActiveRecord::Base
- has_one :credit_card, :dependent => true
- end
- class CreditCard < ActiveRecord::Base
- belongs_to :account
- end
-
- account.credit_card # => returns existing credit card, lets say id = 12
- account.credit_card = CreditCard.create("number" => "123")
- account.save # => CC with id = 12 is destroyed
-
-
-* Added validates_numericality_of #716 [skanthak/c.r.mcgrath]. Docuemntation:
-
- Validates whether the value of the specified attribute is numeric by trying to convert it to
- a float with Kernel.Float (if integer is false) or applying it to the regular expression
- /^[\+\-]?\d+$/ (if integer is set to true).
-
- class Person < ActiveRecord::Base
- validates_numericality_of :value, :on => :create
- end
-
- Configuration options:
- * message - A custom error message (default is: "is not a number")
- * on Specifies when this validation is active (default is :save, other options :create, :update)
- * only_integer Specifies whether the value has to be an integer, e.g. an integral value (default is false)
-
-
-* Fixed that HasManyAssociation#count was using :finder_sql rather than :counter_sql if it was available #445 [Scott Barron]
-
-* Added better defaults for composed_of, so statements like composed_of :time_zone, :mapping => %w( time_zone time_zone ) can be written without the mapping part (it's now assumed)
-
-* Added MacroReflection#macro which will return a symbol describing the macro used (like :composed_of or :has_many) #718, #248 [james@slashetc.com]
-
-
-*1.7.0* (24th February, 2005)
-
-* Changed the auto-timestamping feature to use ActiveRecord::Base.default_timezone instead of entertaining the parallel ActiveRecord::Base.timestamps_gmt method. The latter is now deprecated and will throw a warning on use (but still work) #710 [Jamis Buck]
-
-* Added a OCI8-based Oracle adapter that has been verified to work with Oracle 8 and 9 #629 [Graham Jenkins]. Usage notes:
-
- 1. Key generation uses a sequence "rails_sequence" for all tables. (I couldn't find a simple
- and safe way of passing table-specific sequence information to the adapter.)
- 2. Oracle uses DATE or TIMESTAMP datatypes for both dates and times. Consequently I have had to
- resort to some hacks to get data converted to Date or Time in Ruby.
- If the column_name ends in _at (like created_at, updated_at) it's created as a Ruby Time. Else if the
- hours/minutes/seconds are 0, I make it a Ruby Date. Else it's a Ruby Time.
- This is nasty - but if you use Duck Typing you'll probably not care very much.
- In 9i it's tempting to map DATE to Date and TIMESTAMP to Time but I don't think that is
- valid - too many databases use DATE for both.
- Timezones and sub-second precision on timestamps are not supported.
- 3. Default values that are functions (such as "SYSDATE") are not supported. This is a
- restriction of the way active record supports default values.
- 4. Referential integrity constraints are not fully supported. Under at least
- some circumstances, active record appears to delete parent and child records out of
- sequence and out of transaction scope. (Or this may just be a problem of test setup.)
-
- The OCI8 driver can be retrieved from http://rubyforge.org/projects/ruby-oci8/
-
-* Added option :schema_order to the PostgreSQL adapter to support the use of multiple schemas per database #697 [YuriSchimke]
-
-* Optimized the SQL used to generate has_and_belongs_to_many queries by listing the join table first #693 [yerejm]
-
-* Fixed that when using validation macros with a custom message, if you happened to use single quotes in the message string you would get a parsing error #657 [tonka]
-
-* Fixed that Active Record would throw Broken Pipe errors with FCGI when the MySQL connection timed out instead of reconnecting #428 [Nicholas Seckar]
-
-* Added options to specify an SSL connection for MySQL. Define the following attributes in the connection config (config/database.yml in Rails) to use it: sslkey, sslcert, sslca, sslcapath, sslcipher. To use SSL with no client certs, just set :sslca = '/dev/null'. http://dev.mysql.com/doc/mysql/en/secure-connections.html #604 [daniel@nightrunner.com]
-
-* Added automatic dropping/creating of test tables for running the unit tests on all databases #587 [adelle@bullet.net.au]
-
-* Fixed that find_by_* would fail when column names had numbers #670 [demetrius]
-
-* Fixed the SQL Server adapter on a bunch of issues #667 [DeLynn]
-
- 1. Created a new columns method that is much cleaner.
- 2. Corrected a problem with the select and select_all methods
- that didn't account for the LIMIT clause being passed into raw SQL statements.
- 3. Implemented the string_to_time method in order to create proper instances of the time class.
- 4. Added logic to the simplified_type method that allows the database to specify the scale of float data.
- 5. Adjusted the quote_column_name to account for the fact that MS SQL is bothered by a forward slash in the data string.
-
-* Fixed that the dynamic finder like find_all_by_something_boolean(false) didn't work #649 [lmarlow@yahoo.com]
-
-* Added validates_each that validates each specified attribute against a block #610 [Jeremy Kemper]. Example:
-
- class Person < ActiveRecord::Base
- validates_each :first_name, :last_name do |record, attr|
- record.errors.add attr, 'starts with z.' if attr[0] == ?z
- end
- end
-
-* Added :allow_nil as an explicit option for validates_length_of, so unless that's set to true having the attribute as nil will also return an error if a range is specified as :within #610 [Jeremy Kemper]
-
-* Added that validates_* now accept blocks to perform validations #618 [Tim Bates]. Example:
-
- class Person < ActiveRecord::Base
- validate { |person| person.errors.add("title", "will never be valid") if SHOULD_NEVER_BE_VALID }
- end
-
-* Addded validation for validate all the associated objects before declaring failure with validates_associated #618 [Tim Bates]
-
-* Added keyword-style approach to defining the custom relational bindings #545 [Jamis Buck]. Example:
-
- class Project < ActiveRecord::Base
- primary_key "sysid"
- table_name "XYZ_PROJECT"
- inheritance_column { original_inheritance_column + "_id" }
- end
-
-* Fixed Base#clone for use with PostgreSQL #565 [hanson@surgery.wisc.edu]
-
-
-*1.6.0* (January 25th, 2005)
-
-* Added that has_many association build and create methods can take arrays of record data like Base#create and Base#build to build/create multiple records at once.
-
-* Added that Base#delete and Base#destroy both can take an array of ids to delete/destroy #336
-
-* Added the option of supplying an array of attributes to Base#create, so that multiple records can be created at once.
-
-* Added the option of supplying an array of ids and attributes to Base#update, so that multiple records can be updated at once (inspired by #526/Duane Johnson). Example
-
- people = { 1 => { "first_name" => "David" }, 2 => { "first_name" => "Jeremy"} }
- Person.update(people.keys, people.values)
-
-* Added ActiveRecord::Base.timestamps_gmt that can be set to true to make the automated timestamping use GMT instead of local time #520 [Scott Baron]
-
-* Added that update_all calls sanitize_sql on its updates argument, so stuff like MyRecord.update_all(['time = ?', Time.now]) works #519 [notahat]
-
-* Fixed that the dynamic finders didn't treat nil as a "IS NULL" but rather "= NULL" case #515 [Demetrius]
-
-* Added bind-named arrays for interpolating a group of ids or strings in conditions #528 [Jeremy Kemper]
-
-* Added that has_and_belongs_to_many associations with additional attributes also can be created between unsaved objects and only committed to the database when Base#save is called on the associator #524 [Eric Anderson]
-
-* Fixed that records fetched with piggy-back attributes or through rich has_and_belongs_to_many associations couldn't be saved due to the extra attributes not part of the table #522 [Eric Anderson]
-
-* Added mass-assignment protection for the inheritance column -- regardless of a custom column is used or not
-
-* Fixed that association proxies would fail === tests like PremiumSubscription === @account.subscription
-
-* Fixed that column aliases didn't work as expected with the new MySql411 driver #507 [Demetrius]
-
-* Fixed that find_all would produce invalid sql when called sequentialy #490 [Scott Baron]
-
-
-*1.5.1* (January 18th, 2005)
-
-* Fixed that the belongs_to and has_one proxy would fail a test like 'if project.manager' -- this unfortunately also means that you can't call methods like project.manager.build unless there already is a manager on the project #492 [Tim Bates]
-
-* Fixed that the Ruby/MySQL adapter wouldn't connect if the password was empty #503 [Pelle]
-
-
-*1.5.0* (January 17th, 2005)
-
-* Fixed that unit tests for MySQL are now run as the "rails" user instead of root #455 [Eric Hodel]
-
-* Added validates_associated that enables validation of objects in an unsaved association #398 [Tim Bates]. Example:
-
- class Book < ActiveRecord::Base
- has_many :pages
- belongs_to :library
-
- validates_associated :pages, :library
- end
-
-* Added support for associating unsaved objects #402 [Tim Bates]. Rules that govern this addition:
-
- == Unsaved objects and associations
-
- You can manipulate objects and associations before they are saved to the database, but there is some special behaviour you should be
- aware of, mostly involving the saving of associated objects.
-
- === One-to-one associations
-
- * Assigning an object to a has_one association automatically saves that object, and the object being replaced (if there is one), in
- order to update their primary keys - except if the parent object is unsaved (new_record? == true).
- * If either of these saves fail (due to one of the objects being invalid) the assignment statement returns false and the assignment
- is cancelled.
- * If you wish to assign an object to a has_one association without saving it, use the #association.build method (documented below).
- * Assigning an object to a belongs_to association does not save the object, since the foreign key field belongs on the parent. It does
- not save the parent either.
-
- === Collections
-
- * Adding an object to a collection (has_many or has_and_belongs_to_many) automatically saves that object, except if the parent object
- (the owner of the collection) is not yet stored in the database.
- * If saving any of the objects being added to a collection (via #push or similar) fails, then #push returns false.
- * You can add an object to a collection without automatically saving it by using the #collection.build method (documented below).
- * All unsaved (new_record? == true) members of the collection are automatically saved when the parent is saved.
-
-* Added replace to associations, so you can do project.manager.replace(new_manager) or project.milestones.replace(new_milestones) #402 [Tim Bates]
-
-* Added build and create methods to has_one and belongs_to associations, so you can now do project.manager.build(attributes) #402 [Tim Bates]
-
-* Added that if a before_* callback returns false, all the later callbacks and the associated action are cancelled. If an after_* callback returns false, all the later callbacks are cancelled. Callbacks are generally run in the order they are defined, with the exception of callbacks defined as methods on the model, which are called last. #402 [Tim Bates]
-
-* Fixed that Base#== wouldn't work for multiple references to the same unsaved object #402 [Tim Bates]
-
-* Fixed binary support for PostgreSQL #444 [alex@byzantine.no]
-
-* Added a differenciation between AssociationCollection#size and -length. Now AssociationCollection#size returns the size of the
- collection by executing a SELECT COUNT(*) query if the collection hasn't been loaded and calling collection.size if it has. If
- it's more likely than not that the collection does have a size larger than zero and you need to fetch that collection afterwards,
- it'll take one less SELECT query if you use length.
-
-* Added Base#attributes that returns a hash of all the attributes with their names as keys and clones of their objects as values #433 [atyp.de]
-
-* Fixed that foreign keys named the same as the association would cause stack overflow #437 [Eric Anderson]
-
-* Fixed default scope of acts_as_list from "1" to "1 = 1", so it'll work in PostgreSQL (among other places) #427 [Alexey]
-
-* Added Base#reload that reloads the attributes of an object from the database #422 [Andreas Schwarz]
-
-* Added SQLite3 compatibility through the sqlite3-ruby adapter by Jamis Buck #381 [Jeremy Kemper]
-
-* Added support for the new protocol spoken by MySQL 4.1.1+ servers for the Ruby/MySQL adapter that ships with Rails #440 [Matt Mower]
-
-* Added that Observers can use the observes class method instead of overwriting self.observed_class().
-
- Before:
- class ListSweeper < ActiveRecord::Base
- def self.observed_class() [ List, Item ]
- end
-
- After:
- class ListSweeper < ActiveRecord::Base
- observes List, Item
- end
-
-* Fixed that conditions in has_many and has_and_belongs_to_many should be interpolated just like the finder_sql is
-
-* Fixed Base#update_attribute to be indifferent to whether a string or symbol is used to describe the name
-
-* Added Base#toggle(attribute) and Base#toggle!(attribute) that makes it easier to flip a switch or flag.
-
- Before: topic.update_attribute(:approved, !approved?)
- After : topic.toggle!(:approved)
-
-* Added Base#increment!(attribute) and Base#decrement!(attribute) that also saves the records. Example:
-
- page.views # => 1
- page.increment!(:views) # executes an UPDATE statement
- page.views # => 2
-
- page.increment(:views).increment!(:views)
- page.views # => 4
-
-* Added Base#increment(attribute) and Base#decrement(attribute) that encapsulates the += 1 and -= 1 patterns.
-
-
-*1.4.0* (January 4th, 2005)
-
-* Added automated optimistic locking if the field lock_version is present. Each update to the
- record increments the lock_version column and the locking facilities ensure that records instantiated twice
- will let the last one saved raise a StaleObjectError if the first was also updated. Example:
-
- p1 = Person.find(1)
- p2 = Person.find(1)
-
- p1.first_name = "Michael"
- p1.save
-
- p2.first_name = "should fail"
- p2.save # Raises a ActiveRecord::StaleObjectError
-
- You're then responsible for dealing with the conflict by rescuing the exception and either rolling back, merging,
- or otherwise apply the business logic needed to resolve the conflict.
-
- #384 [Michael Koziarski]
-
-* Added dynamic attribute-based finders as a cleaner way of getting objects by simple queries without turning to SQL.
- They work by appending the name of an attribute to find_by_, so you get finders like Person.find_by_user_name,
- Payment.find_by_transaction_id. So instead of writing Person.find_first(["user_name = ?", user_name]), you just do
- Person.find_by_user_name(user_name).
-
- It's also possible to use multiple attributes in the same find by separating them with "_and_", so you get finders like
- Person.find_by_user_name_and_password or even Payment.find_by_purchaser_and_state_and_country. So instead of writing
- Person.find_first(["user_name = ? AND password = ?", user_name, password]), you just do
- Person.find_by_user_name_and_password(user_name, password).
-
- While primarily a construct for easier find_firsts, it can also be used as a construct for find_all by using calls like
- Payment.find_all_by_amount(50) that is turned into Payment.find_all(["amount = ?", 50]). This is something not as equally useful,
- though, as it's not possible to specify the order in which the objects are returned.
-
-* Added block-style for callbacks #332 [Jeremy Kemper].
-
- Before:
- before_destroy(Proc.new{ |record| Person.destroy_all "firm_id = #{record.id}" })
-
- After:
- before_destroy { |record| Person.destroy_all "firm_id = #{record.id}" }
-
-* Added :counter_cache option to acts_as_tree that works just like the one you can define on belongs_to #371 [Josh]
-
-* Added Base.default_timezone accessor that determines whether to use Time.local (using :local) or Time.utc (using :utc) when pulling dates
- and times from the database. This is set to :local by default.
-
-* Added the possibility for adapters to overwrite add_limit! to implement a different limiting scheme than "LIMIT X" used by MySQL, PostgreSQL, and SQLite.
-
-* Added the possibility of having objects with acts_as_list created before their scope is available or...
-
-* Added a db2 adapter that only depends on the Ruby/DB2 bindings (http://raa.ruby-lang.org/project/ruby-db2/) #386 [Maik Schmidt]
-
-* Added the final touches to the Microsoft SQL Server adapter by Joey Gibson that makes it suitable for actual use #394 [DeLynn Barry]
-
-* Added that Base#find takes an optional options hash, including :conditions. Base#find_on_conditions deprecated in favor of #find with :conditions #407 [Jeremy Kemper]
-
-* Added HasManyAssociation#count that works like Base#count #413 [intinig]
-
-* Fixed handling of binary content in blobs and similar fields for Ruby/MySQL and SQLite #409 [xal]
-
-* Fixed a bug in the Ruby/MySQL that caused binary content to be escaped badly and come back mangled #405 [Tobias Luetke]
-
-* Fixed that the const_missing autoload assumes the requested constant is set by require_association and calls const_get to retrieve it.
- If require_association did not set the constant then const_get will call const_missing, resulting in an infinite loop #380 [Jeremy Kemper]
-
-* Fixed broken transactions that were actually only running object-level and not db level transactions [andreas]
-
-* Fixed that validates_uniqueness_of used 'id' instead of defined primary key #406
-
-* Fixed that the overwritten respond_to? method didn't take two parameters like the original #391
-
-* Fixed quoting in validates_format_of that would allow some rules to pass regardless of input #390 [Dmitry V. Sabanin]
-
-
-*1.3.0* (December 23, 2004)
-
-* Added a require_association hook on const_missing that makes it possible to use any model class without requiring it first. This makes STI look like:
-
- before:
- require_association 'person'
- class Employee < Person
- end
-
- after:
- class Employee < Person
- end
-
- This also reduces the usefulness of Controller.model in Action Pack to currently only being for documentation purposes.
-
-* Added that Base.update_all and Base.delete_all return an integer of the number of affected rows #341
-
-* Added scope option to validation_uniqueness #349 [Kent Sibilev]
-
-* Added respondence to *_before_type_cast for all attributes to return their string-state before they were type casted by the column type.
- This is helpful for getting "100,000" back on a integer-based validation where the value would normally be "100".
-
-* Added allow_nil options to validates_inclusion_of so that validation is only triggered if the attribute is not nil [what-a-day]
-
-* Added work-around for PostgreSQL and the problem of getting fixtures to be created from id 1 on each test case.
- This only works for auto-incrementing primary keys called "id" for now #359 [Scott Baron]
-
-* Added Base#clear_association_cache to empty all the cached associations #347 [Tobias Luetke]
-
-* Added more informative exceptions in establish_connection #356 [Jeremy Kemper]
-
-* Added Base#update_attributes that'll accept a hash of attributes and save the record (returning true if it passed validation, false otherwise).
-
- Before:
- person.attributes = @params["person"]
- person.save
-
- Now:
- person.update_attributes(@params["person"])
-
-* Added Base.destroy and Base.delete to remove records without holding a reference to them first.
-
-* Added that query benchmarking will only happen if its going to be logged anyway #344
-
-* Added higher_item and lower_item as public methods for acts_as_list #342 [Tobias Luetke]
-
-* Fixed that options[:counter_sql] was overwritten with interpolated sql rather than original sql #355 [Jeremy Kemper]
-
-* Fixed that overriding an attribute's accessor would be disregarded by add_on_empty and add_on_boundary_breaking because they simply used
- the attributes[] hash instead of checking for @base.respond_to?(attr.to_s). [Marten]
-
-* Fixed that Base.table_name would expect a parameter when used in has_and_belongs_to_many joins [Anna Lissa Cruz]
-
-* Fixed that nested transactions now work by letting the outer most transaction have the responsibilty of starting and rolling back the transaction.
- If any of the inner transactions swallow the exception raised, though, the transaction will not be rolled back. So always let the transaction
- bubble up even when you've dealt with local issues. Closes #231 and #340.
-
-* Fixed validates_{confirmation,acceptance}_of to only happen when the virtual attributes are not nil #348 [dpiddy@gmail.com]
-
-* Changed the interface on AbstractAdapter to require that adapters return the number of affected rows on delete and update operations.
-
-* Fixed the automated timestamping feature when running under Rails' development environment that resets the inheritable attributes on each request.
-
-
-
-*1.2.0*
-
-* Added Base.validates_inclusion_of that validates whether the value of the specified attribute is available in a particular enumerable
- object. [what-a-day]
-
- class Person < ActiveRecord::Base
- validates_inclusion_of :gender, :in=>%w( m f ), :message=>"woah! what are you then!??!!"
- validates_inclusion_of :age, :in=>0..99
- end
-
-* Added acts_as_list that can decorates an existing class with methods like move_higher/lower, move_to_top/bottom. [Tobias Luetke] Example:
-
- class TodoItem < ActiveRecord::Base
- acts_as_list :scope => :todo_list_id
- belongs_to :todo_list
- end
-
-* Added acts_as_tree that can decorates an existing class with a many to many relationship with itself. Perfect for categories in
- categories and the likes. [Tobias Luetke]
-
-* Added that Active Records will automatically record creation and/or update timestamps of database objects if fields of the names
- created_at/created_on or updated_at/updated_on are present. [Tobias Luetke]
-
-* Added Base.default_error_messages as a hash of all the error messages used in the validates_*_of so they can be changed in one place [Tobias Luetke]
-
-* Added automatic transaction block around AssociationCollection.<<, AssociationCollection.delete, and AssociationCollection.destroy_all
-
-* Fixed that Base#find will return an array if given an array -- regardless of the number of elements #270 [Marten]
-
-* Fixed that has_and_belongs_to_many would generate bad sql when naming conventions differed from using vanilla "id" everywhere [RedTerror]
-
-* Added a better exception for when a type column is used in a table without the intention of triggering single-table inheritance. Example:
-
- ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass: 'bad_class!'.
- This error is raised because the column 'type' is reserved for storing the class in case of inheritance.
- Please rename this column if you didn't intend it to be used for storing the inheritance class or
- overwrite Company.inheritance_column to use another column for that information.
-
-* Added that single-table inheritance will only kick in if the inheritance_column (by default "type") is present. Otherwise, inheritance won't
- have any magic side effects.
-
-* Added the possibility of marking fields as being in error without adding a message (using nil) to it that'll get displayed wth full_messages #208 [mjobin]
-
-* Fixed Base.errors to be indifferent as to whether strings or symbols are used. Examples:
-
- Before:
- errors.add(:name, "must be shorter") if name.size > 10
- errors.on(:name) # => "must be shorter"
- errors.on("name") # => nil
-
- After:
- errors.add(:name, "must be shorter") if name.size > 10
- errors.on(:name) # => "must be shorter"
- errors.on("name") # => "must be shorter"
-
-* Added Base.validates_format_of that Validates whether the value of the specified attribute is of the correct form by matching
- it against the regular expression provided. [Marcel]
-
- class Person < ActiveRecord::Base
- validates_format_of :email, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/, :on => :create
- end
-
-* Added Base.validates_length_of that delegates to add_on_boundary_breaking #312 [Tobias Luetke]. Example:
-
- Validates that the specified attribute matches the length restrictions supplied in either:
-
- - configuration[:minimum]
- - configuration[:maximum]
- - configuration[:is]
- - configuration[:within] (aka. configuration[:in])
-
- Only one option can be used at a time.
-
- class Person < ActiveRecord::Base
- validates_length_of :first_name, :maximum=>30
- validates_length_of :last_name, :maximum=>30, :message=>"less than %d if you don't mind"
- validates_length_of :user_name, :within => 6..20, :too_long => "pick a shorter name", :too_short => "pick a longer name"
- validates_length_of :fav_bra_size, :minimum=>1, :too_short=>"please enter at least %d character"
- validates_length_of :smurf_leader, :is=>4, :message=>"papa is spelled with %d characters... don't play me."
- end
-
-* Added Base.validate_presence as an alternative to implementing validate and doing errors.add_on_empty yourself.
-
-* Added Base.validates_uniqueness_of that alidates whether the value of the specified attributes are unique across the system.
- Useful for making sure that only one user can be named "davidhh".
-
- class Person < ActiveRecord::Base
- validates_uniqueness_of :user_name
- end
-
- When the record is created, a check is performed to make sure that no record exist in the database with the given value for the specified
- attribute (that maps to a column). When the record is updated, the same check is made but disregarding the record itself.
-
-
-* Added Base.validates_confirmation_of that encapsulates the pattern of wanting to validate a password or email address field with a confirmation. Example:
-
- Model:
- class Person < ActiveRecord::Base
- validates_confirmation_of :password
- end
-
- View:
- <%= password_field "person", "password" %>
- <%= password_field "person", "password_confirmation" %>
-
- The person has to already have a password attribute (a column in the people table), but the password_confirmation is virtual.
- It exists only as an in-memory variable for validating the password. This check is performed both on create and update.
-
-
-* Added Base.validates_acceptance_of that encapsulates the pattern of wanting to validate the acceptance of a terms of service check box (or similar agreement). Example:
-
- class Person < ActiveRecord::Base
- validates_acceptance_of :terms_of_service
- end
-
- The terms_of_service attribute is entirely virtual. No database column is needed. This check is performed both on create and update.
-
- NOTE: The agreement is considered valid if it's set to the string "1". This makes it easy to relate it to an HTML checkbox.
-
-
-* Added validation macros to make the stackable just like the lifecycle callbacks. Examples:
-
- class Person < ActiveRecord::Base
- validate { |record| record.errors.add("name", "too short") unless name.size > 10 }
- validate { |record| record.errors.add("name", "too long") unless name.size < 20 }
- validate_on_create :validate_password
-
- private
- def validate_password
- errors.add("password", "too short") unless password.size > 6
- end
- end
-
-* Added the option for sanitizing find_by_sql and the offset parts in regular finds [Sam Stephenson]. Examples:
-
- Project.find_all ["category = ?", category_name], "created ASC", ["? OFFSET ?", 15, 20]
- Post.find_by_sql ["SELECT * FROM posts WHERE author = ? AND created > ?", author_id, start_date]
-
-* Fixed value quoting in all generated SQL statements, so that integers are not surrounded in quotes and that all sanitation are happening
- through the database's own quoting routine. This should hopefully make it lots easier for new adapters that doesn't accept '1' for integer
- columns.
-
-* Fixed has_and_belongs_to_many guessing of foreign key so that keys are generated correctly for models like SomeVerySpecialClient
- [Florian Weber]
-
-* Added counter_sql option for has_many associations [Jeremy Kemper]. Documentation:
-
- :counter_sql - specify a complete SQL statement to fetch the size of the association. If +:finder_sql+ is
- specified but +:counter_sql+, +:counter_sql+ will be generated by replacing SELECT ... FROM with SELECT COUNT(*) FROM.
-
-* Fixed that methods wrapped in callbacks still return their original result #260 [Jeremy Kemper]
-
-* Fixed the Inflector to handle the movie/movies pair correctly #261 [Scott Baron]
-
-* Added named bind-style variable interpolation #281 [Michael Koziarski]. Example:
-
- Person.find(["id = :id and first_name = :first_name", { :id => 5, :first_name = "bob' or 1=1" }])
-
-* Added bind-style variable interpolation for the condition arrays that uses the adapter's quote method [Michael Koziarski]
-
- Before:
- find_first([ "user_name = '%s' AND password = '%s'", user_name, password ])]
- find_first([ "firm_id = %s", firm_id ])] # unsafe!
-
- After:
- find_first([ "user_name = ? AND password = ?", user_name, password ])]
- find_first([ "firm_id = ?", firm_id ])]
-
-* Added CSV format for fixtures #272 [what-a-day]. (See the new and expanded documentation on fixtures for more information)
-
-* Fixed fixtures using primary key fields called something else than "id" [dave]
-
-* Added proper handling of time fields that are turned into Time objects with the dummy date of 2000/1/1 [HariSeldon]
-
-* Added reverse order of deleting fixtures, so referential keys can be maintained #247 [Tim Bates]
-
-* Added relative path search for sqlite dbfiles in database.yml (if RAILS_ROOT is defined) #233 [Jeremy Kemper]
-
-* Added option to establish_connection where you'll be able to leave out the parameter to have it use the RAILS_ENV environment variable
-
-* Fixed problems with primary keys and postgresql sequences (#230) [Tim Bates]
-
-* Added reloading for associations under cached environments like FastCGI and mod_ruby. This makes it possible to use those environments for development.
- This is turned on by default, but can be turned off with ActiveRecord::Base.reload_dependencies = false in production environments.
-
- NOTE: This will only have an effect if you let the associations manage the requiring of model classes. All libraries loaded through
- require will be "forever" cached. You can, however, use ActiveRecord::Base.load_or_require("library") to get this behavior outside of the
- auto-loading associations.
-
-* Added ERB capabilities to the fixture files for dynamic fixture generation. You don't need to do anything, just include ERB blocks like:
-
- david:
- id: 1
- name: David
-
- jamis:
- id: 2
- name: Jamis
-
- <% for digit in 3..10 %>
- dev_<%= digit %>:
- id: <%= digit %>
- name: fixture_<%= digit %>
- <% end %>
-
-* Changed the yaml fixture searcher to look in the root of the fixtures directory, so when you before could have something like:
-
- fixtures/developers/fixtures.yaml
- fixtures/accounts/fixtures.yaml
-
- ...you now need to do:
-
- fixtures/developers.yaml
- fixtures/accounts.yaml
-
-* Changed the fixture format from:
-
- name: david
- data:
- id: 1
- name: David Heinemeier Hansson
- birthday: 1979-10-15
- profession: Systems development
- ---
- name: steve
- data:
- id: 2
- name: Steve Ross Kellock
- birthday: 1974-09-27
- profession: guy with keyboard
-
- ...to:
-
- david:
- id: 1
- name: David Heinemeier Hansson
- birthday: 1979-10-15
- profession: Systems development
-
- steve:
- id: 2
- name: Steve Ross Kellock
- birthday: 1974-09-27
- profession: guy with keyboard
-
- The change is NOT backwards compatible. Fixtures written in the old YAML style needs to be rewritten!
-
-* All associations will now attempt to require the classes that they associate to. Relieving the need for most explicit 'require' statements.
-
-
-*1.1.0* (34)
-
-* Added automatic fixture setup and instance variable availability. Fixtures can also be automatically
- instantiated in instance variables relating to their names using the following style:
-
- class FixturesTest < Test::Unit::TestCase
- fixtures :developers # you can add more with comma separation
-
- def test_developers
- assert_equal 3, @developers.size # the container for all the fixtures is automatically set
- assert_kind_of Developer, @david # works like @developers["david"].find
- assert_equal "David Heinemeier Hansson", @david.name
- end
- end
-
-* Added HasAndBelongsToManyAssociation#push_with_attributes(object, join_attributes) that can create associations in the join table with additional
- attributes. This is really useful when you have information that's only relevant to the join itself, such as a "added_on" column for an association
- between post and category. The added attributes will automatically be injected into objects retrieved through the association similar to the piggy-back
- approach:
-
- post.categories.push_with_attributes(category, :added_on => Date.today)
- post.categories.first.added_on # => Date.today
-
- NOTE: The categories table doesn't have a added_on column, it's the categories_post join table that does!
-
-* Fixed that :exclusively_dependent and :dependent can't be activated at the same time on has_many associations [Jeremy Kemper]
-
-* Fixed that database passwords couldn't be all numeric [Jeremy Kemper]
-
-* Fixed that calling id would create the instance variable for new_records preventing them from being saved correctly [Jeremy Kemper]
-
-* Added sanitization feature to HasManyAssociation#find_all so it works just like Base.find_all [Sam Stephenson/bitsweat]
-
-* Added that you can pass overlapping ids to find without getting duplicated records back [Jeremy Kemper]
-
-* Added that Base.benchmark returns the result of the block [Jeremy Kemper]
-
-* Fixed problem with unit tests on Windows with SQLite [paterno]
-
-* Fixed that quotes would break regular non-yaml fixtures [Dmitry Sabanin/daft]
-
-* Fixed fixtures on windows with line endings cause problems under unix / mac [Tobias Luetke]
-
-* Added HasAndBelongsToManyAssociation#find(id) that'll search inside the collection and find the object or record with that id
-
-* Added :conditions option to has_and_belongs_to_many that works just like the one on all the other associations
-
-* Added AssociationCollection#clear to remove all associations from has_many and has_and_belongs_to_many associations without destroying the records [geech]
-
-* Added type-checking and remove in 1-instead-of-N sql statements to AssociationCollection#delete [geech]
-
-* Added a return of self to AssociationCollection#<< so appending can be chained, like project << Milestone.create << Milestone.create [geech]
-
-* Added Base#hash and Base#eql? which means that all of the equality using features of array and other containers now works:
-
- [ Person.find(1), Person.find(2), Person.find(3) ] & [ Person.find(1), Person.find(4) ] # => [ Person.find(1) ]
-
-* Added :uniq as an option to has_and_belongs_to_many which will automatically ensure that AssociateCollection#uniq is called
- before pulling records out of the association. This is especially useful for three-way (and above) has_and_belongs_to_many associations.
-
-* Added AssociateCollection#uniq which is especially useful for has_and_belongs_to_many associations that can include duplicates,
- which is common on associations that also use metadata. Usage: post.categories.uniq
-
-* Fixed respond_to? to use a subclass specific hash instead of an Active Record-wide one
-
-* Fixed has_and_belongs_to_many to treat associations between classes in modules properly [Florian Weber]
-
-* Added a NoMethod exception to be raised when query and writer methods are called for attributes that doesn't exist [geech]
-
-* Added a more robust version of Fixtures that throws meaningful errors when on formatting issues [geech]
-
-* Added Base#transaction as a compliment to Base.transaction for prettier use in instance methods [geech]
-
-* Improved the speed of respond_to? by placing the dynamic methods lookup table in a hash [geech]
-
-* Added that any additional fields added to the join table in a has_and_belongs_to_many association
- will be placed as attributes when pulling records out through has_and_belongs_to_many associations.
- This is helpful when have information about the association itself that you want available on retrival.
-
-* Added better loading exception catching and RubyGems retries to the database adapters [alexeyv]
-
-* Fixed bug with per-model transactions [daniel]
-
-* Fixed Base#transaction so that it returns the result of the last expression in the transaction block [alexeyv]
-
-* Added Fixture#find to find the record corresponding to the fixture id. The record
- class name is guessed by using Inflector#classify (also new) on the fixture directory name.
-
- Before: Document.find(@documents["first"]["id"])
- After : @documents["first"].find
-
-* Fixed that the table name part of column names ("TABLE.COLUMN") wasn't removed properly [Andreas Schwarz]
-
-* Fixed a bug with Base#size when a finder_sql was used that didn't capitalize SELECT and FROM [geech]
-
-* Fixed quoting problems on SQLite by adding quote_string to the AbstractAdapter that can be overwritten by the concrete
- adapters for a call to the dbm. [Andreas Schwarz]
-
-* Removed RubyGems backup strategy for requiring SQLite-adapter -- if people want to use gems, they're already doing it with AR.
-
-
-*1.0.0 (35)*
-
-* Added OO-style associations methods [Florian Weber]. Examples:
-
- Project#milestones_count => Project#milestones.size
- Project#build_to_milestones => Project#milestones.build
- Project#create_for_milestones => Project#milestones.create
- Project#find_in_milestones => Project#milestones.find
- Project#find_all_in_milestones => Project#milestones.find_all
-
-* Added serialize as a new class method to control when text attributes should be YAMLized or not. This means that automated
- serialization of hashes, arrays, and so on WILL NO LONGER HAPPEN (#10). You need to do something like this:
-
- class User < ActiveRecord::Base
- serialize :settings
- end
-
- This will assume that settings is a text column and will now YAMLize any object put in that attribute. You can also specify
- an optional :class_name option that'll raise an exception if a serialized object is retrieved as a descendent of a class not in
- the hierarchy. Example:
-
- class User < ActiveRecord::Base
- serialize :settings, :class_name => "Hash"
- end
-
- user = User.create("settings" => %w( one two three ))
- User.find(user.id).settings # => raises SerializationTypeMismatch
-
-* Added the option to connect to a different database for one model at a time. Just call establish_connection on the class
- you want to have connected to another database than Base. This will automatically also connect decendents of that class
- to the different database [Renald Buter].
-
-* Added transactional protection for Base#save. Validations can now check for values knowing that it happens in a transaction and callbacks
- can raise exceptions knowing that the save will be rolled back. [Suggested by Alexey Verkhovsky]
-
-* Added column name quoting so reserved words, such as "references", can be used as column names [Ryan Platte]
-
-* Added the possibility to chain the return of what happened inside a logged block [geech]:
-
- This now works:
- log { ... }.map { ... }
-
- Instead of doing:
- result = []
- log { result = ... }
- result.map { ... }
-
-* Added "socket" option for the MySQL adapter, so you can change it to something else than "/tmp/mysql.sock" [Anna Lissa Cruz]
-
-* Added respond_to? answers for all the attribute methods. So if Person has a name attribute retrieved from the table schema,
- person.respond_to? "name" will return true.
-
-* Added Base.benchmark which can be used to aggregate logging and benchmark, so you can measure and represent multiple statements in a single block.
- Usage (hides all the SQL calls for the individual actions and calculates total runtime for them all):
-
- Project.benchmark("Creating project") do
- project = Project.create("name" => "stuff")
- project.create_manager("name" => "David")
- project.milestones << Milestone.find_all
- end
-
-* Added logging of invalid SQL statements [Suggested by Daniel Von Fange]
-
-* Added alias Errors#[] for Errors#on, so you can now say person.errors["name"] to retrieve the errors for name [Andreas Schwarz]
-
-* Added RubyGems require attempt if sqlite-ruby is not available through regular methods.
-
-* Added compatibility with 2.x series of sqlite-ruby drivers. [Jamis Buck]
-
-* Added type safety for association assignments, so a ActiveRecord::AssociationTypeMismatch will be raised if you attempt to
- assign an object that's not of the associated class. This cures the problem with nil giving id = 4 and fixnums giving id = 1 on
- mistaken association assignments. [Reported by Andreas Schwarz]
-
-* Added the option to keep many fixtures in one single YAML document [what-a-day]
-
-* Added the class method "inheritance_column" that can be overwritten to return the name of an alternative column than "type" for storing
- the type for inheritance hierarchies. [Dave Steinberg]
-
-* Added [] and []= as an alternative way to access attributes when the regular methods have been overwritten [Dave Steinberg]
-
-* Added the option to observer more than one class at the time by specifying observed_class as an array
-
-* Added auto-id propagation support for tables with arbitrary primary keys that have autogenerated sequences associated with them
- on PostgreSQL. [Dave Steinberg]
-
-* Changed that integer and floats set to "" through attributes= remain as NULL. This was especially a problem for scaffolding and postgresql. (#49)
-
-* Changed the MySQL Adapter to rely on MySQL for its defaults for socket, host, and port [Andreas Schwarz]
-
-* Changed ActionControllerError to decent from StandardError instead of Exception. It can now be caught by a generic rescue.
-
-* Changed class inheritable attributes to not use eval [Caio Chassot]
-
-* Changed Errors#add to now use "invalid" as the default message instead of true, which means full_messages work with those [Marcel Molina Jr]
-
-* Fixed spelling on Base#add_on_boundry_breaking to Base#add_on_boundary_breaking (old naming still works) [Marcel Molina Jr.]
-
-* Fixed that entries in the has_and_belongs_to_many join table didn't get removed when an associated object was destroyed.
-
-* Fixed unnecessary calls to SET AUTOCOMMIT=0/1 for MySQL adapter [Andreas Schwarz]
-
-* Fixed PostgreSQL defaults are now handled gracefully [Dave Steinberg]
-
-* Fixed increment/decrement_counter are now atomic updates [Andreas Schwarz]
-
-* Fixed the problems the Inflector had turning Attachment into attuchments and Cases into Casis [radsaq/Florian Gross]
-
-* Fixed that cloned records would point attribute references on the parent object [Andreas Schwarz]
-
-* Fixed SQL for type call on inheritance hierarchies [Caio Chassot]
-
-* Fixed bug with typed inheritance [Florian Weber]
-
-* Fixed a bug where has_many collection_count wouldn't use the conditions specified for that association
-
-
-*0.9.5*
-
-* Expanded the table_name guessing rules immensely [Florian Green]. Documentation:
-
- Guesses the table name (in forced lower-case) based on the name of the class in the inheritance hierarchy descending
- directly from ActiveRecord. So if the hierarchy looks like: Reply < Message < ActiveRecord, then Message is used
- to guess the table name from even when called on Reply. The guessing rules are as follows:
- * Class name ends in "x", "ch" or "ss": "es" is appended, so a Search class becomes a searches table.
- * Class name ends in "y" preceded by a consonant or "qu": The "y" is replaced with "ies",
- so a Category class becomes a categories table.
- * Class name ends in "fe": The "fe" is replaced with "ves", so a Wife class becomes a wives table.
- * Class name ends in "lf" or "rf": The "f" is replaced with "ves", so a Half class becomes a halves table.
- * Class name ends in "person": The "person" is replaced with "people", so a Salesperson class becomes a salespeople table.
- * Class name ends in "man": The "man" is replaced with "men", so a Spokesman class becomes a spokesmen table.
- * Class name ends in "sis": The "i" is replaced with an "e", so a Basis class becomes a bases table.
- * Class name ends in "tum" or "ium": The "um" is replaced with an "a", so a Datum class becomes a data table.
- * Class name ends in "child": The "child" is replaced with "children", so a NodeChild class becomes a node_children table.
- * Class name ends in an "s": No additional characters are added or removed.
- * Class name doesn't end in "s": An "s" is appended, so a Comment class becomes a comments table.
- * Class name with word compositions: Compositions are underscored, so CreditCard class becomes a credit_cards table.
- Additionally, the class-level table_name_prefix is prepended to the table_name and the table_name_suffix is appended.
- So if you have "myapp_" as a prefix, the table name guess for an Account class becomes "myapp_accounts".
-
- You can also overwrite this class method to allow for unguessable links, such as a Mouse class with a link to a
- "mice" table. Example:
-
- class Mouse < ActiveRecord::Base
- def self.table_name() "mice" end
- end
-
- This conversion is now done through an external class called Inflector residing in lib/active_record/support/inflector.rb.
-
-* Added find_all_in_collection to has_many defined collections. Works like this:
-
- class Firm < ActiveRecord::Base
- has_many :clients
- end
-
- firm.id # => 1
- firm.find_all_in_clients "revenue > 1000" # SELECT * FROM clients WHERE firm_id = 1 AND revenue > 1000
-
- [Requested by Dave Thomas]
-
-* Fixed finders for inheritance hierarchies deeper than one level [Florian Weber]
-
-* Added add_on_boundry_breaking to errors to accompany add_on_empty as a default validation method. It's used like this:
-
- class Person < ActiveRecord::Base
- protected
- def validation
- errors.add_on_boundry_breaking "password", 3..20
- end
- end
-
- This will add an error to the tune of "is too short (minimum is 3 characters)" or "is too long (minimum is 20 characters)" if
- the password is outside the boundry. The messages can be changed by passing a third and forth parameter as message strings.
-
-* Implemented a clone method that works properly with AR. It returns a clone of the record that
- hasn't been assigned an id yet and is treated as a new record.
-
-* Allow for domain sockets in PostgreSQL by not assuming localhost when no host is specified [Scott Barron]
-
-* Fixed that bignums are saved properly instead of attempted to be YAMLized [Andreas Schwartz]
-
-* Fixed a bug in the GEM where the rdoc options weren't being passed according to spec [Chad Fowler]
-
-* Fixed a bug with the exclusively_dependent option for has_many
-
-
-*0.9.4*
-
-* Correctly guesses the primary key when the class is inside a module [Dave Steinberg].
-
-* Added [] and []= as alternatives to read_attribute and write_attribute [Dave Steinberg]
-
-* has_and_belongs_to_many now accepts an :order key to determine in which order the collection is returned [radsaq].
-
-* The ids passed to find and find_on_conditions are now automatically sanitized.
-
-* Added escaping of plings in YAML content.
-
-* Multi-parameter assigns where all the parameters are empty will now be set to nil instead of a new instance of their class.
-
-* Proper type within an inheritance hierarchy is now ensured already at object initialization (instead of first at create)
-
-
-*0.9.3*
-
-* Fixed bug with using a different primary key name together with has_and_belongs_to_many [Investigation by Scott]
-
-* Added :exclusively_dependent option to the has_many association macro. The doc reads:
-
- If set to true all the associated object are deleted in one SQL statement without having their
- before_destroy callback run. This should only be used on associations that depend solely on
- this class and don't need to do any clean-up in before_destroy. The upside is that it's much
- faster, especially if there's a counter_cache involved.
-
-* Added :port key to connection options, so the PostgreSQL and MySQL adapters can connect to a database server
- running on another port than the default.
-
-* Converted the new natural singleton methods that prevented AR objects from being saved by PStore
- (and hence be placed in a Rails session) to a module. [Florian Weber]
-
-* Fixed the use of floats (was broken since 0.9.0+)
-
-* Fixed PostgreSQL adapter so default values are displayed properly when used in conjunction with
- Action Pack scaffolding.
-
-* Fixed booleans support for PostgreSQL (use real true/false on boolean fields instead of 0/1 on tinyints) [radsaq]
-
-
-*0.9.2*
-
-* Added static method for instantly updating a record
-
-* Treat decimal and numeric as Ruby floats [Andreas Schwartz]
-
-* Treat chars as Ruby strings (fixes problem for Action Pack form helpers too)
-
-* Removed debugging output accidently left in (which would screw web applications)
-
-
-*0.9.1*
-
-* Added MIT license
-
-* Added natural object-style assignment for has_and_belongs_to_many associations. Consider the following model:
-
- class Event < ActiveRecord::Base
- has_one_and_belongs_to_many :sponsors
- end
-
- class Sponsor < ActiveRecord::Base
- has_one_and_belongs_to_many :sponsors
- end
-
- Earlier, you'd have to use synthetic methods for creating associations between two objects of the above class:
-
- roskilde_festival.add_to_sponsors(carlsberg)
- roskilde_festival.remove_from_sponsors(carlsberg)
-
- nike.add_to_events(world_cup)
- nike.remove_from_events(world_cup)
-
- Now you can use regular array-styled methods:
-
- roskilde_festival.sponsors << carlsberg
- roskilde_festival.sponsors.delete(carlsberg)
-
- nike.events << world_cup
- nike.events.delete(world_cup)
-
-* Added delete method for has_many associations. Using this will nullify an association between the has_many and the belonging
- object by setting the foreign key to null. Consider this model:
-
- class Post < ActiveRecord::Base
- has_many :comments
- end
-
- class Comment < ActiveRecord::Base
- belongs_to :post
- end
-
- You could do something like:
-
- funny_comment.has_post? # => true
- announcement.comments.delete(funny_comment)
- funny_comment.has_post? # => false
-
-
-*0.9.0*
-
-* Active Record is now thread safe! (So you can use it with Cerise and WEBrick applications)
- [Implementation idea by Michael Neumann, debugging assistance by Jamis Buck]
-
-* Improved performance by roughly 400% on a basic test case of pulling 100 records and querying one attribute.
- This brings the tax for using Active Record instead of "riding on the metal" (using MySQL-ruby C-driver directly) down to ~50%.
- Done by doing lazy type conversions and caching column information on the class-level.
-
-* Added callback objects and procs as options for implementing the target for callback macros.
-
-* Added "counter_cache" option to belongs_to that automates the usage of increment_counter and decrement_counter. Consider:
-
- class Post < ActiveRecord::Base
- has_many :comments
- end
-
- class Comment < ActiveRecord::Base
- belongs_to :post
- end
-
- Iterating over 100 posts like this:
-
- <% for post in @posts %>
- <%= post.title %> has <%= post.comments_count %> comments
- <% end %>
-
- Will generate 100 SQL count queries -- one for each call to post.comments_count. If you instead add a "comments_count" int column
- to the posts table and rewrite the comments association macro with:
-
- class Comment < ActiveRecord::Base
- belongs_to :post, :counter_cache => true
- end
-
- Those 100 SQL count queries will be reduced to zero. Beware that counter caching is only appropriate for objects that begin life
- with the object it's specified to belong with and is destroyed like that as well. Typically objects where you would also specify
- :dependent => true. If your objects switch from one belonging to another (like a post that can be move from one category to another),
- you'll have to manage the counter yourself.
-
-* Added natural object-style assignment for has_one and belongs_to associations. Consider the following model:
-
- class Project < ActiveRecord::Base
- has_one :manager
- end
-
- class Manager < ActiveRecord::Base
- belongs_to :project
- end
-
- Earlier, assignments would work like following regardless of which way the assignment told the best story:
-
- active_record.manager_id = david.id
-
- Now you can do it either from the belonging side:
-
- david.project = active_record
-
- ...or from the having side:
-
- active_record.manager = david
-
- If the assignment happens from the having side, the assigned object is automatically saved. So in the example above, the
- project_id attribute on david would be set to the id of active_record, then david would be saved.
-
-* Added natural object-style assignment for has_many associations [Florian Weber]. Consider the following model:
-
- class Project < ActiveRecord::Base
- has_many :milestones
- end
-
- class Milestone < ActiveRecord::Base
- belongs_to :project
- end
-
- Earlier, assignments would work like following regardless of which way the assignment told the best story:
-
- deadline.project_id = active_record.id
-
- Now you can do it either from the belonging side:
-
- deadline.project = active_record
-
- ...or from the having side:
-
- active_record.milestones << deadline
-
- The milestone is automatically saved with the new foreign key.
-
-* API CHANGE: Attributes for text (or blob or similar) columns will now have unknown classes stored using YAML instead of using
- to_s. (Known classes that won't be yamelized are: String, NilClass, TrueClass, FalseClass, Fixnum, Date, and Time).
- Likewise, data pulled out of text-based attributes will be attempted converged using Yaml if they have the "--- " header.
- This was primarily done to be enable the storage of hashes and arrays without wrapping them in aggregations, so now you can do:
-
- user = User.find(1)
- user.preferences = { "background" => "black", "display" => large }
- user.save
-
- User.find(1).preferences # => { "background" => "black", "display" => large }
-
- Please note that this method should only be used when you don't care about representing the object in proper columns in
- the database. A money object consisting of an amount and a currency is still a much better fit for a value object done through
- aggregations than this new option.
-
-* POSSIBLE CODE BREAKAGE: As a consequence of the lazy type conversions, it's a bad idea to reference the @attributes hash
- directly (it always was, but now it's paramount that you don't). If you do, you won't get the type conversion. So to implement
- new accessors for existing attributes, use read_attribute(attr_name) and write_attribute(attr_name, value) instead. Like this:
-
- class Song < ActiveRecord::Base
- # Uses an integer of seconds to hold the length of the song
-
- def length=(minutes)
- write_attribute("length", minutes * 60)
- end
-
- def length
- read_attribute("length") / 60
- end
- end
-
- The clever kid will notice that this opens a door to sidestep the automated type conversion by using @attributes directly.
- This is not recommended as read/write_attribute may be granted additional responsibilities in the future, but if you think
- you know what you're doing and aren't afraid of future consequences, this is an option.
-
-* Applied a few minor bug fixes reported by Daniel Von Fange.
-
-
-*0.8.4*
-
-_Reflection_
-
-* Added ActiveRecord::Reflection with a bunch of methods and classes for reflecting in aggregations and associations.
-
-* Added Base.columns and Base.content_columns which returns arrays of column description (type, default, etc) objects.
-
-* Added Base#attribute_names which returns an array of names for the attributes available on the object.
-
-* Added Base#column_for_attribute(name) which returns the column description object for the named attribute.
-
-
-_Misc_
-
-* Added multi-parameter assignment:
-
- # Instantiate objects for all attribute classes that needs more than one constructor parameter. This is done
- # by calling new on the column type or aggregation type (through composed_of) object with these parameters.
- # So having the pairs written_on(1) = "2004", written_on(2) = "6", written_on(3) = "24", will instantiate
- # written_on (a date type) with Date.new("2004", "6", "24"). You can also specify a typecast character in the
- # parenteses to have the parameters typecasted before they're used in the constructor. Use i for Fixnum, f for Float,
- # s for String, and a for Array.
-
- This is incredibly useful for assigning dates from HTML drop-downs of month, year, and day.
-
-* Fixed bug with custom primary key column name and Base.find on multiple parameters.
-
-* Fixed bug with dependent option on has_one associations if there was no associated object.
-
-
-*0.8.3*
-
-_Transactions_
-
-* Added transactional protection for destroy (important for the new :dependent option) [Suggested by Carl Youngblood]
-
-* Fixed so transactions are ignored on MyISAM tables for MySQL (use InnoDB to get transactions)
-
-* Changed transactions so only exceptions will cause a rollback, not returned false.
-
-
-_Mapping_
-
-* Added support for non-integer primary keys [Aredridel/earlier work by Michael Neumann]
-
- User.find "jdoe"
- Product.find "PDKEY-INT-12"
-
-* Added option to specify naming method for primary key column. ActiveRecord::Base.primary_key_prefix_type can either
- be set to nil, :table_name, or :table_name_with_underscore. :table_name will assume that Product class has a primary key
- of "productid" and :table_name_with_underscore will assume "product_id". The default nil will just give "id".
-
-* Added an overwriteable primary_key method that'll instruct AR to the name of the
- id column [Aredridele/earlier work by Guan Yang]
-
- class Project < ActiveRecord::Base
- def self.primary_key() "project_id" end
- end
-
-* Fixed that Active Records can safely associate inside and out of modules.
-
- class MyApplication::Account < ActiveRecord::Base
- has_many :clients # will look for MyApplication::Client
- has_many :interests, :class_name => "Business::Interest" # will look for Business::Interest
- end
-
-* Fixed that Active Records can safely live inside modules [Aredridel]
-
- class MyApplication::Account < ActiveRecord::Base
- end
-
-
-_Misc_
-
-* Added freeze call to value object assignments to ensure they remain immutable [Spotted by Gavin Sinclair]
-
-* Changed interface for specifying observed class in observers. Was OBSERVED_CLASS constant, now is
- observed_class() class method. This is more consistant with things like self.table_name(). Works like this:
-
- class AuditObserver < ActiveRecord::Observer
- def self.observed_class() Account end
- def after_update(account)
- AuditTrail.new(account, "UPDATED")
- end
- end
-
- [Suggested by Gavin Sinclair]
-
-* Create new Active Record objects by setting the attributes through a block. Like this:
-
- person = Person.new do |p|
- p.name = 'Freddy'
- p.age = 19
- end
-
- [Suggested by Gavin Sinclair]
-
-
-*0.8.2*
-
-* Added inheritable callback queues that can ensure that certain callback methods or inline fragments are
- run throughout the entire inheritance hierarchy. Regardless of whether a descendent overwrites the callback
- method:
-
- class Topic < ActiveRecord::Base
- before_destroy :destroy_author, 'puts "I'm an inline fragment"'
- end
-
- Learn more in link:classes/ActiveRecord/Callbacks.html
-
-* Added :dependent option to has_many and has_one, which will automatically destroy associated objects when
- the holder is destroyed:
-
- class Album < ActiveRecord::Base
- has_many :tracks, :dependent => true
- end
-
- All the associated tracks are destroyed when the album is.
-
-* Added Base.create as a factory that'll create, save, and return a new object in one step.
-
-* Automatically convert strings in config hashes to symbols for the _connection methods. This allows you
- to pass the argument hashes directly from yaml. (Luke)
-
-* Fixed the install.rb to include simple.rb [Spotted by Kevin Bullock]
-
-* Modified block syntax to better follow our code standards outlined in
- http://www.rubyonrails.org/CodingStandards
-
-
-*0.8.1*
-
-* Added object-level transactions [Thanks to Austin Ziegler for Transaction::Simple]
-
-* Changed adapter-specific connection methods to use centralized ActiveRecord::Base.establish_connection,
- which is parametized through a config hash with symbol keys instead of a regular parameter list.
- This will allow for database connections to be opened in a more generic fashion. (Luke)
-
- NOTE: This requires all *_connections to be updated! Read more in:
- http://ar.rubyonrails.org/classes/ActiveRecord/Base.html#M000081
-
-* Fixed SQLite adapter so objects fetched from has_and_belongs_to_many have proper attributes
- (t.name is now name). [Spotted by Garrett Rooney]
-
-* Fixed SQLite adapter so dates are returned as Date objects, not Time objects [Spotted by Gavin Sinclair]
-
-* Fixed requirement of date class, so date conversions are succesful regardless of whether you
- manually require date or not.
-
-
-*0.8.0*
-
-* Added transactions
-
-* Changed Base.find to also accept either a list (1, 5, 6) or an array of ids ([5, 7])
- as parameter and then return an array of objects instead of just an object
-
-* Fixed method has_collection? for has_and_belongs_to_many macro to behave as a
- collection, not an association
-
-* Fixed SQLite adapter so empty or nil values in columns of datetime, date, or time type
- aren't treated as current time [Spotted by Gavin Sinclair]
-
-
-*0.7.6*
-
-* Fixed the install.rb to create the lib/active_record/support directory [Spotted by Gavin Sinclair]
-* Fixed that has_association? would always return true [Spotted by Daniel Von Fange]
diff --git a/vendor/rails/activerecord/MIT-LICENSE b/vendor/rails/activerecord/MIT-LICENSE
deleted file mode 100644
index 93be57f6..00000000
--- a/vendor/rails/activerecord/MIT-LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-Copyright (c) 2004-2008 David Heinemeier Hansson
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/vendor/rails/activerecord/README b/vendor/rails/activerecord/README
deleted file mode 100755
index d68eb28a..00000000
--- a/vendor/rails/activerecord/README
+++ /dev/null
@@ -1,351 +0,0 @@
-= Active Record -- Object-relation mapping put on rails
-
-Active Record connects business objects and database tables to create a persistable
-domain model where logic and data are presented in one wrapping. It's an implementation
-of the object-relational mapping (ORM) pattern[http://www.martinfowler.com/eaaCatalog/activeRecord.html]
-by the same name as described by Martin Fowler:
-
- "An object that wraps a row in a database table or view, encapsulates
- the database access, and adds domain logic on that data."
-
-Active Record's main contribution to the pattern is to relieve the original of two stunting problems:
-lack of associations and inheritance. By adding a simple domain language-like set of macros to describe
-the former and integrating the Single Table Inheritance pattern for the latter, Active Record narrows the
-gap of functionality between the data mapper and active record approach.
-
-A short rundown of the major features:
-
-* Automated mapping between classes and tables, attributes and columns.
-
- class Product < ActiveRecord::Base; end
-
- ...is automatically mapped to the table named "products", such as:
-
- CREATE TABLE products (
- id int(11) NOT NULL auto_increment,
- name varchar(255),
- PRIMARY KEY (id)
- );
-
- ...which again gives Product#name and Product#name=(new_name)
-
- {Learn more}[link:classes/ActiveRecord/Base.html]
-
-
-* Associations between objects controlled by simple meta-programming macros.
-
- class Firm < ActiveRecord::Base
- has_many :clients
- has_one :account
- belongs_to :conglomorate
- end
-
- {Learn more}[link:classes/ActiveRecord/Associations/ClassMethods.html]
-
-
-* Aggregations of value objects controlled by simple meta-programming macros.
-
- class Account < ActiveRecord::Base
- composed_of :balance, :class_name => "Money",
- :mapping => %w(balance amount)
- composed_of :address,
- :mapping => [%w(address_street street), %w(address_city city)]
- end
-
- {Learn more}[link:classes/ActiveRecord/Aggregations/ClassMethods.html]
-
-
-* Validation rules that can differ for new or existing objects.
-
- class Account < ActiveRecord::Base
- validates_presence_of :subdomain, :name, :email_address, :password
- validates_uniqueness_of :subdomain
- validates_acceptance_of :terms_of_service, :on => :create
- validates_confirmation_of :password, :email_address, :on => :create
- end
-
- {Learn more}[link:classes/ActiveRecord/Validations.html]
-
-* Callbacks as methods or queues on the entire lifecycle (instantiation, saving, destroying, validating, etc).
-
- class Person < ActiveRecord::Base
- def before_destroy # is called just before Person#destroy
- CreditCard.find(credit_card_id).destroy
- end
- end
-
- class Account < ActiveRecord::Base
- after_find :eager_load, 'self.class.announce(#{id})'
- end
-
- {Learn more}[link:classes/ActiveRecord/Callbacks.html]
-
-
-* Observers for the entire lifecycle
-
- class CommentObserver < ActiveRecord::Observer
- def after_create(comment) # is called just after Comment#save
- Notifications.deliver_new_comment("david@loudthinking.com", comment)
- end
- end
-
- {Learn more}[link:classes/ActiveRecord/Observer.html]
-
-
-* Inheritance hierarchies
-
- class Company < ActiveRecord::Base; end
- class Firm < Company; end
- class Client < Company; end
- class PriorityClient < Client; end
-
- {Learn more}[link:classes/ActiveRecord/Base.html]
-
-
-* Transactions
-
- # Database transaction
- Account.transaction do
- david.withdrawal(100)
- mary.deposit(100)
- end
-
- {Learn more}[link:classes/ActiveRecord/Transactions/ClassMethods.html]
-
-
-* Reflections on columns, associations, and aggregations
-
- reflection = Firm.reflect_on_association(:clients)
- reflection.klass # => Client (class)
- Firm.columns # Returns an array of column descriptors for the firms table
-
- {Learn more}[link:classes/ActiveRecord/Reflection/ClassMethods.html]
-
-
-* Direct manipulation (instead of service invocation)
-
- So instead of (Hibernate[http://www.hibernate.org/] example):
-
- long pkId = 1234;
- DomesticCat pk = (DomesticCat) sess.load( Cat.class, new Long(pkId) );
- // something interesting involving a cat...
- sess.save(cat);
- sess.flush(); // force the SQL INSERT
-
- Active Record lets you:
-
- pkId = 1234
- cat = Cat.find(pkId)
- # something even more interesting involving the same cat...
- cat.save
-
- {Learn more}[link:classes/ActiveRecord/Base.html]
-
-
-* Database abstraction through simple adapters (~100 lines) with a shared connector
-
- ActiveRecord::Base.establish_connection(:adapter => "sqlite", :database => "dbfile")
-
- ActiveRecord::Base.establish_connection(
- :adapter => "mysql",
- :host => "localhost",
- :username => "me",
- :password => "secret",
- :database => "activerecord"
- )
-
- {Learn more}[link:classes/ActiveRecord/Base.html#M000081] and read about the built-in support for
- MySQL[link:classes/ActiveRecord/ConnectionAdapters/MysqlAdapter.html], PostgreSQL[link:classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html], SQLite[link:classes/ActiveRecord/ConnectionAdapters/SQLiteAdapter.html], Oracle[link:classes/ActiveRecord/ConnectionAdapters/OracleAdapter.html], SQLServer[link:classes/ActiveRecord/ConnectionAdapters/SQLServerAdapter.html], and DB2[link:classes/ActiveRecord/ConnectionAdapters/DB2Adapter.html].
-
-
-* Logging support for Log4r[http://log4r.sourceforge.net] and Logger[http://www.ruby-doc.org/stdlib/libdoc/logger/rdoc]
-
- ActiveRecord::Base.logger = Logger.new(STDOUT)
- ActiveRecord::Base.logger = Log4r::Logger.new("Application Log")
-
-
-* Database agnostic schema management with Migrations
-
- class AddSystemSettings < ActiveRecord::Migration
- def self.up
- create_table :system_settings do |t|
- t.string :name
- t.string :label
- t.text :value
- t.string :type
- t.integer :position
- end
-
- SystemSetting.create :name => "notice", :label => "Use notice?", :value => 1
- end
-
- def self.down
- drop_table :system_settings
- end
- end
-
- {Learn more}[link:classes/ActiveRecord/Migration.html]
-
-== Simple example (1/2): Defining tables and classes (using MySQL)
-
-Data definitions are specified only in the database. Active Record queries the database for
-the column names (that then serves to determine which attributes are valid) on regular
-object instantiation through the new constructor and relies on the column names in the rows
-with the finders.
-
- # CREATE TABLE companies (
- # id int(11) unsigned NOT NULL auto_increment,
- # client_of int(11),
- # name varchar(255),
- # type varchar(100),
- # PRIMARY KEY (id)
- # )
-
-Active Record automatically links the "Company" object to the "companies" table
-
- class Company < ActiveRecord::Base
- has_many :people, :class_name => "Person"
- end
-
- class Firm < Company
- has_many :clients
-
- def people_with_all_clients
- clients.inject([]) { |people, client| people + client.people }
- end
- end
-
-The foreign_key is only necessary because we didn't use "firm_id" in the data definition
-
- class Client < Company
- belongs_to :firm, :foreign_key => "client_of"
- end
-
- # CREATE TABLE people (
- # id int(11) unsigned NOT NULL auto_increment,
- # name text,
- # company_id text,
- # PRIMARY KEY (id)
- # )
-
-Active Record will also automatically link the "Person" object to the "people" table
-
- class Person < ActiveRecord::Base
- belongs_to :company
- end
-
-== Simple example (2/2): Using the domain
-
-Picking a database connection for all the Active Records
-
- ActiveRecord::Base.establish_connection(
- :adapter => "mysql",
- :host => "localhost",
- :username => "me",
- :password => "secret",
- :database => "activerecord"
- )
-
-Create some fixtures
-
- firm = Firm.new("name" => "Next Angle")
- # SQL: INSERT INTO companies (name, type) VALUES("Next Angle", "Firm")
- firm.save
-
- client = Client.new("name" => "37signals", "client_of" => firm.id)
- # SQL: INSERT INTO companies (name, client_of, type) VALUES("37signals", 1, "Firm")
- client.save
-
-Lots of different finders
-
- # SQL: SELECT * FROM companies WHERE id = 1
- next_angle = Company.find(1)
-
- # SQL: SELECT * FROM companies WHERE id = 1 AND type = 'Firm'
- next_angle = Firm.find(1)
-
- # SQL: SELECT * FROM companies WHERE id = 1 AND name = 'Next Angle'
- next_angle = Company.find(:first, :conditions => "name = 'Next Angle'")
-
- next_angle = Firm.find_by_sql("SELECT * FROM companies WHERE id = 1").first
-
-The supertype, Company, will return subtype instances
-
- Firm === next_angle
-
-All the dynamic methods added by the has_many macro
-
- next_angle.clients.empty? # true
- next_angle.clients.size # total number of clients
- all_clients = next_angle.clients
-
-Constrained finds makes access security easier when ID comes from a web-app
-
- # SQL: SELECT * FROM companies WHERE client_of = 1 AND type = 'Client' AND id = 2
- thirty_seven_signals = next_angle.clients.find(2)
-
-Bi-directional associations thanks to the "belongs_to" macro
-
- thirty_seven_signals.firm.nil? # true
-
-
-== Philosophy
-
-Active Record attempts to provide a coherent wrapper as a solution for the inconvenience that is
-object-relational mapping. The prime directive for this mapping has been to minimize
-the amount of code needed to build a real-world domain model. This is made possible
-by relying on a number of conventions that make it easy for Active Record to infer
-complex relations and structures from a minimal amount of explicit direction.
-
-Convention over Configuration:
-* No XML-files!
-* Lots of reflection and run-time extension
-* Magic is not inherently a bad word
-
-Admit the Database:
-* Lets you drop down to SQL for odd cases and performance
-* Doesn't attempt to duplicate or replace data definitions
-
-
-== Download
-
-The latest version of Active Record can be found at
-
-* http://rubyforge.org/project/showfiles.php?group_id=182
-
-Documentation can be found at
-
-* http://ar.rubyonrails.com
-
-
-== Installation
-
-The prefered method of installing Active Record is through its GEM file. You'll need to have
-RubyGems[http://rubygems.rubyforge.org/wiki/wiki.pl] installed for that, though. If you have,
-then use:
-
- % [sudo] gem install activerecord-1.10.0.gem
-
-You can also install Active Record the old-fashioned way with the following command:
-
- % [sudo] ruby install.rb
-
-from its distribution directory.
-
-
-== License
-
-Active Record is released under the MIT license.
-
-
-== Support
-
-The Active Record homepage is http://www.rubyonrails.com. You can find the Active Record
-RubyForge page at http://rubyforge.org/projects/activerecord. And as Jim from Rake says:
-
- Feel free to submit commits or feature requests. If you send a patch,
- remember to update the corresponding unit tests. If fact, I prefer
- new feature to be submitted in the form of new unit tests.
-
-For other information, feel free to ask on the rubyonrails-talk
-(http://groups.google.com/group/rubyonrails-talk) mailing list.
diff --git a/vendor/rails/activerecord/RUNNING_UNIT_TESTS b/vendor/rails/activerecord/RUNNING_UNIT_TESTS
deleted file mode 100644
index 39fc8675..00000000
--- a/vendor/rails/activerecord/RUNNING_UNIT_TESTS
+++ /dev/null
@@ -1,36 +0,0 @@
-== Creating the test database
-
-The default names for the test databases are "activerecord_unittest" and
-"activerecord_unittest2". If you want to use another database name then be sure
-to update the connection adapter setups you want to test with in
-test/connections//connection.rb.
-When you have the database online, you can import the fixture tables with
-the test/schema/*.sql files.
-
-Make sure that you create database objects with the same user that you specified in
-connection.rb otherwise (on Postgres, at least) tests for default values will fail.
-
-== Running with Rake
-
-The easiest way to run the unit tests is through Rake. The default task runs
-the entire test suite for all the adapters. You can also run the suite on just
-one adapter by using the tasks test_mysql, test_sqlite, test_postgresql or any
-of the other test_ tasks. For more information, checkout the full array of rake
-tasks with "rake -T"
-
-Rake can be found at http://rake.rubyforge.org
-
-== Running by hand
-
-Unit tests are located in test/cases directory. If you only want to run a single test suite,
-you can do so with:
-
- rake test_mysql TEST=test/cases/base_test.rb
-
-That'll run the base suite using the MySQL-Ruby adapter. Some tests rely on the schema
-being initialized - you can initialize the schema with:
-
- rake test_mysql TEST=test/cases/aaa_create_tables_test.rb
-
-
-
diff --git a/vendor/rails/activerecord/Rakefile b/vendor/rails/activerecord/Rakefile
deleted file mode 100755
index fc068b16..00000000
--- a/vendor/rails/activerecord/Rakefile
+++ /dev/null
@@ -1,247 +0,0 @@
-require 'rubygems'
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-require 'rake/packagetask'
-require 'rake/gempackagetask'
-require 'rake/contrib/sshpublisher'
-
-require File.join(File.dirname(__FILE__), 'lib', 'active_record', 'version')
-require File.expand_path(File.dirname(__FILE__)) + "/test/config"
-
-PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
-PKG_NAME = 'activerecord'
-PKG_VERSION = ActiveRecord::VERSION::STRING + PKG_BUILD
-PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
-
-RELEASE_NAME = "REL #{PKG_VERSION}"
-
-RUBY_FORGE_PROJECT = "activerecord"
-RUBY_FORGE_USER = "webster132"
-
-MYSQL_DB_USER = 'rails'
-
-PKG_FILES = FileList[
- "lib/**/*", "test/**/*", "examples/**/*", "doc/**/*", "[A-Z]*", "install.rb", "Rakefile"
-].exclude(/\bCVS\b|~$/)
-
-
-desc 'Run mysql, sqlite, and postgresql tests by default'
-task :default => :test
-
-desc 'Run mysql, sqlite, and postgresql tests'
-task :test => %w(test_mysql test_sqlite test_sqlite3 test_postgresql)
-
-for adapter in %w( mysql postgresql sqlite sqlite3 firebird db2 oracle sybase openbase frontbase )
- Rake::TestTask.new("test_#{adapter}") { |t|
- t.libs << "test" << "test/connections/native_#{adapter}"
- adapter_short = adapter == 'db2' ? adapter : adapter[/^[a-z]+/]
- t.test_files=Dir.glob( "test/cases/**/*_test{,_#{adapter_short}}.rb" ).sort
- t.verbose = true
- }
-
- namespace adapter do
- task :test => "test_#{adapter}"
- end
-end
-
-namespace :mysql do
- desc 'Build the MySQL test databases'
- task :build_databases do
- %x( mysqladmin --user=#{MYSQL_DB_USER} create activerecord_unittest )
- %x( mysqladmin --user=#{MYSQL_DB_USER} create activerecord_unittest2 )
- end
-
- desc 'Drop the MySQL test databases'
- task :drop_databases do
- %x( mysqladmin --user=#{MYSQL_DB_USER} -f drop activerecord_unittest )
- %x( mysqladmin --user=#{MYSQL_DB_USER} -f drop activerecord_unittest2 )
- end
-
- desc 'Rebuild the MySQL test databases'
- task :rebuild_databases => [:drop_databases, :build_databases]
-end
-
-task :build_mysql_databases => 'mysql:build_databases'
-task :drop_mysql_databases => 'mysql:drop_databases'
-task :rebuild_mysql_databases => 'mysql:rebuild_databases'
-
-
-namespace :postgresql do
- desc 'Build the PostgreSQL test databases'
- task :build_databases do
- %x( createdb activerecord_unittest )
- %x( createdb activerecord_unittest2 )
- end
-
- desc 'Drop the PostgreSQL test databases'
- task :drop_databases do
- %x( dropdb activerecord_unittest )
- %x( dropdb activerecord_unittest2 )
- end
-
- desc 'Rebuild the PostgreSQL test databases'
- task :rebuild_databases => [:drop_databases, :build_databases]
-end
-
-task :build_postgresql_databases => 'postgresql:build_databases'
-task :drop_postgresql_databases => 'postgresql:drop_databases'
-task :rebuild_postgresql_databases => 'postgresql:rebuild_databases'
-
-
-namespace :frontbase do
- desc 'Build the FrontBase test databases'
- task :build_databases => :rebuild_frontbase_databases
-
- desc 'Rebuild the FrontBase test databases'
- task :rebuild_databases do
- build_frontbase_database = Proc.new do |db_name, sql_definition_file|
- %(
- STOP DATABASE #{db_name};
- DELETE DATABASE #{db_name};
- CREATE DATABASE #{db_name};
-
- CONNECT TO #{db_name} AS SESSION_NAME USER _SYSTEM;
- SET COMMIT FALSE;
-
- CREATE USER RAILS;
- CREATE SCHEMA RAILS AUTHORIZATION RAILS;
- COMMIT;
-
- SET SESSION AUTHORIZATION RAILS;
- SCRIPT '#{sql_definition_file}';
-
- COMMIT;
-
- DISCONNECT ALL;
- )
- end
- create_activerecord_unittest = build_frontbase_database['activerecord_unittest', File.join(SCHEMA_ROOT, 'frontbase.sql')]
- create_activerecord_unittest2 = build_frontbase_database['activerecord_unittest2', File.join(SCHEMA_ROOT, 'frontbase2.sql')]
- execute_frontbase_sql = Proc.new do |sql|
- system(<<-SHELL)
- /Library/FrontBase/bin/sql92 <<-SQL
- #{sql}
- SQL
- SHELL
- end
- execute_frontbase_sql[create_activerecord_unittest]
- execute_frontbase_sql[create_activerecord_unittest2]
- end
-end
-
-task :build_frontbase_databases => 'frontbase:build_databases'
-task :rebuild_frontbase_databases => 'frontbase:rebuild_databases'
-
-
-# Generate the RDoc documentation
-
-Rake::RDocTask.new { |rdoc|
- rdoc.rdoc_dir = 'doc'
- rdoc.title = "Active Record -- Object-relation mapping put on rails"
- rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
- rdoc.options << '--charset' << 'utf-8'
- rdoc.template = "#{ENV['template']}.rb" if ENV['template']
- rdoc.rdoc_files.include('README', 'RUNNING_UNIT_TESTS', 'CHANGELOG')
- rdoc.rdoc_files.include('lib/**/*.rb')
- rdoc.rdoc_files.exclude('lib/active_record/vendor/*')
- rdoc.rdoc_files.include('dev-utils/*.rb')
-}
-
-# Enhance rdoc task to copy referenced images also
-task :rdoc do
- FileUtils.mkdir_p "doc/files/examples/"
- FileUtils.copy "examples/associations.png", "doc/files/examples/associations.png"
-end
-
-
-# Create compressed packages
-
-dist_dirs = [ "lib", "test", "examples" ]
-
-spec = Gem::Specification.new do |s|
- s.platform = Gem::Platform::RUBY
- s.name = PKG_NAME
- s.version = PKG_VERSION
- s.summary = "Implements the ActiveRecord pattern for ORM."
- s.description = %q{Implements the ActiveRecord pattern (Fowler, PoEAA) for ORM. It ties database tables and classes together for business objects, like Customer or Subscription, that can find, save, and destroy themselves without resorting to manual SQL.}
-
- s.files = [ "Rakefile", "install.rb", "README", "RUNNING_UNIT_TESTS", "CHANGELOG" ]
- dist_dirs.each do |dir|
- s.files = s.files + Dir.glob( "#{dir}/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
- end
-
- s.add_dependency('activesupport', '= 2.1.0' + PKG_BUILD)
-
- s.files.delete FIXTURES_ROOT + "/fixture_database.sqlite"
- s.files.delete FIXTURES_ROOT + "/fixture_database_2.sqlite"
- s.files.delete FIXTURES_ROOT + "/fixture_database.sqlite3"
- s.files.delete FIXTURES_ROOT + "/fixture_database_2.sqlite3"
- s.require_path = 'lib'
- s.autorequire = 'active_record'
-
- s.has_rdoc = true
- s.extra_rdoc_files = %w( README )
- s.rdoc_options.concat ['--main', 'README']
-
- s.author = "David Heinemeier Hansson"
- s.email = "david@loudthinking.com"
- s.homepage = "http://www.rubyonrails.org"
- s.rubyforge_project = "activerecord"
-end
-
-Rake::GemPackageTask.new(spec) do |p|
- p.gem_spec = spec
- p.need_tar = true
- p.need_zip = true
-end
-
-task :lines do
- lines, codelines, total_lines, total_codelines = 0, 0, 0, 0
-
- for file_name in FileList["lib/active_record/**/*.rb"]
- next if file_name =~ /vendor/
- f = File.open(file_name)
-
- while line = f.gets
- lines += 1
- next if line =~ /^\s*$/
- next if line =~ /^\s*#/
- codelines += 1
- end
- puts "L: #{sprintf("%4d", lines)}, LOC #{sprintf("%4d", codelines)} | #{file_name}"
-
- total_lines += lines
- total_codelines += codelines
-
- lines, codelines = 0, 0
- end
-
- puts "Total: Lines #{total_lines}, LOC #{total_codelines}"
-end
-
-
-# Publishing ------------------------------------------------------
-
-desc "Publish the beta gem"
-task :pgem => [:package] do
- Rake::SshFilePublisher.new("davidhh@wrath.rubyonrails.org", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
- `ssh davidhh@wrath.rubyonrails.org './gemupdate.sh'`
-end
-
-desc "Publish the API documentation"
-task :pdoc => [:rdoc] do
- Rake::SshDirPublisher.new("davidhh@wrath.rubyonrails.org", "public_html/ar", "doc").upload
-end
-
-desc "Publish the release files to RubyForge."
-task :release => [ :package ] do
- require 'rubyforge'
- require 'rake/contrib/rubyforgepublisher'
-
- packages = %w( gem tgz zip ).collect{ |ext| "pkg/#{PKG_NAME}-#{PKG_VERSION}.#{ext}" }
-
- rubyforge = RubyForge.new
- rubyforge.login
- rubyforge.add_release(PKG_NAME, PKG_NAME, "REL #{PKG_VERSION}", *packages)
-end
diff --git a/vendor/rails/activerecord/examples/associations.png b/vendor/rails/activerecord/examples/associations.png
deleted file mode 100644
index 661c7a8bbc87282503dc6984a1d9a6161c36f900..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 40623
zcmdqIWmH^U&^1UPfj}U*yE_DTm&V;45(rL!Mj9u$I|O&P;O@cQ-QC@7?(=@%%>S8L
z^JiEKntRr{ea`K!Q+rp{t`H>!5E23&0u&S!lC+e#3KZ0b0w^fx^v}@1$iAdbA@K6?
zr--}=6x1S&=$v9Ua1H-UO4|_%>I?dRzaOAd(r|!53b2G0Sk=x9>|*R-3Z?91@!d+z
z!p4+@lZk_gg@i`l_&bTBDv1^?lq~tf5HKGOEG;hqH-qpQ=_3`m58D$8iUdkpTtv+^
z?Ia!ERZXJ#zH~ZWAU#?b8Xo0t73%kIgXrGjEH7fR$Vl?Y`44*th((TsD8za`lb3s_
zKPrZOen)0`A%wbu{9{nTD8Iyduzs)w`cpE%FY-#eOr@WlukXu;ZrwOHPcJqf-}C$P
zIvuIa7P}pnH=y&%b{Vay+`5)vYZ+V2Yk*M7HT#lyq%1&d)L1D#qyuijewuZlIV(miwQMR$%w
zSmXF##QY|##)?D5w2~QxgtqeY*)C|M+z0vf5R$6G6dW?
zwP-nGWRsX6baA`GNe#|tI&kXAS+K8etv|;z)&gwqP8L7x+Z;~iZ|cbl4ks2>R@$AW
z)jR#>OyY9flS@!kQJFfJ%vH}w=X3e05h|ZuP(a1V7-8sqFd;HC_V-z%OluPF(bCjt
z+Ss}Uc*jnnj=dDCRyZH{Ca>40PO|=oPLnFF@;RTH`3ey$%Tosb&s}N5!=s~wykHsv
zlp&VyebK%)HH%NT$C^q?P+a1iyu2wv{fs!C5C|kcKfjSc(8Klp?NvY`vY^rX{q5!D
zWnp3A=H{l$4-OX3<(l=cL`aiDi4S0dnL(EgjVOiVUwt&;c7{|F
zni9jY9*&g`iMSt@j!XU$g#Nf5AT_Ynjr{yEOz2o+U?uS8OGNLkr9jhGjdU=(#I6Y6FJg)zKE_F*
zzgt(uSFOj@pT1yyRMHc?CI2ufYE(@iK$_^&kw3(LzzrTRL3BSa>Crys2ph^RW{E6?
znw$uyy)1-VtDG-U@NlH1Xh2PML82YIc~aLaIs3rVudn=_Otyp@-XGO4)I47FO7|@
zrTjN4CWtgF;$fob0?KZ0SV<39t_bQIOX%c`rL&=(Th`=j_ZOQz!EyMWzQz1Qm<=fE
zbWsM;VL3;h_96U5@kUUP&qyf}yAaX3H2*Oajw*={Dy*JQU`=H#N}N|VJW>vrH6uMx
zf#4>5j8Aj7YMzMy0(Y@gQboC6~Xox!O3nSAxogzU=X*0Wli5`bJ1C#RKURKoC!FF=-{E(F2FVT6*u;$$q
zQ2#6)2zf$WntqT;u)t3Kb>j2G_*$DXbZz2VDz0tnhGJfHfjnZqCGB2~qJH&nT^7S?
z-bgU0lVO5rZBx;{n9B3BCP&vO);!BsO{CH6D=3VHM5Bz*;g+FoXR`TnGJZ3rP@T{)
zD+EEBy5z!iXejty%>N=|d^yjaS##gDlP`
zS{+0;Dtga%r{qD$n%v}|NHCHeJKieO@Co3m_ePSxU^Cs&e}5Ad$}kQM*>{^?r+k>m
z)m9_&Y|frOG;hM{CYkq70~P8z<5?a@1So$j^v;
zM$WIXoTZyI!S2=MD?!FU$+r9uNe?}Xd}v-xJSxUPAZDx1#vS}YTcWlE=Vi3yZp(pC
zZqg(12p{`tHi_=rRmhM-x%l2VT}{$BwS@WNWaZY?+baqBk*sMg8KZcMQ5W=NTxf6Q
z7MjG@-6$?6{r*D4iTU}GdzD$8PFXlxp#{;AB3kA9VuKHrQT#=$3?4LT#I|mO1axxXdh2JAQ5uSzS1#es)pty>s$bT=?S4$YRC7
zWG_e89;RCpaA6@(wV@69kyi?9f)_UYbG+~=?Nf2%m=hVymJ*lG)>RHjJfV<93(7TA
z+jRF*)KPu?WxMNdKF9qqJrffXJw3pdWMpJSS0B=fIFsc7Q>-X0?IAxrJoJ5So=X5Q
zIW`uJ8^GWLP@Q~XK|vsch#Oz-WYN>DDb$0m-jYZydv@gf`Ao6u@VVd&L2oa{7gP?}
zfW*W^toY2NoE|>!H~v~l4-XGZ%Ol{x*)<