aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #18850 from ↵Andrew White2015-02-085-19/+50
|\ | | | | | | | | kamipo/fix_rounding_problem_for_postgresql_timestamp_column Fix rounding problem for PostgreSQL timestamp column
| * Fix rounding problem for PostgreSQL timestamp columnRyuta Kamizono2015-02-085-19/+50
|/ | | | | If timestamp column have the precision, it need to format according to the precision of timestamp column.
* Merge pull request #18602 from kamipo/respect_database_charset_and_collationAndrew White2015-02-083-5/+21
|\ | | | | Respect the database default charset for `schema_migrations` table.
| * Respect the database default charset for `schema_migrations` table.Ryuta Kamizono2015-02-083-5/+21
| | | | | | | | | | | | The charset of `version` column in `schema_migrations` table is depend on the database default charset and collation rather than the encoding of the connection.
* | Merge pull request #18848 from kamipo/add_auto_increment_methodAndrew White2015-02-082-3/+7
|\ \ | | | | | | Add `auto_increment?` instead of `extra == 'auto_increment'`
| * | Add `auto_increment?` instead of `extra == 'auto_increment'`Ryuta Kamizono2015-02-082-3/+7
| |/
* | Merge pull request #18851 from kamipo/remove_unused_lineAndrew White2015-02-081-1/+0
|\ \ | | | | | | Remove unused line
| * | Remove unused lineRyuta Kamizono2015-02-081-1/+0
| |/
* | Merge pull request #18852 from kamipo/missing_atAbdelkader Boudih2015-02-081-1/+1
|\ \ | |/ |/| Missing `@` [ci skip]
| * Missing `@` [ci skip]Ryuta Kamizono2015-02-081-1/+1
|/
* rm `Type#number?`Sean Griffin2015-02-0717-29/+1
| | | | | This predicate is only used in `query_attribute`, and is relatively easy to remove without adding a bunch of is a checks.
* rm `Type#text?`Sean Griffin2015-02-076-14/+29
| | | | | | | | | | | | | | | | This predicate was only to figure out if it's safe to do case insensitive comparison, which is only a problem on PG. Turns out, PG can just tell us whether we are able to do it or not. If the query turns out to be a problem, let's just replace that method with checking the SQL type for `text` or `character`. I'd rather not burden the type objects with adapter specific knowledge. The *real* solution, is to deprecate this behavior entirely. The only reason we need it is because the `:case_sensitive` option for `validates_uniqueness_of` is documented as "this option is ignored for non-strings". It makes no sense for us to do that. If the type can't be compared in a case insensitive way, the user shouldn't tell us to do case insensitive comparison.
* Move non-type objects into the `Type::Helpers` namespaceSean Griffin2015-02-0719-104/+110
| | | | | | | The type code is actually quite accessible, and I'm planning to encourage people to look at the files in the `type` folder to learn more about how it works. This will help reduce the noise from code that is less about type casting, and more about random AR nonsense.
* rm `ActiveRecord::Type::Decorator`Sean Griffin2015-02-074-28/+0
| | | | | | | It only existed to make sure the subclasses of `Delegator` were YAML serializable. As of Ruby 2.2, these are YAML dumpable by default, as it includes https://github.com/tenderlove/psych/commit/2a4d9568f7d5d19c00231cf48eb855cc45ec3394
* Push multi-parameter assignement into the typesSean Griffin2015-02-0712-108/+77
| | | | | | | | | | | | This allows us to remove `Type::Value#klass`, as it was only used for multi-parameter assignment to reach into the types internals. The relevant type objects now accept a hash in addition to their previous accepted arguments to `type_cast_from_user`. This required minor modifications to the tests, since previously they were relying on the fact that mulit-parameter assignement was reaching into the internals of time zone aware attributes. In reaility, changing those properties at runtime wouldn't change the accessor methods for all other forms of assignment.
* Merge pull request #18842 from yuki24/simplify-NameError#missing_nameRafael Mendonça França2015-02-071-2/+1
|\ | | | | NameError#missing_name? can just use NameError#name if the arg is a Symbol
| * NameError#missing_name? can jsut use NameError#name if the arg is a SymbolYuki Nishijima2015-02-071-2/+1
| | | | | | | | | | | | NameError#name returns a missing name as a symbol, so if the given name is a symbol, it doesn't have to use #missing_name to get the last constant name in the error message.
* | Merge pull request #18574 from aditya-kapoor/silent-actionmailer-testsRafael Mendonça França2015-02-071-5/+16
|\ \ | | | | | | remove noise from AM tests
| * | remove noise from AM testsAditya Kapoor2015-02-071-5/+16
| |/
* | Merge pull request #18835 from jtmkrueger/masterXavier Noria2015-02-071-0/+0
|\ \ | |/ |/| Use the Rails favicon.ico instead of the ruby favicon.ico for rails guides [ci skip]
| * use rails favicon.ico instead or ruby favicon.ico for rails guidesJohn Krueger2015-02-061-0/+0
| |
* | Merge pull request #14252 from mcfiredrill/make-zones-map-privateArthur Neves2015-02-062-9/+9
|\ \ | | | | | | | | | make zones_map private
| * | make zones_map privateTony Miller2015-02-062-9/+9
|/ / | | | | | | | | Conflicts: activesupport/lib/active_support/values/time_zone.rb
* | Merge pull request #18837 from y-yagi/fix-deprecation-warning-in-render-testArthur Nogueira Neves2015-02-061-2/+2
|\ \ | |/ |/| use kwargs instead of xhr method. refs #18771.
| * use kwargs instead of xhr method. refs #18771.yuuji.yaginuma2015-02-071-2/+2
|/
* Add link to the show action in the getting startedRafael Mendonça França2015-02-061-0/+1
| | | | | | [ci skip] Closes #16538
* Merge pull request #18834 from mfazekas/fix-i18-for-openstructRafael Mendonça França2015-02-062-1/+13
|\ | | | | Fixed undefined method `i18n_key' for nil:NilClass for labels in non AR ...
| * Fixed undefined method `i18n_key' for nil:NilClass for labels in non AR form_forMiklos Fazekas2015-02-062-1/+13
|/ | | | | Refactoring at #18647 broke using non active record objects in form_for. This patch restores the original behaviour where we only compute i18 key when object.respond_to?(:to_model)
* Document the usage of the default option to attributeSean Griffin2015-02-061-0/+14
|
* A symbol can be passed to `attribute`, which should be documentedSean Griffin2015-02-061-3/+4
|
* Grammar and RDoc formattingSean Griffin2015-02-062-35/+37
|
* Remove reference to the now done documentation.rakeXavier Noria2015-02-061-1/+0
|
* README.rdoc -> README.md for newly generated applicationsXavier Noria2015-02-065-5/+9
| | | | | | README.rdoc was generated to support the doc:app task. Now that this task is gone we can switch to Markdown, which is nowadays a better default.
* Remove documentation tasksXavier Noria2015-02-069-121/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the tasks doc:app, doc:rails, and doc:guides. In our experience applications do not generate APIs using doc:app. Methods may be certainly documented for maintainers, annotated with YARD tags, etc. but that is intended to be read with the source code, not in a separate website. Then, teams also have typically selected topics written down in Markdown files, or in a GitHub wiki... that kind of thing. If a team absolutely needs to generate application documentation for internal purposes, they can still easily write their own task. Regarding doc:rails and doc:guides, we live in 2015. We are used to go to online docs all the time. If you really want access to the API offline RubyGems generates it for every Rails component unless you tell it not to, and you can checkout the Rails source code to read the guides as Markdown, or download them for a Kindle reader. All in all, maintaining this code does not seem to be worthwhile anymore. As a consequence of this, guides (+3 MB uncompressed) won't be distributed with the rails gem anymore. Of course, guides and API are going to be still part of releases, since documentation is maintained alongside code and tests. Also, time permitting, this will allow us to experiment with novel ways to generate documentation in the Rails docs server, since right now we were constrained by being able to generate them in the user's environment.
* Docs pass for the attributes APISean Griffin2015-02-062-39/+154
|
* Raise ArgumentError when passing nil to Relation#mergeRafael Mendonça França2015-02-063-1/+24
| | | | | | nil or false should not be valid argument to the merge method. Closes #12264
* Stoping using Relation#merge in default_scopedRafael Mendonça França2015-02-061-1/+7
| | | | | | | | Relation#merge checks if the argument is an array and the only possible returns of build_default_scope is nil or a Relation. Doing this we can raise an ArgumentError when Relation#merge receive a nil value.
* Merge pull request #18833 from perceptec/add_only_performed_optionRafael Mendonça França2015-02-064-18/+186
|\ | | | | Add an `:only` option to `perform_enqueued_jobs` to filter jobs based on type.
| * Add an `:only` option to `perform_enqueued_jobs` to filter jobs based onMichael Ryan2015-02-064-18/+186
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | type. This allows specific jobs to be tested, while preventing others from being performed unnecessarily. Example: def test_hello_job assert_performed_jobs 1, only: HelloJob do HelloJob.perform_later('jeremy') LoggingJob.perform_later end end An array may also be specified, to support testing multiple jobs. Example: def test_hello_and_logging_jobs assert_nothing_raised do assert_performed_jobs 2, only: [HelloJob, LoggingJob] do HelloJob.perform_later('jeremy') LoggingJob.perform_later('stewie') RescueJob.perform_later('david') end end end Fixes #18802. Trim space and document :only option.
* Significantly improve the performance of `_read_attribute` on JRubySean Griffin2015-02-062-4/+21
| | | | | | | | | | | | | The `&block` form is more than twice as fast as the manual form of delegation (and is the code I'd rather write anyway). Unfortunately, it's still twice as slow on MRI. However, this is enough of a hotspot to justify giving JRuby special treatment. I can't currently provide benchmarks in the context of Active Record, since the JDBC adapters still aren't updated for 4.2, but the actual work performed (assuming it's been read at least once already) will have nearly the same performance characteristics as https://gist.github.com/sgrif/b86832786551aaee74de.
* Use keyword argument in the find_in_batches APIRafael Mendonça França2015-02-061-11/+7
| | | | | We already validate the keys, so it is better to use the built-in feature to do this
* Allow a symbol to be passed to `attribute`, in place of a type objectSean Griffin2015-02-0616-22/+148
| | | | | | | | | | | | | | | | | | The same is not true of `define_attribute`, which is meant to be the low level no-magic API that sits underneath. The differences between the two APIs are: - `attribute` - Lazy (the attribute will be defined after the schema has loaded) - Allows either a type object or a symbol - `define_attribute` - Runs immediately (might get trampled by schema loading) - Requires a type object This was the last blocker in terms of public interface requirements originally discussed for this feature back in May. All the implementation blockers have been cleared, so this feature is probably ready for release (pending one more look-over by me).
* Merge branch 'rm-ntp'Rafael Mendonça França2015-02-064-27/+40
|\ | | | | | | Merge #12067 rebasing and improving the code.
| * Merge pull request #12067 from jackxxu/keep_precisionRafael Mendonça França2015-02-064-27/+40
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Enable number_to_percentage to keep the number's precision by allowing :precision option value to be nil Conflicts: activesupport/CHANGELOG.md activesupport/lib/active_support/number_helper.rb activesupport/test/number_helper_test.rb
| | * Enable number_to_percentage to keep the number's precision by allowing ↵Jack Xu2013-08-283-16/+31
| | | | | | | | | | | | | | | | | | :precision to be nil number_helper.number_to_percentage(1000, precision: nil) # => "1000%"
* | | Merge pull request #18831 from colinrymer/patch-1Rafael Mendonça França2015-02-061-2/+2
|\ \ \ | | | | | | | | Indicate link_to creates an anchor element
| * | | Indicate link_to creates an anchor elementColin Rymer2015-02-061-2/+2
| |/ / | | | | | | | | | | | | | | | The `link_to` helper generates an HTML anchor element (consisting of opening and closing anchor tags and an element body). The docs currently state the a link tag is generated (which would indicate a tag like `<link>`, which is another valid HTML tag), so this change clarifies that an anchor element is actually generated. [ci skip]
* / / Revert "Improve the performance of HWIDA `select` and `reject`"Sean Griffin2015-02-061-4/+4
|/ / | | | | | | This reverts commit 9c47b874d112414df7f80f9ed852adb48ba6d268.
* | Improve the performance of HWIDA `select` and `reject`Sean Griffin2015-02-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are (potentially, depending on input) called in several places in both the router, and Active Record. The code also becomes much cleaner. This results in ~33% performance gain in both methods. Calculating ------------------------------------- before 15.696k i/100ms after 19.865k i/100ms ------------------------------------------------- before 303.064k (± 2.6%) i/s - 1.523M after 446.734k (± 2.4%) i/s - 2.245M On Ruby 2.2, a warning will be emitted about states not being copied, because we're calling `super` from a subclass. We can safely ignore it, however, since we're converting the result back into a HWIDA
* | Merge pull request #14028 from uberllama/json_escape_commentsRafael Mendonça França2015-02-061-0/+5
|\ \ | | | | | | Amended json_escape comments