Rafael Mendonça França
a699f5d3e1
Merge pull request #18309 from PaBLoX-CL/fix-fixtures-references
...
Generated fixtures won't use parent_id when generated with
parent:references
2015-01-02 23:02:53 -03:00
Pablo Olmos de Aguilera Corradini
9405ecdd98
Generated fixtures won't use parent_id when generated with parent:references
...
Fix #18301
2015-01-02 23:01:24 -03:00
Rafael Mendonça França
3456d543eb
Merge pull request #10380 from JonRowe/test_all_domain_2_letter_tld
...
Assert that 2 letter tlds with 3 letter domain names work when option specified.
2015-01-02 21:27:38 -03:00
Rafael Mendonça França
540a818526
Merge pull request #18307 from brainopia/datetime_regression
...
Fully support datetime values in AR::Type::DateTime#type_cast_for_database
2015-01-02 20:59:19 -03:00
Rafael Mendonça França
41740be7c4
Merge pull request #18308 from jcoyne/i18n_translate_safety
...
Unsafe default translations should not be marked html_safe
2015-01-02 20:55:34 -03:00
Justin Coyne
fab50c130b
Unsafe default translations should not be marked html_safe
...
Previously default translation keys that didn't end in `_html`, but came
after a missing key that ended in `_html` were being returned as
html_safe. Now they are not. Fixes #18257
2015-01-02 17:07:01 -06:00
brainopia
e8d6ba218a
Support datetime values in AR::Type::DateTime#type_cast_for_database
2015-01-03 02:03:47 +03:00
Rafael Mendonça França
2ade177b37
Merge pull request #18279 from eileencodes/refactor-association-scope
...
Refactoring of add_constraints in AssociationScope
2015-01-02 19:57:26 -03:00
Rafael Mendonça França
eed68fddee
Merge pull request #9065 from atombender/master
...
Fix TaggedLogging to allow loggers to be instantiated multiple times without having to share the stack of tags
2015-01-02 19:55:29 -03:00
Rafael Mendonça França
734d97d292
Deprecate MissingSourceFile
in favor of LoadError
.
...
`MissingSourceFile` was just an alias to `LoadError` and was not
being raised inside the framework.
2015-01-02 19:44:39 -03:00
Rafael Mendonça França
48deeab90a
Merge pull request #8740 from amatsuda/missing_source_file
...
replace use of MissingSourceFile with LoadError
Conflicts:
activesupport/test/core_ext/load_error_test.rb
2015-01-02 19:19:59 -03:00
eileencodes
b0d87a725a
Cleanup methods, missing spacing and missing nodocs
...
Add missing nodoc's
Change `assoc_klass` argument name to `association_klass`
Change `prev_reflection` argument name to `previous_reflection`
Change `prev` to `previous_reflection` in `#get_chain`
Switch use of `refl` and `reflection` in `#get_chain` so main parameter
is not abbreviated.
Add missing space in `#add_constraints`
2015-01-02 17:16:15 -05:00
eileencodes
39abe8355a
Move #type_caster
to alias tracker initialize
...
This moves the `#type_caster` from the `aliased_table_for` and into the
initialize of the `alias_tracker`.
2015-01-02 17:15:31 -05:00
eileencodes
96e277c03b
Add #all_includes
method to reflections
...
`yield` instead of relying on checking if the reflection is equal to the
`chain_head`.
2015-01-02 17:15:31 -05:00
eileencodes
0408e212ca
Initialze #alias_tracker
with base table name
...
Instead of initializing an empty connection use the base table name
instead. Split up and refactor `#create` to be 2 methods `#create` and
`#create_with_joins`. Removes the need to update the count by 1 on
initialzing a JoinDependency.
2015-01-02 17:15:31 -05:00
eileencodes
16fafd6588
Move alias_candiate
into AbstractReflection
...
This moves `alias_candidate` out of the `ReflectionProxy` and into the
`AbstractReflection` so it is shared by all reflections. Change
`alias_name` to a method and and remove assignment in `#get_chain`.
2015-01-02 17:15:31 -05:00
eileencodes
cc9b813a82
Pass connection
rather than alias_tracker
...
After the refactorings we're only using the connection and not the alias
tracker anymore. This builds on commit 18019.
Reuse the already available `@connection` to reduce the surface area of
the alias tracker's API. We can then remove the `attr_reader` because
the connection is already available.
2015-01-02 17:15:31 -05:00
eileencodes
f6729309a0
Assign the #alias_name
to each reflection
...
This makes the `#alias_name` more functional.
2015-01-02 17:15:31 -05:00
eileencodes
e9684d6c88
Clean up / refactor new reflection classes
...
Move `RuntimeReflection` and `PolymorphicReflect` into Reflection. This
allows the methods to inherit from `ThroughReflection` and DRY up the
methods by removing duplicates.
2015-01-02 17:15:31 -05:00
eileencodes
4d27d56c35
Refactor #get_chain
iteration to a linked list
...
The linked list lets us use a loop in `#add_constraints` and completely
remove the need for indexing the iteration becasue we have access to the
next item in the chain.
2015-01-02 17:15:31 -05:00
eileencodes
17f6ca1e8a
Refactor #get_chain
to remove need for #construct_tables
...
By concatnating the `ReflectionProxy` with the `chain` we remove
the need for `#construct_tables` because the `chain` is now in the
correct order (order of the chain DOES matter).
2015-01-02 17:15:31 -05:00
eileencodes
5b0b3cce5c
Move #alias_name
to ReflectionProxy
class
...
Putting the `#alias_name` into ReflectionProxy means we don't have to
cache the `#alias_name` globally anymore - it's not cached per query.
2015-01-02 17:15:30 -05:00
eileencodes
092171da30
Clean up assignments in #add_constraints
...
`is_first_chain`, `items` and `klass` are no longer beneficial and can
be called directly instead of via their assignments - because they are
each only used once.
2015-01-02 17:15:30 -05:00
eileencodes
076682692c
Refactor construct_tables method
...
Move method structure into reflection classes for accessibly on each
reflection rather than by traversing the chain.
2015-01-02 17:15:30 -05:00
eileencodes
69d05ae3e5
Add RuntimeReflection for recursive access to chain
...
The `RuntimeReflection` class allows the reflection to be accessed at
runtime - then we always know which reflection we are accessing in the
chain. The `#get_chain` method then allows us to recursively access the
chain through the `RuntimeReflection`.
2015-01-02 17:15:30 -05:00
eileencodes
08acb4bccb
Add PolymorphicReflection and constraints method
...
`#constraints` builds a flattened version of `scope_chain` to
allow it to be accessible without requiring an index when iterating
over the `scope_chain`
2015-01-02 17:15:30 -05:00
Rafael Mendonça França
9b366b95f9
Don't test invalid log encoding against PostgreSQL adapter
...
It already treats the message
2015-01-02 19:00:33 -03:00
Robin Dupret
4b04fc0528
A quick pass through NestedAttributes' doc [ci skip]
2015-01-02 22:05:52 +01:00
Zachary Scott
de1c1a6f7b
Revert part of 996e646bd8cff3bcf2b13863439f48d3e744cdae [ci skip]
2015-01-02 12:19:52 -08:00
Robin Dupret
843fc99786
Follow up to #17973 [ci skip]
2015-01-02 20:26:39 +01:00
Rafael Mendonça França
c2d2a7d4cc
Merge pull request #17822 from kamipo/refactor_visit_change_column_definition
...
Refactor `visit_ChangeColumnDefinition`
2015-01-02 16:21:55 -03:00
Rafael Mendonça França
3793b4063a
Merge pull request #8547 from printercu/patch-1
...
fix for messages in invalid encoding from db-drivers
Conflicts:
activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
activerecord/test/cases/connection_adapters/abstract_adapter_test.rb
2015-01-02 16:15:18 -03:00
Ryuta Kamizono
3c10043bc2
Refactor visit_ChangeColumnDefinition
...
`visit_ChangeColumnDefinition` is the same "CHANGE column_name " + `visit_ColumnDefinition(o)`.
2015-01-03 02:46:07 +09:00
Ryuta Kamizono
84859c45a7
Add default value for create_table_definition
...
In most cases, `create_table_definition` called by table_name (the first
argument) only.
2015-01-03 02:38:22 +09:00
Rafael Mendonça França
dbe7fe289c
Merge pull request #17820 from fw42/restore_query_cache_on_rollback
...
Clear query cache on rollback
2015-01-02 14:36:23 -03:00
Rafael Mendonça França
ecdae459d2
Merge pull request #15309 from iantropov/issue_12698_build_through
...
Add setting of FK for throgh associations while building
Conflicts:
activerecord/CHANGELOG.md
activerecord/test/cases/associations/has_many_through_associations_test.rb
2015-01-02 14:29:07 -03:00
Rafael Mendonça França
2d743b528c
Merge pull request #17978 from kommen/fixed-pr-14903
...
Ensure append_info_to_payload is called even if an exception is raised.
Conflicts:
actionpack/CHANGELOG.md
2015-01-02 14:16:15 -03:00
Rafael Mendonça França
873870df4c
Merge pull request #17974 from killthekitten/fix-render-block
...
Make possible to use blocks with short version of render partial
Conflicts:
actionview/CHANGELOG.md
2015-01-02 14:12:23 -03:00
Rafael Mendonça França
c455817804
Merge pull request #17973 from maurogeorge/file_field_hidden_field
...
Generate a hidden_tag when using a file_field
2015-01-02 13:57:33 -03:00
Rafael Mendonça França
8b3cd74b8a
Remove thread variables backport
...
They are already present on Ruby 2.2
2015-01-02 13:50:11 -03:00
Rafael Mendonça França
a908e01ac0
Merge pull request #18228 from kamipo/correctly_dump_primary_key
...
Improve a dump of the primary key support.
Conflicts:
activerecord/CHANGELOG.md
2015-01-02 13:37:26 -03:00
Rafael Mendonça França
78dab2a856
Remove support to activerecord-deprecated_finders
2015-01-02 12:06:24 -03:00
Rafael Mendonça França
e8615b99c6
Merge pull request #16749 from robin850/rbx-name-error
...
Rely on NameError#name instead of its error message
2015-01-02 11:22:03 -03:00
Rafael Mendonça França
acb1991910
Merge pull request #18067 from kamipo/format_datetime_string_according_to_precision
...
Format the datetime string according to the precision of the datetime field.
Conflicts:
activerecord/CHANGELOG.md
2015-01-02 11:17:55 -03:00
Mauro George
00b26532f0
Add a hidden_field on the file_field
...
This will avoid a error be raised when the only input on the form is the
`file_field`.
2015-01-02 12:15:03 -02:00
Rafael Mendonça França
bed2bdb17c
Merge pull request #15746 from amccloud/auto-inverse_of-in-module
...
Fixed automatic inverse_of for models nested in module
Conflicts:
activerecord/CHANGELOG.md
2015-01-02 11:06:17 -03:00
Rafael Mendonça França
6442c90f09
Merge pull request #18298 from brainopia/integration_requests_without_setup
...
Integration requests should work in contexts without setup and teardown
2015-01-02 10:59:59 -03:00
brainopia
95333e1317
Integration requests should work in contexts without setup and teardown
2015-01-02 16:52:32 +03:00
Rafael Mendonça França
9598c9655f
Merge pull request #11898 from prathamesh-sonpatki/patch-update
...
Changed ActiveRecord::Relation#update behavior so that it will work on Relation objects without giving id
Conflicts:
activerecord/CHANGELOG.md
2015-01-02 10:48:48 -03:00
Rafael Mendonça França
a016f9b728
Merge pull request #18290 from lucascaton/guides_updates
...
Updating guides for Rails 5.0
2015-01-02 10:38:53 -03:00