Xml serialisation has one #7857

Closed
wants to merge 1,082 commits into
from

Projects

None yet
@cliochris
Contributor

When serialising a class, specify the type of any singular associations, if necessary. Rails already correctly specifies the :type of any enumerable association (e.g. a has_many association), but made no attempt to do so for non-enumerables (e.g. a has_one association).
We must specify the :type of any polymorphic association. A has_one association to a class which uses single-table inheritance is an example of a polymorphic association.
Fixes #7471

kennyj and others added some commits Mar 3, 2012
@kennyj @tenderlove kennyj Fix GH #3163. Should quote database on mysql/mysql2.
Conflicts:

	activerecord/test/cases/adapters/mysql/mysql_adapter_test.rb
22994b2
@kennyj @tenderlove kennyj Change the string to use in test case.
Conflicts:

	activerecord/test/cases/adapters/mysql/mysql_adapter_test.rb
	activerecord/test/cases/adapters/mysql2/schema_test.rb
0ccdeeb
@ernie @tenderlove ernie Additional fix for CVE-2012-2661
While the patched PredicateBuilder in 3.1.5 prevents a user
from specifying a table name using the `table.column` format,
it doesn't protect against the nesting of hashes changing the
table context in the next call to build_from_hash. This fix
covers this case as well.
cc2903d
@tenderlove tenderlove Array parameters should not contain nil values. 38edea0
@tenderlove tenderlove updating changelogs 301974a
@tenderlove tenderlove updating changelogs with security fixes ceb8ec3
@tenderlove tenderlove bumping version numbers ee4209a
@acapilleri acapilleri Fix the the backport of the object dup with the ruby 1.9.3p194.
At the end of initialize_dup was added the call to super if it exists,
so it also works with 1.8.7 where initialize_dup doesn't exist.
This issu was introduced with the pull request #6324
b97e0a1
@rafaelfranca rafaelfranca Merge pull request #6682 from acapilleri/dup_validation_fix_backport_…
…for_1_9_3

Dup validation fix backport for 1 9 3
6522a12
@rafaelfranca rafaelfranca Merge pull request #6676 from aurelian/master
Don't assign the attributes if the list is empty
32709ea
@rafaelfranca rafaelfranca Merge pull request #6715 from arunagw/add_asserts
Need a assert here in tests
5dd2cfc
@tenderlove tenderlove updating changelogs 8381d39
@tenderlove tenderlove Merge branch '3-2-stable-rel' into 3-2-stable
* 3-2-stable-rel:
  updating changelogs
  bumping version numbers
  updating changelogs with security fixes
  updating changelogs
  Array parameters should not contain nil values.
  Additional fix for CVE-2012-2661
10cdbbc
Francesco Rodríguez Fix build eed1cfe
@rafaelfranca rafaelfranca Merge pull request #6716 from frodsan/patch-2
Fix Build
966371a
@kennyj
Contributor
kennyj commented on cc2903d Jun 13, 2012

Hi @ernie @tenderlove
Please see #6718.

I guess specification's conflict has occurred.

Contributor

@kennyj posting response to that issue now. Short version -- code that treated nested hashes this was is wrong. Long version will be posted shortly.

spastorino and others added some commits Jun 13, 2012
@spastorino spastorino ActionController::Caching depends on RackDelegation and AbstractContr…
…oller::Callbacks
7f93791
@tenderlove tenderlove adding a test for #6459 e7d1849
@steveklabnik steveklabnik Deprecate update_attribute.
Historically, update_attribute and update_attributes are similar, but
with one big difference: update_attribute does not run validations.
These two methods are really easy to confuse given their similar
names. Therefore, update_attribute is being deprecated in favor of
update_column, and will be removed in Rails 4.

See the discussion on rails-core here:
https://groups.google.com/d/topic/rubyonrails-core/BWPUTK7WvYA/discussion
b081f6b
@fxn fxn Merge pull request #6739 from steveklabnik/3-2-stable
Deprecate update_attribute
63bcfbb
@fxn fxn registers the deprecation of update_attribute in the CHANGELOG 2109fd5
@rafaelfranca rafaelfranca Remove unneded tests.
Before b081f6b, this test are
asserting that update_attribute does the dirty tracking. Since we
deprecated this method and update_column write in the database directly
this tests will always fail.
a8e22ae
@route route ActionController::Metal doesn't have logger method, check it and then…
… delegate
3b1ea3d
@route route Added test for case when view doesn't have logger method when using A…
…ctionController::Metal controller.
4717c2f
@rafaelfranca rafaelfranca Merge pull request #6752 from steveklabnik/fix_5680
Respect absolute paths in compute_source_path.
52d0963
@arunagw arunagw It should also include text/css => Build Fix 909a4a5
@rafaelfranca rafaelfranca Merge pull request #6756 from arunagw/build_fix_ap
Build fix actionpack
ed93c86
Francesco Rodríguez bump AS deprecation_horizon to 4.0 a556c7e
@rafaelfranca rafaelfranca Merge pull request #6764 from frodsan/patch-4
bump AS deprecation_horizon to 4.0
284ebf2
@josevalim josevalim Use strict_args_position! if available from Thor 83451be
@steveklabnik steveklabnik Deprecating composed_of in ActiveRecord
This feature adds a lot of complication to ActiveRecord for dubious
value. Let's talk about what it does currently:

class Customer < ActiveRecord::Base
  composed_of :balance, :class_name => "Money", :mapping => %w(balance
amount)
end

Instead, you can do something like this:

    def balance
      @balance ||= Money.new(value, currency)
    end

    def balance=(balance)
      self[:value] = balance.value
      self[:currency] = balance.currency
      @balance = balance
    end

Since that's fairly easy code to write, and doesn't need anything
extra from the framework, if you use composed_of today, you'll
have to add accessors/mutators like that.

This feature will be removed in Rails 4.
44b313b
@rafaelfranca rafaelfranca Merge pull request #6742 from steveklabnik/deprecate_composed_of
Deprecate composed of
ffcecf2
@carlosantoniodasilva carlosantoniodasilva Merge pull request #6649 from route/logger_in_metal_3_2
Logger in metal backport for 3.2
2363aaf
@josevalim @rafaelfranca josevalim Merge pull request #6758 from caironoleto/master
Fixing load config in some tasks
Conflicts:
	activerecord/lib/active_record/railties/databases.rake
94489a2
@rafaelfranca rafaelfranca Merge branch 'acapilleri-update_nested_attributes'
Closes #6675

Conflicts:
	activerecord/lib/active_record/attribute_methods/dirty.rb
40617c7
@rafaelfranca rafaelfranca Remove waning of unused variable 200e6a6
@rafaelfranca rafaelfranca Merge pull request #6842 from ernie/handle-non-strings-in-grouped-cal…
…culations

Stop assuming strings for grouped calculations
Conflicts:
	activerecord/lib/active_record/relation/calculations.rb
12ac977
@carlosantoniodasilva carlosantoniodasilva Ensure Arel columns are typecasted properly when grouping with calcul…
…ation

Fix build issue with postgresql.

Conflicts:
	activerecord/lib/active_record/relation/calculations.rb
	activerecord/test/cases/calculations_test.rb
f8f4ac9
@carlosantoniodasilva carlosantoniodasilva Merge pull request #6857 from rsutphin/as_core_ext_time_missing_require
Missing require breaks Time.=== when selectively loading ActiveSupport core_exts in 3.2.4+
3fccf6a
@carlosantoniodasilva carlosantoniodasilva Merge pull request #6900 from cbandy/issue-6898
Require URI in ConnectionSpecification
Conflicts:
	activerecord/lib/active_record/connection_adapters/connection_specification.rb
10e5685
@rafaelfranca rafaelfranca Merge pull request #6878 from masarakki/master
fix bug in limit of enum columns of mysql

Closes #6432
48601c2
@fxn fxn make sure the inflection rules are loaded when cherry-picking active_…
…support/core_ext/string/inflections.rb [fixes #6884]
9e0b3fc
Francesco Rodriguez Backport #3329 to 3-2-stable
Fix bug with autosave collection association on new record with a marked
for destroy record in autosave collection.

Fixes #6918.
b1e509a
@rafaelfranca rafaelfranca Merge pull request #6935 from frodsan/b1e509ad7a8c8264544f10f4666705c…
…d806b5408

Backport #3329 to 3-2-stable
dacc947
@mjtko @carlosantoniodasilva mjtko Fix NumberHelper options wrapping to prevent verbatim blocks being re…
…ndered instead of line continuations. While I'm at it, wrap long comment lines consistently.

Conflicts:
	actionpack/lib/action_view/helpers/number_helper.rb

There was just one conflict related to the addition of the :format
option to number_to_percentage.
7faa620
@route route Show in log correct wrapped keys ffdca21
@rafaelfranca rafaelfranca Merge pull request #6973 from route/wrapped_keys_in_log_for_3_2
MIssed backport for 3.2
c7afc42
@josevalim josevalim Since Rails 3.2, use layout false to render no layout 03dcdc3
@rafaelfranca rafaelfranca Merge pull request #6985 from sidonath/disable-query-cache-for-locks
Disable query cache for lock queries
Conflicts:
	activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb
7adc4f2
@sikachu sikachu Update coding convention from master 904eace
@fxn fxn Merge pull request #7015 from sikachu/3-2-stable-code-style
Update coding convention from master
45d78a3
Rusty Geldmacher Fixed bug creating invalid HTML in select options
When a select tag is created for a field with errors, and that select
tag has :prompt or :include_blank options, then the inserted first
option will errantly have a <div class="field_with_errors"> wrapping
it.

See rails#7017
27c8deb
@rafaelfranca rafaelfranca Merge pull request #7025 from rustygeldmacher/select_options_valid_html
Select options valid html
3b1de4a
@robbkidd robbkidd Update psql adapter to rename a default pkey sequence during rename_t…
…able.
8d3eafe
@drogus drogus Merge pull request #7031 from robbkidd/rename_sequences_too_backport_…
…to_3-2

Back-port #6874 to 3.2: psql adapter should rename a default pk sequence during rename_table
e72d876
@jeremycole jeremycole Only use prepared statements when bind variables are present
Prepared statements (prepare/execute/close) were being used unnecessarily
when no bind variables were present, and disabling prepared statement using
prepared_statements:false was principally broken. While bind variables were
correctly substituted with prepared_statements:false, the prepared statement
interface was still used, costing an extra two round trips per query.

In addition to making this behavioral change, I also cleaned up the internals
of exec_stmt and exec_without_stmt so that they behave the same (calling log
and constructing the ActiveRecord::Result in the same way).

Moving the check for binds.empty? to exec_query also will mean that several
code paths explicitly calling exec_without_stmt could be cleaned up to once
again call exec_query instead. I have also left the check for binds.empty? in
exec_stmt, since it is not a private method and could be called directly with
an empty binds array. For the sake of clarity in this patch, I have not made
those changes.

= The previous behavior =

When issuing a Foo.find(1) with prepared_statements:true, the bind variable
is present in the prepared query, and execute shows a value passed:

    Connect	root@localhost on rails_test
    Query	SET SQL_AUTO_IS_NULL=0
    Statistics
    Query	SHOW FULL FIELDS FROM `foos`
    Query	SHOW TABLES LIKE 'foos'
    Query	SHOW CREATE TABLE `foos`
    Prepare	SELECT  `foos`.* FROM `foos`  WHERE `foos`.`id` = ? LIMIT 1
    Execute	SELECT  `foos`.* FROM `foos`  WHERE `foos`.`id` = 1 LIMIT 1
    Close stmt
    Quit

When issuing a Foo.find(1) with prepared_statements:false, the bind variable
has already been removed and substituted with the value, but the prepared
statement interface is used anyway:

    Connect	root@localhost on rails_test
    Query	SET SQL_AUTO_IS_NULL=0
    Statistics
    Query	SHOW FULL FIELDS FROM `foos`
    Query	SHOW TABLES LIKE 'foos'
    Query	SHOW CREATE TABLE `foos`
    Prepare	SELECT  `foos`.* FROM `foos`  WHERE `foos`.`id` = 1 LIMIT 1
    Execute	SELECT  `foos`.* FROM `foos`  WHERE `foos`.`id` = 1 LIMIT 1
    Close stmt
    Quit

= With this patch applied =

When issuing a Foo.find(1) with prepared_statements:true, the bind variable
is present in the prepared query, and execute shows a value passed:

    Connect	root@localhost on rails_test
    Query	SET SQL_AUTO_IS_NULL=0
    Statistics
    Query	SHOW FULL FIELDS FROM `foos`
    Query	SHOW TABLES LIKE 'foos'
    Query	SHOW CREATE TABLE `foos`
    Prepare	SELECT  `foos`.* FROM `foos`  WHERE `foos`.`id` = ? LIMIT 1
    Execute	SELECT  `foos`.* FROM `foos`  WHERE `foos`.`id` = 1 LIMIT 1
    Close stmt
    Quit

When issuing a Foo.find(1) with prepared_statements:false, the bind variable
has been removed and substituted with the value, and the query interface is
used instead of the prepared statement interface:

    Connect	root@localhost on rails_test
    Query	SET SQL_AUTO_IS_NULL=0
    Statistics
    Query	SHOW FULL FIELDS FROM `foos`
    Query	SHOW TABLES LIKE 'foos'
    Query	SHOW CREATE TABLE `foos`
    Query	SELECT  `foos`.* FROM `foos`  WHERE `foos`.`id` = 1 LIMIT 1
    Quit
e4ef90a
@jeremycole jeremycole Fixing texts; down to three failing tests. 8f43230
@tenderlove tenderlove fixing tests to deal with data differences between prepared statement…
…s and non-prepared statements
f7ef7ca
@fxn fxn adds a missing require [fixes #6896]
This file uses Time.zone, which is defined in
active_support/core_ext/time/zones.rb.
b3693bf
@jmazzi jmazzi Update documentation for Rails::Application#env_config c6ad167
@rafaelfranca rafaelfranca Merge pull request #4396 from kennyj/fix_4259
Fix GH #4259. When we execute schema dumper, we must remove table_name_prefix and table_name_suffix.
e23ec4c
@pixeltrix pixeltrix Add support for optional root segments containing slashes
Optional segments with a root scope need to have the leading slash
outside of the parentheses, otherwise the generated url will be empty.
However if the route has non-optional elements then the leading slash
needs to remain inside the parentheses otherwise the generated url
will have two leading slashes, e.g:

Blog::Application.routes.draw do
  get '/(:category)', :to => 'posts#index', :as => :root
  get '/(:category)/author/:name', :to => 'posts#author', :as => :author
end

$ rake routes
  root GET /(:category)(.:format)              posts#index
author GET (/:category)/author/:name(.:format) posts#author

This change adds support for optional segments that contain a slash,
allowing support for urls like /page/2 for the root path, e.g:

Blog::Application.routes.draw do
  get '/(page/:page)', :to => 'posts#index', :as => :root
end

$ rake routes
root GET /(page/:page)(.:format) posts#index

Fixes #7073
(cherry picked from commit d8745de)
71d274d
@jfirebaugh jfirebaugh AR::Integration must be included after AM::Conversion
Integration's definition of #to_param must override
Conversion's. Otherwise, there is a regression from
3.1 in the behavior of a non-persisted AR::Base instance
which nevertheless has an id.
9b5309f
@jonleighton jonleighton Merge pull request #7080 from jfirebaugh/to_param_regression
AR::Integration must be included after AM::Conversion
827f369
@arunagw arunagw Bumping mocha!
Reason:- 0.12.0 introduced a bug where you got a exception
which is now in 0.12.1 is a warning only!
89dee0e
@rafaelfranca rafaelfranca Merge pull request #7108 from arunagw/mocha_bump
Bumping mocha!
22880de
@carlosantoniodasilva carlosantoniodasilva Merge pull request #6616 from dpassage/fix_resolver_test_sqlite3
Resolver tests fail if mysql adapter not installed
b16e7ed
@jonleighton jonleighton Deprecate :finder_sql, :counter_sql, :insert_sql, :delete_sql. a79bfa9
@rafaelfranca rafaelfranca `validates_inclusion_of` and `validates_exclusion_of` now accept
`:within` option as alias of `:in` as documented.

Fix #7118
089371a
@fxn fxn Hash#fetch(fetch) is not the same as doing hash[key] a37b90c
@pixeltrix pixeltrix Bump Journey requirements to 1.0.4
There are some Action Pack tests for regressions from 3.1 that require
a later version of Journey to pass so bump to the current version.
6b7d26c
@tenderlove tenderlove updating changelogs 125dfdf
@tenderlove tenderlove updating the version 753c546
@atambo
Contributor
atambo commented on 6b7d26c Jul 23, 2012

There is an issue with the new version of journey that will probably affect a lot of people:

rails/journey#42

@lunks
Contributor
lunks commented on 904eace Jul 24, 2012

Is there any discussion about indenting after private/protected? At the same time I want to stay in convention with Rails', I'd like to see the arguments favoring indent. I honestly prefer to not indent methods after private/protected.

Owner
fxn replied Jul 24, 2012

@lunks there is really no discussion going on. Of course this only applies to the Rails code base, Rails applications can have other conventions.

Conventions are arbitrary up to some point. There are people who prefer not to use parens for method definitions, there are people who prefer to surround arguments in a method call with spaces, there are people who put private/protected against the left margin so that they stand out... Though we all have our preferences, at the end of the day it does not matter much, those are the conventions agreed in the project and we stick to them to have a uniform code base.

Contributor

I understand, but what motivated the change into the private/protected indenting? Please do not think of this as rant, I'm rather curious about what made you guys change your mind about this.
I prefer the older convention, and as far as discussions went on my side so far, there were no compelling arguments to either way. As such, changing this probably was led by someone stating "hey, this is better because of x." and the change was made by @sikachu afterwards.

Owner
fxn replied Jul 24, 2012

Ah, sure.

That was the convention of the project before (https://rails.lighthouseapp.com/projects/8994/source-style) and got somehow changed. Don't remember the details. I believe David himself feels strong about indenting after private/protected in particular.

Member

@lunks it was not a decision reached by consensus among rails core. some of us do not like the intented style, but ultimately it's not something that there's much point arguing about as we have much more important things to do :)

Contributor

THIS IS NOT WHAT I WANT! I WANT MY CODING STYLE BACK!

Indeed, @jonleighton, not much to talk about other than pick one and live with it.

Thanks for the input. :)

smartinez87 and others added some commits May 21, 2011
@smartinez87 @parndt smartinez87 New #update_columns method. f27a8eb
@parndt parndt Suggest using update_columns instead of update_column.
update_column is deprecated in Rails 4.0 so it makes no sense to
recommend adopting it only to require changing to update_columns
in the very next release.
a0b85b9
@tenderlove tenderlove Merge pull request #7159 from parndt/update_columns
Backport update_columns to Rails 3.2
def9c85
@carlosantoniodasilva carlosantoniodasilva Fix AR#update_columns tests on Ruby 1.8.7 17a64de
@parndt
Contributor
parndt commented on 17a64de Jul 26, 2012

Good catch 👍 I've been using Ruby 1.9 hashes so much lately I didn't even notice!

parndt and others added some commits Jul 26, 2012
@parndt parndt Switched update_column recommendation in changelog to update_columns
This is related to #7159
9fa06c3
@rafaelfranca rafaelfranca Merge pull request #7164 from parndt/patch-4
Switched update_column recommendation in changelog to update_columns
3dae440
@adacosta

It'd be nice if the collection to be operated on had its logic outside of the operations, so we don't have to follow logic like this "next" method. It seems like there are lots of different things going on here in general, also record skipping and setting a "saved" variable and then potentially acting on that variable state.

edit: this method is too large. Is it too late to refactor?

Contributor

never is too late, send a pull request :)

tenderlove and others added some commits Jul 26, 2012
@tenderlove tenderlove * Do not convert digest auth strings to symbols. CVE-2012-3424 27311fe
@tenderlove tenderlove updating the changelog fb89f6f
@tenderlove tenderlove bumping to 3.2.7 21bcac1
@tenderlove tenderlove updating release date d1b9cf2
@tenderlove tenderlove Merge branch '3-2-rel' into 3-2-stable
* 3-2-rel:
  updating release date
  bumping to 3.2.7
  updating the changelog
  * Do not convert digest auth strings to symbols. CVE-2012-3424
  updating the version
  updating changelogs
133754e
@rafaelfranca rafaelfranca Only require the `:rails_env` task where is needed.
`:rails_env` tasks is not needed in all the tasks that depends of
`load_config`, only in the tasks that uses `Rails.env`.

Since `:rails_env` task set the `Rails.env` to be "development" if it is
not set we don't need the `||` statements too

Fix #7175.
4b8b8c1
@fxn fxn adds a missing require from Active Support
This file uses mattr_accessor.
db340da
@fxn fxn missing require: the AR session store depends on the AP abstract store
This require makes the dependency even more clear.
In particular we are eager loading the session
store but that does not work if AR is used
outside Rails, this patch is preliminary work
in fixing #7160.
bf16456
Francesco Rodriguez Backport #6995 to 3-2 stable
Update `test_help` to config properly turn natural language option.
Last versions of Turn don't monkey patch MiniTest to setup
the natural language option. Here is an [example](https://github.com/TwP/turn/blob/master/try/test_autorun_minitest.rb#L3).

This patches the following behaviour:

    $ rake test:units
    `<top (required)>': undefined method `use_natural_language_case_names='
    for MiniTest::Unit:Class (NoMethodError)
3326b8b
@rafaelfranca rafaelfranca Merge pull request #7187 from frodsan/fix_test_help
Backport #6995 to 3-2 stable
be408d6
@fxn fxn removes the AR session store from eager loaded code [fixes #7160]
See the comment in the file activerecord/lib/active_record.rb
added by this patch for the rationale.
cc712f2
@rafaelfranca rafaelfranca Revert "Add update_columns and the suggestion of using update_columns
instead of update_column"

This reverts commit 9fa06c3.

This reverts commit 17a64de.

This reverts commit def9c85, reversing
changes made to 6b7d26c.

Reason: This was supposed to be released with 3.2.7 before the
suggestion to use update_column. Since it was not release now is not
good to suggest to use another method because it will confusing the
people.
2f930df
@rafaelfranca rafaelfranca Add CHANGELOG entry [ci skip] a893672
@rafaelfranca rafaelfranca Merge pull request #7147 from pferdefleisch/scaffold_controller_docs
Updated scaffold_controller generator docs #7146
69fd0e8
@rafaelfranca rafaelfranca Merge pull request #7070 from jmazzi/3-2-stable
Update documentation for Rails::Application#env_config
3e01a2a
@spastorino spastorino Add missing CHANGELOG entries
[ci skip]
6764b7b
@rafaelfranca rafaelfranca Revert "Deprecating composed_of in ActiveRecord"
This reverts commit 44b313b.
736bf14
@fingermark

The code has if autosave && ... on line 342 and elsif autosave != false && ... on line 344. Why not be consistent and change line 344 to elsif autosave && ...?

jeremy and others added some commits Apr 12, 2012
@jeremy jeremy Backport 5c51cd0: #send_file leans on Rack::Sendfile to X-Accel-Redir…
…ect the file's path, so opening the file to set the response body is wasteful. Set a FileBody wrapper instead that responds to to_path and streams the file if needed.
bccc35b
@rafaelfranca rafaelfranca Do not use update_column where update_attribute is not interchangeable
Revert "Deprecate update_attribute."

This reverts commit b081f6b.

Reason: Since the new deprecation policy we removed the deprecation of
update_attribute but we didn't reverted the changes to use
update_column.

Fixes #7306
8055cd6
@carlosantoniodasilva carlosantoniodasilva Merge pull request #7027 from erichmenge/patch/jruby_send_file
Backport 5c51cd0 to fix an issue with jRuby encodings. Fixes #6844
b4dce47
@carlosantoniodasilva carlosantoniodasilva Remove duplicated changelog entry [ci skip] 4e31f82
@jonleighton jonleighton Use benchmark/ips to measure AR performance
This means we can more easily compare numbers, and we don't have to
specify a single N for all reports, which previously meant that some
tests were running many more/fewer iterations than necessary.
bfff0ed
@jonleighton jonleighton Increase benchmark time to 20 seconds.
I think that 5 seconds was a bit low for our purposes.

Also enable it to be configured via env vars.

We also need to scale the number of records up/down depending on how
long we're running the benchmark for.
25f6549
@rafaelfranca rafaelfranca Merge pull request #7352 from aripollak/microsecond-timestamp
Fix occasional microsecond conversion inaccuracy
Conflicts:
	activerecord/CHANGELOG.md
d6dbd7f
@rafaelfranca rafaelfranca Ruby 1.8 doesn't have to_r defined to NilClass and Float.
Use round to get the right conversion
3c61642
@jrafanie jrafanie Table#remove passed an array to remove_column, which is deprecated. 066ecf0
@rafaelfranca rafaelfranca Merge pull request #7388 from ManageIQ/fix_table_remove_passing_array…
…_deprecation

Table#remove passed an array to remove_column, which is deprecated.
b3bea49
@carlosantoniodasilva carlosantoniodasilva Merge pull request #7377 from brainopia/use_inversed_parent_for_first…
…_and_last_child

Use inversed parent for first and last child of has_many association

[Backport] Closes #3223.

Conflicts:
	activerecord/lib/active_record/associations/collection_association.rb
fdf4eae
@rafaelfranca rafaelfranca Merge pull request #6986 from kennyj/fix_6975
Fix #6975. Round usec when writing timestamp attribute.

Conflicts:
	activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
8905c1f
@rafaelfranca rafaelfranca Merge pull request #7410 from sandeepravi/default_options_helper_value
option_tags coerced to "" instead of nil

Closes #7404
c091fae
@rafaelfranca rafaelfranca Merge pull request #5210 from Pliny/masteri
Fix for #5200

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/counter_cache.rb
648c5a1
@rafaelfranca rafaelfranca Use a model without counter cache to test read-only attributes 015cac7
@carlosantoniodasilva carlosantoniodasilva Use Ruby 1.8 hash syntax
Introduced in backport 648c5a1.
d5fe242
@catsby
Owner

It's an assert_match, and I wanted to avoid comparing against ' because it's escaped

@homakov
Contributor

are you serious?..

Owner

@homakov I don't understand what do you mean

arunagw and others added some commits Aug 24, 2012
@arunagw arunagw We need to have 1-0-stable for joureny gem in edge
Problem : Edge rails can't bundle
Fixes #7437
0ec7b35
@spastorino spastorino Merge pull request #7438 from arunagw/3-2-stable-edge-rails-fix
We need to have 1-0-stable for joureny gem in edge
b76a963
@nashby nashby correct handling of date selects when using both disabled and discard…
… options

we should take disabled option not only from `html_options` hash but from
`options` hash too like `build_select` method does it. So

datetime_select("post", "updated_at", { :discard_minute => true }, { :disabled => true })
datetime_select("post", "updated_at", :discard_minute => true , :disabled => true)

both these variants work now

closes #7431
4b19855
@rafaelfranca rafaelfranca Merge pull request #7446 from nashby/backport-fix-issue-7431
backport #7435
dcb2bee
@fxn fxn fixes a bug in dependencies.rb
loaded stores file names without the .rb extension, but search_for_file
returns file names with the extension.

The solution is hackish, but this file needs a revamp.
8333b93
@fxn fxn CHANGELOGs are now per branch
Check 810a50d for the rationale.
8efced6
@lifo lifo Ensure association preloading properly merges default scope and assoc…
…iation conditions

Conflicts:

	activerecord/test/models/reader.rb
58d35f6
@marcandre @steveklabnik marcandre Fix bug when Rails.application is defined but is nil. See #881 728e925
@drogus drogus Merge pull request #7474 from steveklabnik/backport_89ebd28
Backport 89ebd28 to 3-2-stable
f84fc39
@fxn fxn documents after_(commit|rollback) cabab37
@senny @senny senny set the configured #inheritance_column on #become (#7503)
I had to create a new table because I needed an STI table,
which does not have both a "type" and a "custom_type"

the test fails with:
  1) Error:
test_alt_becomes_works_with_sti(InheritanceTest):
NoMethodError: undefined method `type=' for #<Cabbage id: 1, name: "my cucumber", custom_type: "Cucumber">
    /Users/username/Projects/rails/activemodel/lib/active_model/attribute_methods.rb:432:in `method_missing'
    /Users/username/Projects/rails/activerecord/lib/active_record/attribute_methods.rb💯in `method_missing'
    /Users/username/Projects/rails/activerecord/lib/active_record/persistence.rb:165:in `becomes'
    test/cases/inheritance_test.rb:134:in `test_becomes_works_with_sti'
    test/cases/inheritance_test.rb:140:in `test_alt_becomes_works_with_sti'

Conflicts:

	activerecord/test/cases/inheritance_test.rb
01d09a6
@rafaelfranca rafaelfranca Merge pull request #7514 from senny/issue_7503_3_2_stable
set the configured #inheritance_column on #become (#7503)
87ac5b4
@rafaelfranca rafaelfranca Merge pull request #7337 from adzap/string_to_dummy_time
Fix for time type columns with invalid time value
Conflicts:
	activerecord/CHANGELOG.md
5054e26
@carlosantoniodasilva carlosantoniodasilva Update Active Model xml serialization test to reflect a change in bui…
…lder

Due to a change in builder, nil values and empty strings now generates
closed tags, so instead of this:

    <pseudonyms nil=\"true\"></pseudonyms>

It generates this:

    <pseudonyms nil=\"true\"/>

Document this change in Rails so that people can track it down easily if
necessary.

Conflicts:
	activemodel/CHANGELOG.md
d65adc7
@carlosantoniodasilva carlosantoniodasilva Fix AR tests due to builder change with nil values / empty strings
Check 0180e09 for more reasoning about
that.
77dd3be
@carlosantoniodasilva carlosantoniodasilva Fix AS tests due to builder change with nil values / empty strings
Check 0180e09 for more reasoning about
that.
146eaf3
@thiagopradi thiagopradi ConnectionAdapters::Column.type_cast_code should always convert value…
…s to integer calling #to_i
652107e
@rafaelfranca rafaelfranca Merge pull request #7582 from tchandy/fix_type_cast_code
type_cast_code should always convert values to integer calling #to_i
924ad60
@kennyj kennyj Backported #7572 to 3-2-stable. Use config['encoding'], because datab…
…ase configuration use not charset but encoding.
9630485
@rafaelfranca rafaelfranca Merge pull request #7603 from kennyj/fix_charset_vs_encoding_32
Backported #7572 to 3-2-stable. Use config['encoding'], because database configuration use not charset but encoding.
f568280
Steve Jorgensen Backport PostgreSQL auto-reconnect test coverage
6d5f4de
Simulated & actual (manual/skipped) PostgreSQL auto-reconnection tests.

4b1bca0
Stop being silly with formatting of method aliasing.

c381d5c
Fix just-plain-wrongness of psql auto-reconnect test.

1e17a9d
Fix only-once stub logic.

f16c2043826ec1991cf94fe17cb671507b7a7f51
Changelog for PostgreSQL auto-reconnect test coverage backport.
f48bb01
@rafaelfranca rafaelfranca Merge pull request #7632 from stevecj/3-2-stable
3 2 stable
84c7896
Francesco Rodríguez fix markdown markup in AR/CHANGELOG 2326d46
@carlosantoniodasilva carlosantoniodasilva Merge pull request #7633 from frodsan/patch-5
Fix markdown markup in AR/CHANGELOG [ci skip]
5aaf79a
@rafaelfranca rafaelfranca `skip` in Ruby 1.8 doesn't skip the test case without return dbfdd00
@rafaelfranca rafaelfranca Backport explain fixes.
* Mark as SCHEMA some schema database queries. #7648
* Don't explain queries except normal CRUD sql. #7657

Closes #6458
Closes #7544
6abe0e7
@rafaelfranca rafaelfranca Merge pull request #7651 from steveklabnik/issue_3956
Don't preserve SELECT columns on COUNT

Closes #7651

Conflicts:
	activerecord/test/cases/associations/has_many_associations_test.rb
8432d03
@rafaelfranca rafaelfranca Merge pull request #7666 from kennyj/fix_9fa3f102813eeeec440abd75870d…
…fa7b23835665

Fix warning: method redefine. Testcase name are duplicated.
07c8055
@rafaelfranca rafaelfranca Merge pull request #7661 from ernie/build-join-records-on-unsaved-hmt
Fix collection= on hm:t join models when unsaved
ee43989
@senny @rafaelfranca senny log 404 status when ActiveRecord::RecordNotFound was raised (#7646)
Conflicts:
	actionpack/CHANGELOG.md
	actionpack/lib/action_controller/log_subscriber.rb
dd76b3b
@jrochkind jrochkind backport fair connection pool 02b2335 to 3-2-stable 0693e07
@rafaelfranca rafaelfranca Merge pull request #7675 from jrochkind/fair_conn_pool_backport
backport fair connection pool 02b2335 to 3-2-stable
24a7774
@wagenet wagenet Respect `config.digest = false` for `asset_path`
Previously, the `asset_path` internals only respected the `:digest`
option, but ignored the global config setting. This meant that
`config.digest = false` could not be used in conjunction with
`config.compile = false` this corrects the behavior.
1ac19c1
@rafaelfranca rafaelfranca Merge pull request #7672 from wagenet/asset_path_digest_fix
Respect `config.digest = false` for `asset_path`
7c5454e
@steveklabnik steveklabnik Add upgrading note to 3.1 release notes.
See #7685.
1929d9f
@rafaelfranca rafaelfranca Merge pull request #7686 from steveklabnik/add_upgrade_note
Add upgrading note to 3.1 release notes.
29ebec7
@rafaelfranca rafaelfranca Cache columns metadata to avoid extra while testing a82f1e3
@rafaelfranca rafaelfranca Merge pull request #7668 from Draiken/fix_issue_6497
Removing to_shorthand to fix #6497
Conflicts:
	actionpack/CHANGELOG.md
61d5d2d
@jeremy @rafaelfranca jeremy Load the environment after creating the database
Conflicts:
	activerecord/lib/active_record/railties/databases.rake
c41f9c1
@kennyj kennyj Fix #6962. AS::TimeWithZone#strftime responds incorrectly to %:z and …
…%::z format strings.
4e715e3
@rafaelfranca rafaelfranca Merge pull request #7718 from kennyj/fix_6962-32
[3-2-stable] Fix #6962. AS::TimeWithZone#strftime responds incorrectly to %:z and %::z format strings.
50a76c1
@rafaelfranca rafaelfranca Revert "backport fair connection pool 02b2335 to 3-2-stable"
This reverts commit 0693e07.

Revert "Cache columns metadata to avoid extra while testing"

This reverts commit a82f1e3.

Reason: This is causing failures in the postgresql build.
See http://travis-ci.org/#!/rails/rails/builds/2485584

Related with #7675
e4018a0
@rafaelfranca rafaelfranca Revert "Respect `config.digest = false` for `asset_path`"
This reverts commit 1ac19c1.

Conflicts:
	actionpack/CHANGELOG.md

Reason: This is causing failures in the railties build.
See http://travis-ci.org/#!/rails/rails/jobs/2491787

Related with #7672
54f5574
@rafaelfranca rafaelfranca Explictly set the assets digest option to false 9d07ace
@rafaelfranca rafaelfranca Revert "Revert "Respect `config.digest = false` for `asset_path`""
This reverts commit 54f5574.

Reason: the last commit fixed the failing case
98f8021
@tenderlove @steveklabnik tenderlove Merge pull request #3544 from amatsuda/_field_changed
Rename field_changed? to _field_changed? so that users can create a field named field
Conflicts:

	activerecord/lib/active_record/core.rb
	activerecord/test/cases/dirty_test.rb
b8fba55
@rafaelfranca rafaelfranca Merge pull request #7723 from steveklabnik/backport_3554
Backport #3544 to 3-2-stable
7b545ff
@rafaelfranca rafaelfranca Fix invalid ruby 1.8 syntax 114e180
@jrochkind jrochkind ConnectionPool accepts spec key 'checkout_timeout'
Backport of #6441 cb6f839 . Old 'wait_timeout' is still supported,
but conflicts with mysql2 using that spec key for different thing.
'checkout_timeout' can now be used taking precedence for ConnectionPool
over 'wait_timeout'.
3908706
@rafaelfranca rafaelfranca Merge pull request #7684 from jrochkind/connection_pool_timeout_key_b…
…ackport

ConnectionPool accepts spec key 'checkout_timeout' (Backport)
8800aae
@jeremy jeremy Only apply log tags if the logger supports it 08ca483
@jeremy jeremy Log newlines separately to ensure the 'Started GET ...' line has a ta…
…g on the same line
032c2b6
@jeremy jeremy Add logger.push_tags and .pop_tags to complement logger.tagged
Avoid memory leak from unflushed logs on other threads leaving tags behind.

Conflicts:
	activesupport/CHANGELOG.md
	activesupport/lib/active_support/tagged_logging.rb
	activesupport/test/tagged_logging_test.rb
20f5f08
@jeremy jeremy Tune up Rails::Rack::Logger. Only put space between requests in devel…
…opment logs.

Conflicts:
	railties/test/application/rack/logger_test.rb
35a1750
@jeremy jeremy Shush syntax warnings ddba97f
@jeremy jeremy Shush uninitialized @_layout warning c203557
@jeremy jeremy Hashrocket for 1.8 support 8ca05c2
Evan Petrie backport 68677ff 8dbf337
@tenderlove tenderlove Merge pull request #7785 from okcwest/3-2-stable
backport 68677ff
e1a10b1
@yabawock Tim Vandecasteele Don't paramify ActionDispatch::Http::UploadedFile in tests
To test uploading a file without using fixture_file_upload, a posted
ActionDispatch::Http::UploadedFile should not be paramified (just like
Rack::Test::UploadedFile).
(Rack::Test::UploadedFile and ActionDispatch::Http::UploadedFile don't
share the same API, tempfile is not accessible on
Rack::Test::UploadedFile as discussed in
rack-test/rack-test#30)
c53e5de
@rafaelfranca rafaelfranca Merge pull request #7786 from yabawock/3-2-stable
Backport "Don't paramify ActionDispatch::Http::UploadedFile in tests"
c2a7084
@rafaelfranca rafaelfranca Merge pull request #7659 from HugoLnx/template_error_no_matches_rebased
REBASED: fixing assert_template bug when template matches expected, but not ends with
Conflicts:
	actionpack/CHANGELOG.md
	actionpack/lib/action_controller/test_case.rb
7d17cd2
@rafaelfranca rafaelfranca New CHANGELOG entries always in the top [ci skip] d77d4a8
@steveklabnik steveklabnik Fix reference to code sample in Getting Started.
Fixes #7799.
2475882
@fxn fxn Merge pull request #7802 from steveklabnik/issue_7799
Fix reference to code sample in Getting Started.
5cb5092
@jeremy jeremy Asset manifest includes aliases for foo.js -> foo/index.js and vice v…
…ersa. Bump Sprockets requirements from 2.1+ to 2.2+ and let it answer "should we compile this asset?" for us.
19987b6
@rafaelfranca rafaelfranca Since File instance doesn't respond to #open use a double to test the
behavior added at c53e5de
628e38d
@rafaelfranca rafaelfranca Merge pull request #6450 from iHiD/resource_generator_routes_master
Master branch: Fixed generated whitespace in routes when using namespaced resource.

Merge pull request #7811 from iHiD/resource_generator_routes_master

Fix the build (Broken scaffold routes test)
a02f67b
@rafaelfranca rafaelfranca Merge pull request #7789 from senny/7777_resource_functions_modify_op…
…tions

resource and resources do no longer modify passed options
3b5bc8d
@rafaelfranca rafaelfranca Merge pull request #7797 from senny/7459_prefix_tempalte_assertion_va…
…riables

prefix TemplateAssertions ivars.

Closes #7459
Conflicts:
	actionpack/lib/action_controller/test_case.rb
	actionpack/lib/action_view/test_case.rb
2bad605
@Mange
Mange commented on 19987b6 Oct 2, 2012

Thanks a lot!

Contributor
rwz replied Oct 2, 2012

I can't believe this was so damn easy. I really tried looking into it before and it seemed much more complicated back then :)

Contributor
route replied Oct 2, 2012

@jeremy ❤️

Contributor

This commit is adding /index.* aliases for every asset in my manifest.yml, including images. I don't think this is necessary, so it can be limited by checking if the index file exists with something like:

aliased_path = aliased_path_for asset.logical_path
if File.exists? "#{target}/#{aliased_path}"
  manifest[aliased_path] = digest_path
end
Owner

Sounds good @ndbroadbent - giving it a shot?

Could move the file existence check into aliased_path_for:

    def aliased_path_for(logical_path)
      if File.basename(logical_path).start_with?('index')
        logical_path.sub(/\/index([^\/]+)$/, '\1')
      else
        aliased_path = logical_path.sub(/\.([^\/]+)$/, '/index.\1')
        aliased_path if File.exist?("#{target}/#{aliased_path}")
      end
    end

Then skip absent aliases:

          if aliased_path = aliased_path_for(asset.logical_path)
            manifest[aliased_path] = digest_path
          end
Owner

@rwz Simple result... of a long evening full of facepalms :)

I tried a few different approaches, but our hands are tied by asset digests which leave us without a useful sprockets environment. So the only avenue left is to use the manifest. And sprockets itself doesn't normalize logical paths for us, or even express a preference for one form over another -- foo.js and foo/index.js are peers in its eyes, yet #each_logical_path yields foo/index.js. Argh!

Contributor

@jeremy, that looks great, thanks!

While we're on the topic of assets in Rails 3.2, I was wondering if you might be interested in taking a look at my pull request to improve asset compilation: #7866

rafaelfranca and others added some commits Oct 2, 2012
@rafaelfranca rafaelfranca Merge pull request #7822 from lulalala/reset-counter-cache-for-has-ma…
…ny-through

Fix reset_counters crashing on has_many :through associations.
Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/counter_cache.rb
3f0bc97
@spastorino @rafaelfranca spastorino Refactor
Conflicts:
	activerecord/lib/active_record/counter_cache.rb
288885f
@lihanli lihanli Update supported ruby versions error message in ruby_version_check.rb 36261c8
@rafaelfranca rafaelfranca Merge pull request #7836 from lihanli/error-msg-update
Update supported ruby versions error message in ruby_version_check.rb
95369a5
@rafaelfranca rafaelfranca Merge pull request #6978 from frodsan/count_nosql_unsaved_parent
Count returns 0 without querying if parent is not saved
9896729
@cliochris cliochris When serialising a class, specify the type of any singular associatio…
…ns, if

necessary. Rails already correctly specifies the :type of any enumerable
association (e.g. a has_many association), but made no attempt to do so for
non-enumerables (e.g. a has_one association).
We must specify the :type of any polymorphic association. A has_one
association to a class which uses single-table inheritance is an example of
a polymorphic association.
Fixes #7471
e7f7e35
@cliochris cliochris closed this Oct 5, 2012
@ndbroadbent

Sorry, should have added my comment here as a line note: 19987b6#commitcomment-1956232

@pixeltrix
Owner

I think this needs to be reverted as it may break quite a few apps. The shorthand syntax has historically ignored everything in the scope so changing it in a patch release is probably too risky. We definitely need to sort out the shorthand syntax for 4.0 though - I'll drop into Campfire later to discuss what needs fixing.

Owner

@pixeltrix yes I was waiting the release because of this guy issue. @rafaelfranca was trying to fix it in his branch https://github.com/rafaelfranca/rails/tree/route_fix Please let's discuss in CF so we can release the final version properly ❤️

@jmrepetti

I had to patch this line like this in Rails 3.2.22:

old == 0 && value.is_a?(String) && value.present? && value != '0' && !(value =~ /^0\.0*$/)

because I have problems when value is '0.0'

for example:

i = Item.find(277)
i.buffer
=> #<BigDecimal:7f80becd9510,'0.0',9(18)>
i.buffer.to_s
=> "0.0"
i.buffer = '0.0'
=> "0.0"
i.changed?
=> true

Probably I have to cast the input before, not sure. I'm receiving the value '0.0' from a web form. I know Rails 4 doesn't have this problem but I can't switch to Rails 4 now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment