| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ \ \ \ \
| | | | | |
| | | | | | |
Add iso8601 and rfc3339 parsing to timezones
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
For naming consistency when using the RFC 3339 profile
of ISO 8601 in applications.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The `Time.xmlschema` and consequently its alias `iso8601` accepts
timestamps without a offset in contravention of the RFC 3339
standard. This method enforces that constraint and raises an
`ArgumentError` if it doesn't.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Previously there was no way to get a RFC 3339 timestamp
into a specific timezone without either using `parse` or
chaining methods. The new method allows parsing directly
into the timezone, e.g:
>> Time.zone = "Hawaii"
=> "Hawaii"
>> Time.zone.rfc3339("1999-12-31T14:00:00Z")
=> Fri, 31 Dec 1999 14:00:00 HST -10:00
This new method has stricter semantics than the current
`parse` method and will raise an `ArgumentError`
instead of returning nil, e.g:
>> Time.zone = "Hawaii"
=> "Hawaii"
>> Time.zone.rfc3339("foobar")
ArgumentError: invalid date
>> Time.zone.parse("foobar")
=> nil
It will also raise an `ArgumentError` when either the
time or offset components are missing, e.g:
>> Time.zone = "Hawaii"
=> "Hawaii"
>> Time.zone.rfc3339("1999-12-31")
ArgumentError: invalid date
>> Time.zone.rfc3339("1999-12-31T14:00:00")
ArgumentError: invalid date
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Previously there was no way to get a ISO 8601 timestamp into a specific
timezone without either using `parse` or chaining methods. The new method
allows parsing directly into the timezone, e.g:
>> Time.zone = "Hawaii"
=> "Hawaii"
>> Time.zone.iso8601("1999-12-31T14:00:00Z")
=> Fri, 31 Dec 1999 14:00:00 HST -10:00
If the timestamp is a ISO 8601 date (YYYY-MM-DD) then the time is set
to midnight, e.g:
>> Time.zone = "Hawaii"
=> "Hawaii"
>> Time.zone.iso8601("1999-12-31")
=> Fri, 31 Dec 1999 00:00:00 HST -10:00
This new method has stricter semantics than the current `parse` method
and will raise an `ArgumentError` instead of returning nil, e.g:
>> Time.zone = "Hawaii"
=> "Hawaii"
>> Time.zone.iso8601("foobar")
ArgumentError: invalid date
>> Time.zone.parse("foobar")
=> nil
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
Fix spelling in docs
|
|/ / / / /
| | | | |
| | | | | |
[ci skip]
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
It turns out that we don't need to require system tests in the railties
test helper so we can remove it. If you're using system tests they will
be loaded by inheriting from ActionDispatch::SystemTestCase and the
routes will be loaded by ActionDispatch::IntegrationTest.
|
|\ \ \ \
| |/ / /
|/| | | |
Remove `node` parameter to `join_constraints`
|
|/ / /
| | |
| | |
| | |
| | | |
I don't think we actually need this parameter anymore. Nobody seems to
be using it.
|
| | | |
|
|\ \ \
| | | |
| | | | |
Fix random failure on system test with ajax
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
If application has ajax, browser may begin request after rollback.
`teardown_fixtures` will be called after `super` on `after_teardown`
so we must call `Capybara.reset_sessions!` before `super`
https://github.com/rails/rails/blob/b61a56541aecd7ac685d4f19d943177a3f1b465a/activerecord/lib/active_record/fixtures.rb#L857
|
|\ \ \ \
| |/ / /
|/| | | |
Deprecate implicit coercion of `ActiveSupport::Duration`
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Currently `ActiveSupport::Duration` implicitly converts to a seconds
value when used in a calculation except for the explicit examples of
addition and subtraction where the duration is the receiver, e.g:
>> 2 * 1.day
=> 172800
This results in lots of confusion especially when using durations
with dates because adding/subtracting a value from a date treats
integers as a day and not a second, e.g:
>> Date.today
=> Wed, 01 Mar 2017
>> Date.today + 2 * 1.day
=> Mon, 10 Apr 2490
To fix this we're implementing `coerce` so that we can provide a
deprecation warning with the intent of removing the implicit coercion
in Rails 5.2, e.g:
>> 2 * 1.day
DEPRECATION WARNING: Implicit coercion of ActiveSupport::Duration
to a Numeric is deprecated and will raise a TypeError in Rails 5.2.
=> 172800
In Rails 5.2 it will raise `TypeError`, e.g:
>> 2 * 1.day
TypeError: ActiveSupport::Duration can't be coerced into Integer
This is the same behavior as with other types in Ruby, e.g:
>> 2 * "foo"
TypeError: String can't be coerced into Integer
>> "foo" * 2
=> "foofoo"
As part of this deprecation add `*` and `/` methods to `AS::Duration`
so that calculations that keep the duration as the receiver work
correctly whether the final receiver is a `Date` or `Time`, e.g:
>> Date.today
=> Wed, 01 Mar 2017
>> Date.today + 1.day * 2
=> Fri, 03 Mar 2017
Fixes #27457.
|
|\ \ \ \
| | | | |
| | | | | |
Fix typo in Upgrading Ruby on Rails Guide
|
|/ / / / |
|
|\ \ \ \
| | | | |
| | | | | |
fixed suspected typo in sample sql query
|
| | |_|/
| |/| | |
|
| | | |
| | | |
| | | |
| | | | |
Includes a script to ease an app's upgrade.
|
| | | | |
|
| | | | |
|
| | | | |
|
|\ \ \ \
| |/ / /
|/| | | |
Update secrets to use modern crypto
|
| | | |
| | | |
| | | |
| | | | |
Fixes #28135.
|
|\ \ \ \
| |_|/ /
|/| | | |
Use `blank?` instead of `empty?`
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
In order to avoid `NoMethodError` when it is nil.
Follow up to 82f7dc6178f86e5e2dd82f9e528475a6acee6cd8
|
|\ \ \ \
| |/ / /
|/| | | |
Update `DateTime#change` to support usec and nsec
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Adding support for these options now allows us to update the
`DateTime#end_of` methods to match the equivalent `Time#end_of`
methods, e.g:
datetime = DateTime.now.end_of_day
datetime.nsec == 999999999 # => true
Fixes #21424.
|
|\ \ \ \
| | | | |
| | | | | |
`valid_type?` should accept only supported types
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
`valid_type?` is used in schema dumper to determine if a type is
supported. So if `valid_type?(:foobar)` is true, it means that schema
dumper is allowed to create `t.foobar`. But it doesn't work. I think
that `valid_type?` should accept only supported types.
https://github.com/rails/rails/blob/v5.1.0.beta1/activerecord/lib/active_record/schema_dumper.rb#L135-L142
```ruby
columns.each do |column|
raise StandardError, "Unknown type '#{column.sql_type}' for column '#{column.name}'" unless @connection.valid_type?(column.type)
next if column.name == pk
type, colspec = @connection.column_spec(column)
tbl.print " t.#{type} #{column.name.inspect}"
tbl.print ", #{format_colspec(colspec)}" if colspec.present?
tbl.puts
end
```
|
| | | | |
| | | | |
| | | | |
| | | | | |
Just dispatch to the command help itself for more info.
|
| | | | |
| | | | |
| | | | |
| | | | | |
Prefer Thor's say method to Kernel's plain puts.
|
| |/ / /
|/| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
In case there's no $EDITOR assigned users would see a cryptic:
```
% EDITOR= bin/rails secrets:edit
Waiting for secrets file to be saved. Abort with Ctrl-C.
sh: /var/folders/wd/xnncwqp96rj0v1y2nms64mq80000gn/T/secrets.yml.enc: Permission denied
New secrets encrypted and saved.
```
That error is misleading, so give a hint in this easily detectable case.
Fixes #28143.
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
y-yagi/use_appropriate_type_for_test_framework_option
Use appropriate type for `test_framework` option
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This fixes the following warning.
```
Expected string default value for '--test-framework'; got false (boolean)
```
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Use DEFAULT_CIPHER constant in MessageEncryptor
|
|/ / / / / |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Support for using `SELECT` column or expression aliases in the `HAVING`
clause isn't part of the SQL standard so it's better to whitelist the
test for adapters where we know it works and skip it on others.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
`HOST` must be all capital letters
|
| |/ / / /
| | | | |
| | | | |
| | | | | |
Ref: https://github.com/rails/rails/blob/master/railties/lib/rails/commands/server/server_command.rb#L194
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Use `inspect` in `type_cast_for_schema` for date/time and decimal values
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Currently dumping defaults on schema is inconsistent.
Before:
```ruby
create_table "defaults", force: :cascade do |t|
t.string "string_with_default", default: "Hello!"
t.date "date_with_default", default: '2014-06-05'
t.datetime "datetime_with_default", default: '2014-06-05 07:17:04'
t.time "time_with_default", default: '2000-01-01 07:17:04'
t.decimal "decimal_with_default", default: 1234567890
end
```
After:
```ruby
create_table "defaults", force: :cascade do |t|
t.string "string_with_default", default: "Hello!"
t.date "date_with_default", default: "2014-06-05"
t.datetime "datetime_with_default", default: "2014-06-05 07:17:04"
t.time "time_with_default", default: "2000-01-01 07:17:04"
t.decimal "decimal_with_default", default: "1234567890"
end
```
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Allow skipping of turbolinks for test dummy application for plugin/engine
|
| | |_|/ / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | | |
When `rails new plugin` is invoked, turbolinks should be skipped in the dummy
test application generated by the plugin generator.
|
|\ \ \ \ \ \
| |_|_|/ / /
|/| | | | | |
Make required by default test for belongs_to association clearer
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Since #18937 `belongs_to` associations receive a setting to determine if
it should be or not treated as `required` by default.
While the tests were still passing, it was not evident that the
"default" behaviour for `required` could change in fuction of a setting,
that is set by default for fresh Rails5 apps, but not for upgraded
apps.
This commit try to relate them to make it clear what is the behaviour
expected when the setting is set as `true` or not set.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
kamipo/create_join_table_respects_reference_key_type
`create_join_table` should respect `references` column type
|
| | |/ / / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Follow up of #26266.
The default type of `primary_key` and `references` were changed to
`bigint` since #26266. But `create_join_table` column type is still
`integer`. It should respect `references` column type.
|