Commit Graph

42089 Commits

Author SHA1 Message Date
Rafael Mendonça França
404cb36ee3 Add CHANGELOG entry for #13935 [ci skip] 2014-02-04 12:13:14 -02:00
Rafael Mendonça França
f1a6307a94 Merge pull request #13935 from arthurnn/fix_12566
Make sure transaction state resets after commit
2014-02-04 06:03:14 -08:00
Arun Agrawal
75510a62f1 Merge pull request #13940 from gregmolnar/guides
add missing sharp [ci skip]
2014-02-04 04:58:04 -08:00
Greg Molnar
d3edf1ea82 add missing sharp [ci skip] 2014-02-04 13:54:22 +01:00
Yves Senn
c7abc516f8 docs, link MySQL manual for multi column indexes. [ci ckip].
Closes #9131.
2014-02-04 13:38:48 +01:00
Rafael Mendonça França
702e0e1a6b Merge pull request #13899 from Fortisque/kevin/active_record_HABTM_with_belongs_to
destruction errors out on HABTM w/out primary key
2014-02-04 04:11:46 -08:00
Yves Senn
7d196cf360 #to_param returns nil if to_key returns nil. Closes #11399.
The documentation of `#to_key` (http://api.rubyonrails.org/classes/ActiveModel/Conversion.html#method-i-to_key)
states that it returns `nil` if there are no key attributes. `to_param` needs
to be aware of that fact and return `nil` as well.

Previously it raised the following exception:

```
  1) Error:
ConversionTest#test_to_param_returns_nil_if_to_key_is_nil:
NoMethodError: undefined method `join' for nil:NilClass
    /Users/senny/Projects/rails/activemodel/lib/active_model/conversion.rb:65:in `to_param'
    /Users/senny/Projects/rails/activemodel/test/cases/conversion_test.rb:34:in `block in <class:ConversionTest>'
```
2014-02-04 10:27:46 +01:00
Guillermo Iguaran
a5dd1d2490 Merge pull request #13936 from edogawaconan/fix_docs
Missing closing parenthesis. [ci skip]
2014-02-03 19:20:52 -08:00
edogawaconan
b10f45ce75 Missing closing parenthesis. 2014-02-04 11:46:59 +09:00
Arthur Neves
9b66d6d47f Make sure transaction state resets after commit
[fixes #12566]
2014-02-03 15:49:48 -05:00
Yves Senn
28abd967fc Merge pull request #11770 from timruffles/doc_ajax_xhr
be more specific about csrf token and ajax - not whitelisted outside of jquery-rails [ci skip]
2014-02-03 08:38:44 -08:00
Yves Senn
dd493d3b6f docs, be clear that options is a hash. Closes #11904. [ci skip]. 2014-02-03 16:42:02 +01:00
Yves Senn
06dde5fbf5 some wording format changes. [ci skip] 2014-02-03 14:52:01 +01:00
Yves Senn
584a46479b pass habtm :autosave to underlying hm:t association. Closes #13923. 2014-02-03 14:48:59 +01:00
Yves Senn
b7c7cb1a63 docs, revisit polymorphic associations with STI example. [ci skip]
This is a follow up to #13926.

/cc @fxn
2014-02-03 13:38:14 +01:00
Yves Senn
c46b0d1023 docs, reference to ruby-lang.org. refs #13492. [ci skip] 2014-02-03 12:01:32 +01:00
Yves Senn
67d4dc2bdb rails_guides/helpers.rb requires YAML to run.
Resolve the following error when running `bundle exec rake guides:generate:html`:

```
/Users/senny/.rbenv/versions/2.0.0-p353/bin/ruby rails_guides.rb
Generating 2_2_release_notes.md as 2_2_release_notes.html
/Users/senny/Projects/rails/guides/rails_guides/helpers.rb:17:in `documents_by_section': uninitialized constant RailsGuides::Helpers::YAML (ActionView::Template::Error)
	from /Users/senny/Projects/rails/guides/rails_guides/helpers.rb:32:in `docs_for_menu'
	from /Users/senny/Projects/rails/guides/source/layout.html.erb:56:in `block in ___sers_senny__rojects_rails_guides_source_layout_html_erb___3094858039481335962_70118647133480'
	from /Users/senny/Projects/rails/guides/source/layout.html.erb:54:in `each'
	from /Users/senny/Projects/rails/guides/source/layout.html.erb:54:in `___sers_senny__rojects_rails_guides_source_layout_html_erb___3094858039481335962_70118647133480'
	from /Users/senny/Projects/rails/actionview/lib/action_view/template.rb:143:in `block in render'
	from /Users/senny/Projects/rails/activesupport/lib/active_support/notifications.rb:161:in `instrument'
	from /Users/senny/Projects/rails/actionview/lib/action_view/template.rb:337:in `instrument'
	from /Users/senny/Projects/rails/actionview/lib/action_view/template.rb:141:in `render'
	from /Users/senny/Projects/rails/actionview/lib/action_view/renderer/template_renderer.rb:61:in `render_with_layout'
	from /Users/senny/Projects/rails/actionview/lib/action_view/renderer/template_renderer.rb:47:in `render_template'
	from /Users/senny/Projects/rails/actionview/lib/action_view/renderer/template_renderer.rb:17:in `render'
	from /Users/senny/Projects/rails/actionview/lib/action_view/renderer/renderer.rb:42:in `render_template'
	from /Users/senny/Projects/rails/actionview/lib/action_view/renderer/renderer.rb:23:in `render'
	from /Users/senny/Projects/rails/actionview/lib/action_view/helpers/rendering_helper.rb:24:in `render'
	from /Users/senny/Projects/rails/guides/rails_guides/markdown.rb:160:in `render_page'
	from /Users/senny/Projects/rails/guides/rails_guides/markdown.rb:25:in `render'
	from /Users/senny/Projects/rails/guides/rails_guides/generator.rb:205:in `block in generate_guide'
	from /Users/senny/Projects/rails/guides/rails_guides/generator.rb:195:in `open'
	from /Users/senny/Projects/rails/guides/rails_guides/generator.rb:195:in `generate_guide'
	from /Users/senny/Projects/rails/guides/rails_guides/generator.rb:144:in `block in generate_guides'
	from /Users/senny/Projects/rails/guides/rails_guides/generator.rb:142:in `each'
	from /Users/senny/Projects/rails/guides/rails_guides/generator.rb:142:in `generate_guides'
	from /Users/senny/Projects/rails/guides/rails_guides/generator.rb:97:in `generate'
	from rails_guides.rb:63:in `<main>'
rake aborted!
Command failed with status (1): [/Users/senny/.rbenv/versions/2.0.0-p353/bi...]
/Users/senny/Projects/rails/guides/Rakefile:11:in `block (3 levels) in <top (required)>'
Tasks: TOP => guides:generate:html
(See full trace by running task with --trace)
```
2014-02-03 12:01:32 +01:00
Arun Agrawal
9321d678e4 Merge pull request #13930 from calvintam/master
Fixed minor typo [ci skip]
2014-02-03 02:16:11 -08:00
Calvin Tam
8f0460d746 Fixed minor typo [ci skip] 2014-02-03 21:09:29 +11:00
Yves Senn
7f8fbf7744 Merge pull request #13926 from fredwu/doc_polymorphic_sti_var_name_typo
Fixes the camelCase variable name in the docs [ci skip]
2014-02-02 23:25:44 -08:00
Fred Wu
ca1121af6a Fixes the camelCase variable name in the docs [ci skip] 2014-02-03 12:02:07 +11:00
Kevin Casey
00ebbb7945 fix HABTM w/out primary key errors on destruction 2014-02-02 11:47:06 -08:00
Rafael Mendonça França
3e6d302ccc Merge pull request #13924 from adomokos/adding_path_examples_to_button_to_tests
Adding a documentation example and a test to button_to with path
2014-02-02 08:30:35 -08:00
Attila Domokos
4b4db54e6b Adding an documentation example and a test to button_to with path
I did not see in the docs that `button_to` supports not only URLs but paths as well. I documented this functionality with a unit tests and added an example to the docs as well.
2014-02-02 10:27:18 -06:00
Rafael Mendonça França
4ac114471c Assert the file is deprecated 2014-02-01 18:29:53 -02:00
Rafael Mendonça França
8c679fe0ca Fix isolated tests 2014-02-01 18:29:41 -02:00
Rafael Mendonça França
a60ccadbf0 Merge pull request #13911 from davidcelis/remove-bigdecimal-serialization
Deprecate custom BigDecimal serialization

Conflicts:
	activesupport/CHANGELOG.md
2014-02-01 18:03:21 -02:00
David Celis
c87b27ebde Remove BigDecimal#to_d
This was backported for Ruby 1.8 support and is no longer needed.

Signed-off-by: David Celis <me@davidcel.is>
2014-02-01 10:45:57 -08:00
David Celis
85d820b169 Don't require BigDecimal serialization extension
Rails currently provides an extension to BigDecimal that redefines how
it is serialized to YAML. However, as noted in #12467, this does not
work as expected. When ActiveSupport is required, BigDecimal YAML
serialization does not maintain the object type. It instead ends up
serializing the number represented by the BigDecimal itself which, when
loaded by YAML later, becomes a Float:

```ruby
require 'yaml'
require 'bigdecimal'

yaml = BigDecimal('13.37').to_yaml
YAML.load(yaml).class

require 'active_support/all'

yaml = BigDecimal('13.37').to_yaml
YAML.load(yaml).class
```

@tenderlove posits that we should deprecate the custom BigDecimal
serialization and let Ruby handle it. For the time being, users who
require this serialization for backwards compatibility can manually
`require 'active_support/core_ext/big_decimal/yaml_conversions'`.

This will close #12467 and deprecate the custom BigDecimal#to_yaml.

Signed-off-by: David Celis <me@davidcel.is>
2014-02-01 10:45:51 -08:00
Rafael Mendonça França
682a579b25 Remove warnings for already defined methods 2014-02-01 16:27:58 -02:00
Rafael Mendonça França
cd93d7175e Make arel methods private API
Since its conception arel was made to be private API of Active Record.
If users want to use arel features directly we should provide a way
using the Active Record API without exposing the arel implementation.
2014-02-01 16:16:06 -02:00
Rafael Mendonça França
83ea905fd1 Merge pull request #13688 from jbaudanza/psql-index-exists
PostgreSQL implementation of SchemaStatements#index_name_exists?

Conflicts:
	activerecord/CHANGELOG.md
2014-02-01 16:01:38 -02:00
Rafael Mendonça França
e9be1c1e80 Merge pull request #13863 from joshjordan/jsj-dont-throw-out-get-params
Do not discard query parameters on requests that use wrap_parameters

Conflicts:
	actionpack/CHANGELOG.md
2014-02-01 15:53:27 -02:00
Rafael Mendonça França
989923e5a4 Merge pull request #13912 from mauricio/bug-13907
Fixes issue with parsing whitespace content back from database - fixes #13907
2014-02-01 09:45:46 -08:00
Rafael Mendonça França
82701cd61e Merge pull request #12769 from birkirb/master
Boolean parser blows up on a Fixnum.

Conflicts:
	activesupport/CHANGELOG.md
2014-02-01 14:49:32 -02:00
Mauricio Linhares
a34c10f73e Fixes issue with parsing whitespace content back from database - fixes #13907 2014-02-01 09:38:43 -03:00
Aaron Patterson
9b2a017aa8 this class depends on JoinHelper, so we should require it 2014-01-31 14:10:31 -08:00
Aaron Patterson
3fbff7811b just require the template resolver
LookupContext is eagerly loaded, and FallbackFileSystemResolver is
referenced at the class level.  Just require the resolver from the
eagerly loaded class rather than jumping through autoload hoops
2014-01-31 12:05:50 -08:00
Aaron Patterson
e8fcd599ba only ask for the location filters once 2014-01-31 12:00:54 -08:00
Aaron Patterson
0b10180444 FilterRedirect is referenced at the class level from the Response
We can just require the file rather than going through the autoload
indirection
2014-01-31 11:54:42 -08:00
Andrew White
63f8fabe49 Maintain the current timezone in wrap_with_time_zone
Extend the solution from the fix for #12163 to the general case where
`Time` methods are wrapped with a time zone.

Fixes #12596.
2014-01-31 17:13:12 +00:00
Rafael Mendonça França
f484df79f2 Merge pull request #13780 from rohitpaulk/patch-1
Updated association_basics.md
2014-01-31 04:06:56 -08:00
Carlos Antonio da Silva
8c7e8b4f18 Minor changelog improvements [ci skip] 2014-01-31 08:02:56 -02:00
Carlos Antonio da Silva
8ea797809d Merge pull request #13900 from zzak/issue_12963
Document default trim mode for Erubis and affected ERB tags. Fixes #12963 [ci skip]
2014-01-31 01:57:00 -08:00
Carlos Antonio da Silva
5df52961f7 Merge pull request #13896 from laurocaetano/dangerous_association_names
Associations now raises `ArgumentError` on name conflicts. Closes #13217.
2014-01-31 01:41:24 -08:00
Zachary Scott
0a4466b7e8 Document default trim mode for Erubis and affected ERB tags [ci skip]
Fixes #12963
2014-01-31 00:25:52 -08:00
Godfrey Chan
530cab328e Merge pull request #13898 from timfenney/my_branch
Remove unused variable.
2014-01-30 22:21:50 -08:00
Rohit Paul Kuruvilla
464d47eaaf Updated association_basics.md [ci skip]
Updated association_basics.md to include how to write migrations for self joins

Update association_basics.md

Corrected the update

Update association_basics.md

Typo fix

Changed :employee to :manager
2014-01-31 11:31:19 +05:30
Tim Fenney
16648979f7 Remove unused variable. 2014-01-31 00:50:09 -05:00
Lauro Caetano
4506dd2f07 Associations now raise ArgumentError on name conflicts.
Dangerous association names conflicts include instance or class
methods already defined by `ActiveRecord::Base`.
2014-01-31 00:29:48 -02:00