Commit Graph

55670 Commits

Author SHA1 Message Date
Rafael França
6a42f0093e Merge pull request #22945 from kamipo/refactor_connection_insert_sql
Refactor `connection.insert_sql`
2016-01-06 18:44:23 -02:00
Ryuta Kamizono
2bce5adf5c Refactor connection.insert_sql
`connection.insert_sql` is almost the same as `connection.insert`.
2016-01-07 05:13:29 +09:00
Richard Schneeman
cc58837f64 Merge pull request #22933 from schneems/schneems/fix-broadcast
[close #22917] Don't output to `STDOUT` twice
2016-01-06 11:03:42 -06:00
schneems
b33a5ed67e Remove unused instance variable 2016-01-06 10:25:12 -06:00
schneems
3d10d9d6c3 [close #22917] Don't output to STDOUT twice
When `rails console` or `rails server` are used along with a logger set to output to `STDOUT` then the contents will show up twice. This happens because the logger is extended with `ActiveSupportLogger.broadcast` with a destination of STDOUT even if it is already outputting to `STDOUT`.

Previously PR #22592 attempted to fix this issue, but it ended up causing NoMethodErrors. A better approach than relying on adding a method and flow control is to inspect the log destination directly. For this `ActiveSupport::Logger.logger_outputs_to?` was introduced

```ruby
logger = Logger.new(STDOUT)
ActiveSupport::Logger.logger_outputs_to?(logger, STDOUT)
# => true
```

To accomplish this we must look inside of an instance variable of standard lib's Logger `@logdev`. There is a related Ruby proposal to expose this method in a standard way: https://bugs.ruby-lang.org/issues/11955
2016-01-06 09:55:35 -06:00
Matthew Draper
998b85ffe8 Merge pull request #22941 from lsylvester/pg-remove-index-legacy
Fix remove_index for postgresql when running legacy migrations
2016-01-07 01:11:17 +10:30
Matthew Draper
4137d44b22 Merge pull request #22940 from lsylvester/activemodel-depends-on-builder-but-doesnt-use-it
remove activemodel dependency on builder
2016-01-07 01:01:17 +10:30
Lachlan Sylvester
76dc41abdb fix remove_index for postgresql when running legacy migrations 2016-01-06 19:20:11 +11:00
Lachlan Sylvester
4ba66ef108 remove activemodel dependency on builder 2016-01-06 18:55:59 +11:00
Rafael França
0ff3e9466a Merge pull request #22939 from y-yagi/make_generated_controller_test_file_work_correctly
make generated controller test work correctly
2016-01-06 04:51:44 -02:00
yuuji.yaginuma
229064cf3a make generated controller test work correctly
Since the `#file_name` that not consideration for the namespace, if generate a controller with a namespace,
not the correct url helper generation, it had become an error to run the test.

Modified to generate the correct url helper, even if it is produced a namespace with controller.
2016-01-06 15:12:19 +09:00
Rafael França
c6bdaf1282 Merge pull request #22921 from prathamesh-sonpatki/fix-add-reference
Autoload ReferenceDefinition class in abstract adapter so that it can be used by #add_reference in schema_statements
2016-01-06 03:42:32 -02:00
Rafael Mendonça França
059820c09a Merge pull request #21688 from kamipo/add_text_and_blob_shorthand_methods
Add short-hand methods for text and blob types in MySQL
2016-01-06 03:21:14 -02:00
Rafael França
ced9612b59 Merge pull request #22275 from mastahyeti/per-form-csrf
Per-form CSRF tokens
2016-01-06 02:55:10 -02:00
Rafael França
5c9a0a4a08 Merge pull request #22938 from sblackstone/master
Provide a better error message if a user mistypes the name of script …
2016-01-06 02:20:37 -02:00
Stephen Blackstone
02d2d3cf69 Provide a better error message if a user mistypes the name of script with runner
Add tests for detecting bad options for runner
2016-01-05 23:13:13 -05:00
Rafael Mendonça França
53954aa476 Move CHANGELOG entry to Active Record
While the type definition is in Active Model the change of behavior will
be only user facing in Active Record so better to put the entry in its
changelog.

[ci skip]
2016-01-05 23:00:57 -02:00
Rafael França
11e7c605a4 Merge pull request #20544 from Envek/fix_utc_offset_for_time_attributes
Take UTC offset into account when assigning string value to time attributes.
2016-01-05 22:59:11 -02:00
Rafael França
91ceac3728 Merge pull request #22920 from kamipo/fix_connection_create
Fix `connection#create` in PG adapter
2016-01-05 22:39:50 -02:00
Mike Perham
cd1d7e287b don't need explicit dep and a pretty neat pick 2016-01-05 16:26:53 -08:00
Mike Perham
e529e3428e Use Module#thread_mattr_accessor 2016-01-05 15:11:10 -08:00
Mike Perham
2bb65e64e6 Remove celluloid references 2016-01-05 15:10:11 -08:00
Mike Perham
547713b4c9 Move async execution from celluloid to concurrent-ruby
This removes 8 runtime gem dependencies from Rails:

```
Using hitimes 1.2.3
Using timers 4.1.1
Using celluloid-essentials 0.20.5
Using celluloid-extras 0.20.5
Using celluloid-fsm 0.20.5
Using celluloid-pool 0.20.5
Using celluloid-supervision 0.20.5
Using celluloid 0.17.2
```
2016-01-05 14:31:16 -08:00
schneems
9dcb1b9b07 Revert "Add Logger option to disable message broadcasts"
This reverts related commits due to #22917.
2016-01-05 16:24:35 -06:00
Santiago Pastorino
b7b508aa79 Prefer inspect over escaping and sorround by quote marks 2016-01-05 18:32:16 -03:00
Santiago Pastorino
8a998b0fa7 Add Html template handler that wraps Raw output in an OutputBuffer
This fixes the case when you try to render an html you know safe and the
file is named something.html. With this commit the content of the html
won't be escaped anymore because AV won't use Raw handler and choose
Html handler instead.
2016-01-05 16:54:39 -03:00
Andrey Novikov
0a0ffb64d8 Take UTC offset into account when assigning string value to time attribute. 2016-01-05 18:35:04 +03:00
Claudio B
3d90a6348d Merge pull request #22922 from vhf/add_fpb_back
[ci skip] Update doc/resource link removed by #21211
2016-01-05 04:23:44 -08:00
Claudio B
af6dcd5a4f Merge pull request #22927 from jmgcrespo/jmgcrespo-patch-1
[ci skip] Add job suffix to sample's job file name
2016-01-05 04:21:43 -08:00
Manu
f82ed2dab4 Add job suffix to sample's job file name 2016-01-05 11:28:55 +00:00
Victor Felder
2f7d6c57d5 [ci skip] Update doc/resource link removed by #21211 2016-01-05 09:11:41 +01:00
Prathamesh Sonpatki
b466e5fad5 Autoload ReferenceDefinition class in abstract adapter so that it can be used by #add_reference in schema_statements
- Fixes #22916.
2016-01-05 13:29:09 +05:30
Akira Matsuda
333aab3d51 ✂️ Unnecessary spacing in the generated code 2016-01-05 12:57:51 +09:00
Ryuta Kamizono
4d4239f980 Add short-hand methods for text and blob types in MySQL
In Pg and Sqlite3, `:text` and `:binary` have variable unlimited length.
But in MySQL, these have limited length for each types (ref #21591, #21619).
This change adds short-hand methods for each text and blob types.

Example:

    create_table :foos do |t|
      t.tinyblob   :tiny_blob
      t.mediumblob :medium_blob
      t.longblob   :long_blob
      t.tinytext   :tiny_text
      t.mediumtext :medium_text
      t.longtext   :long_text
    end
2016-01-05 10:36:37 +09:00
Ryuta Kamizono
326b12ae52 Fix connection#create in PG adapter
Originally `connection#create` had aliased to `connection#insert` in PG
adapter. But it was broken by #7447. Re-alias `create` to `insert` for
fixing it.
2016-01-05 10:02:29 +09:00
Rafael França
35dd9e9f2a Merge pull request #22896 from kamipo/fix_unsigned_and_blob_or_text_column
Fix `unsigned?` and `blob_or_text_column` for Enum columns in MySQL
2016-01-04 21:14:50 -02:00
Rafael França
8788c7ce84 Merge pull request #22906 from bf4/rendering_exceptions
Add ActionController:Renderers test
2016-01-04 21:12:11 -02:00
Sean Griffin
c2181fbcb7 Merge pull request #22550 from tamird/record-fetch-warning-allocate-less
activerecord: allocate fewer objects
2016-01-04 15:15:55 -07:00
Eileen M. Uchitelle
9fb4efedfc Merge pull request #22915 from kamipo/fix_user_name_in_doc
Fix user name in doc [ci skip]
2016-01-04 15:52:23 -05:00
Ben Toews
3e98819e20 add option for per-form CSRF tokens 2016-01-04 12:26:38 -07:00
Rafael Mendonça França
e165f7fa60 Update the maintenance policy for the next release. 2016-01-04 17:23:34 -02:00
Arthur Nogueira Neves
5ba6999637 Merge pull request #22821 from shosti/set-null-transaction
Allow add_to_transaction with null transaction
2016-01-04 13:37:49 -05:00
Tamir Duberstein
0aa5150f9f activerecord: reuse immutable objects 2016-01-04 12:09:37 -05:00
Rafael França
4158974c60 Merge pull request #22764 from stevenspiel/titleize_model_name_for_default_submit_button_value
titleize the model name on default submit buttons
2016-01-04 11:10:44 -02:00
Tamir Duberstein
a08dc46a0e activerecord: allocate fewer arrays in RecordFetchWarning 2016-01-04 07:58:32 -05:00
Ryuta Kamizono
2f373dd916 Fix unsigned? and blob_or_text_column? for Enum columns in MySQL 2016-01-04 14:46:59 +09:00
Benjamin Fleischer
f2b3b4019a Group related methods together 2016-01-03 22:54:42 -06:00
Benjamin Fleischer
f27360af04 Add ActionController:Renderers test
To complement actionpack/test/controller/metal/renderers_test.rb
2016-01-03 22:51:45 -06:00
Santiago Pastorino
3d590add45 Merge pull request #22890 from DNNX/times-map
Replace x.times.map{} with Array.new(x){} in AD::Journey::Path::Pattern
2016-01-03 20:23:50 -03:00
Zachary Scott
3273c61b2b Merge pull request #22904 from davydovanton/doc-typo-test-name
Fix typo in test description
2016-01-04 06:20:59 +09:00