aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/connection_adapters/type_lookup_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Enable `Layout/EmptyLinesAroundAccessModifier` copRyuta Kamizono2019-06-131-1/+0
| | | | | | | | | | | We sometimes say "✂️ newline after `private`" in a code review (e.g. https://github.com/rails/rails/pull/18546#discussion_r23188776, https://github.com/rails/rails/pull/34832#discussion_r244847195). Now `Layout/EmptyLinesAroundAccessModifier` cop have new enforced style `EnforcedStyle: only_before` (https://github.com/rubocop-hq/rubocop/pull/7059). That cop and enforced style will reduce the our code review cost.
* Revert commit 4ec5b0d6b4d8a57e034b1014942356e95caf47aa in favor of #28379Ryuta Kamizono2018-01-071-3/+3
| | | | | Commit 4ec5b0d was for fixing the regression #18787, but #28379 fixes #18787 as well. So 4ec5b0d is no longer necessary.
* Merge pull request #29869 from kamipo/make_type_map_to_privateRafael França2017-07-211-3/+3
|\ | | | | Make `type_map` to private because it is only used in the connection adapter
| * Make `type_map` to private because it is only used in the connection adapterRyuta Kamizono2017-07-201-3/+3
| | | | | | | | | | | | | | `type_map` is an internal API and it is only used in the connection adapter. And also, some type map initializer methods requires passed `type_map`, but those instances already has `type_map` in itself. So we don't need explicit passing `type_map` to the initializers.
* | Use frozen-string-literal in ActiveRecordKir Shatrov2017-07-191-0/+2
|/
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Fix a test of AR::Type::TypeMap#lookup when using OracleKoichi ITO2017-02-021-6/+14
|
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-86/+86
|
* applies new string literal convention in activerecord/testXavier Noria2016-08-061-41/+41
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Fix some typos in comments.Joe Rafaniello2016-05-041-1/+1
| | | | [ci skip]
* Map :bigint as NUMBER(19) sql_type by using `:limit => 19` for OracleYasuo Honda2015-06-011-1/+5
| | | | | | | | | | | | | | | | | | | since NUMBER(8) is not enough to store the maximum number of bigint. Oracle NUMBER(p,0) as handled as integer because there is no dedicated integer sql data type exist in Oracle database. Also NUMBER(p,s) precision can take up to 38. p means the number of digits, not the byte length. bigint type needs 19 digits as follows. $ irb 2.2.2 :001 > limit = 8 => 8 2.2.2 :002 > maxvalue_of_bigint = 1 << ( limit * 8 - 1) => 9223372036854775808 2.2.2 :003 > puts maxvalue_of_bigint.to_s.length 19 => nil 2.2.2 :004 >
* `type_cast_from_user` -> `cast`Sean Griffin2015-02-171-1/+1
|
* Properly lookup the limit for bigintSean Griffin2015-02-021-0/+5
| | | | Fixes #18787.
* Rename `type_cast` to `type_cast_from_database`Sean Griffin2014-06-091-1/+1
| | | | | | | | In some cases there is a difference between the two, we should always be doing one or the other. For convenience, `type_cast` is still a private method on type, so new types that do not need different behavior don't need to implement two methods, but it has been moved to private so it cannot be used accidentally.
* Remove special case in schema dumper for decimal without scaleSean Griffin2014-05-231-6/+10
|
* Remove :timestamp column typeSean Griffin2014-05-191-5/+2
| | | | | | | | | | | | The `:timestamp` type for columns is unused. All database adapters treat them as the same database type. All code in `ActiveRecord` which changes its behavior based on the column's type acts the same in both cases. However, when the type is passed to code that checks for the `:datetime` type, but not `:timestamp` (such as XML serialization), the result is unexpected behavior. Existing schema definitions will continue to work, and the `timestamp` type is transparently aliased to `datetime`.
* Delegate `Column#type` to the injected type objectSean Griffin2014-05-191-0/+100
The decision to wrap type registrations in a proc was made for two reasons. 1. Some cases need to make an additional decision based on the type (e.g. a `Decimal` with a 0 scale) 2. Aliased types are automatically updated if they type they point to is updated later. If a user or another adapter decides to change the object used for `decimal` columns, `numeric`, and `number` will automatically point to the new type, without having to track what types are aliased explicitly. Everything else here should be pretty straightforward. PostgreSQL ranges had to change slightly, since the `simplified_type` method is gone.