aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Clarifies db can be set up from structure.sql alsoAnnaErshova2015-10-151-1/+1
| | | | | | | | I added that *structure.sql* file can be used when *db:reset* is run. *db:reset* tasks states *db:reset* loads database from *db/schema.rb* or *db/structure.sql* depending on the configuration (although *db/schema.rb* is the default), hence the change.
* freeze the column name to drop string allocations in dirty checksAaron Patterson2015-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dirty checking keeps a hash where the keys are the column name and the value is a dup of the value from the database[1]. This hash is kept for every AR object, which means that we dup every column name for every AR object that does dirty checking. Freezing the column name prevents the column name from being duped and reduced overall string allocations. Here is a benchmark to demonstrate: ```ruby require 'active_record' class Topic < ActiveRecord::Base end 20.times do |i| Process.waitpid fork { ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: ':memory:' ActiveRecord::Base.connection.instance_eval do create_table(:topics) do |t| t.string :title, limit: 250 t.string :author_name t.string :author_email_address t.string :parent_title t.string :type t.string :group i.times do |j| t.string :"aaa#{j}" end t.timestamps null: true end end ObjectSpace::AllocationTracer.setup(%i{type}) Topic.create title: "aaron" # heat cache result = ObjectSpace::AllocationTracer.trace do 10.times do |i| Topic.create title: "aaron #{i}" end end puts "#{Topic.columns.length},#{(result.find { |k,v| k.first == :T_STRING }.last.first / 10)}" } end ``` 1. https://github.com/rails/rails/blob/3ad381c3f8598d9920998c8949a96b5f62b280dd/activerecord/lib/active_record/attribute_set/builder.rb#L102
* Merge pull request #21961 from Gaurav2728/migration_class_methods_nodocArthur Nogueira Neves2015-10-141-5/+5
|\ | | | | migrations Class methods have nodoc, fix it for API [ci skip]
| * migrations Class methods have nodoc, fix it for API [ci skip]Gaurav Sharma2015-10-141-5/+5
| |
* | applies new doc guidelines to Active Record.Yves Senn2015-10-1453-458/+514
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The focus of this change is to make the API more accessible. References to method and classes should be linked to make it easy to navigate around. This patch makes exzessiv use of `rdoc-ref:` to provide more readable docs. This makes it possible to document `ActiveRecord::Base#save` even though the method is within a separate module `ActiveRecord::Persistence`. The goal here is to bring the API closer to the actual code that you would write. This commit only deals with Active Record. The other gems will be updated accordingly but in different commits. The pass through Active Record is not completely finished yet. A follow up commit will change the spots I haven't yet had the time to update. /cc @fxn
* | fix RDoc markup in `ConnectionPool`. [ci skip]Yves Senn2015-10-141-13/+13
| |
* | add missing `:nodoc:` to `AR::Callbacks::ClassMethods`. [ci skip]Yves Senn2015-10-141-1/+1
| |
* | add missing `:nodoc:` for `AutosaveAssociation::ClassMethods` [ci skip]Yves Senn2015-10-141-1/+1
| |
* | fix broken RDoc markup. Use `<tt>` instead of `+`. [ci skip]Yves Senn2015-10-142-7/+7
| |
* | fix RDoc list markup in `DatabaseTasks`. [ci skip]Yves Senn2015-10-141-7/+7
| |
* | add missing :nodoc: to `ActiveRecord::Scoping`. [ci skip]Yves Senn2015-10-141-2/+2
| |
* | Merge pull request #21635 from sideshowcoder/ar_type_docs_fixArthur Nogueira Neves2015-10-131-1/+1
|\ \ | | | | | | Documentation ActiveRecord Attributes API code fix
| * | ActiveRecord Attributes API code fixPhilipp Fehre2015-09-151-1/+1
| | | | | | | | | | | | | | | | | | | | | I came across this while trying it out, with the provided code the `MoneyType` does not save as it complains that `Fixnum` does not define `include?`. I think the sensible thing is to check if it already is a `Numeric`.
* | | Merge pull request #20908 from y-yagi/generate_application_job_inside_engineArthur Nogueira Neves2015-10-132-0/+9
|\ \ \ | | | | | | | | add application_job.rb to template of mountable engine
| * | | add application_job.rb to template of mountable engineyuuji.yaginuma2015-07-172-0/+9
| | | | | | | | | | | | | | | | | | | | since cb012467214f6e4bb1ac3987554bb75020b4796b, generated job inherents from ApplicationJob, ApplicationJob is required in the mountable engine.
* | | | Merge pull request #21954 from xtian/patch-1Matthew Draper2015-10-141-4/+6
|\ \ \ \ | | | | | | | | | | Fix formatting of ActiveRecord PostgreSQL guide.
| * | | | Fix formatting of ActiveRecord PostgreSQL guide.Christian Wesselhoeft2015-10-131-4/+6
|/ / / /
* | | | Merge pull request #19135 from yuki24/access-control-supportJeremy Daer2015-10-138-22/+106
|\ \ \ \ | | | | | | | | | | | | | | | Add basic support for access control headers to ActionDispatch::Static
| * | | | Add the ability of returning arbitrary headers to ActionDispatch::StaticYuki Nishijima2015-06-138-22/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now ActionDispatch::Static can accept HTTP headers so that developers will have control of returning arbitrary headers like 'Access-Control-Allow-Origin' when a response is delivered. They can be configured through `#config.public_file_server.headers`: config.public_file_server.headers = { "Cache-Control" => "public, max-age=60", "Access-Control-Allow-Origin" => "http://rubyonrails.org" } Also deprecate `config.static_cache_control` in favor of `config.public_file_server.headers`.
* | | | | Merge pull request #21952 from headius/only_one_module_for_deprecationMatthew Draper2015-10-141-4/+4
|\ \ \ \ \ | | | | | | | | | | | | Only prepend a single module when defining deprecation wrappers.
| * | | | | Only prepend a single module when defining deprecation wrappers.Charles Oliver Nutter2015-10-131-4/+4
|/ / / / / | | | | | | | | | | | | | | | | | | | | I could not find any reason why each method got its own prepended module here, and all tests appear to pass with my change.
* | | | | `private def` breaks RDoc. Move meathod to preserve the docs.Yves Senn2015-10-131-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rdoc parser seems to trip on the `private def` construct. Public methods following a method defined with `private def` are not visible inside the module docs but are appended to the top-most module. For example the method `ActiveRecord::QueryMethods#distinct` was listed under `ActiveRecord#distinct`. /cc @sgrif
* | | | | docs, :nodoc: `FromClause`, `QueryAttribute` and `WhereClauseFactory`.Yves Senn2015-10-133-3/+3
| | | | | | | | | | | | | | | | | | | | [ci skip]
* | | | | docs, add missing `:nodoc: for `Associations::Builder`. [ci skip]Yves Senn2015-10-137-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This class is only used internally. We should keep it out of public documentation. This patch adds nodoc for `ActiveRecord::Associations::Builder` and everything nested within.
* | | | | nodoc `ActiveRecord::ForeignAssociation`. [ci skip]Yves Senn2015-10-131-1/+1
| | | | |
* | | | | document `EagerLoadPolymorphicError`. [ci skip]Yves Senn2015-10-131-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This error is raised in certain situations when eager loading polymorphic associations. We even mention it in our docs. It should be included in our API. Conflicts: activerecord/lib/active_record/associations.rb
* | | | | nodoc `ActiveRecord::Attribute::UserProvidedDefault`. [ci skip]Yves Senn2015-10-131-1/+1
| | | | |
* | | | | docs, recognize code examples as Ruby in `Relation::QueryMethods` [ci skip]Yves Senn2015-10-131-33/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also unify the format of code example output. Only use `# =>` if the actual return value is described. Otherwise simply use `#`. Conflicts: activerecord/lib/active_record/relation/query_methods.rb
* | | | | docs, nodoc internal Active Record `DelegateCache`. [ci skip]Yves Senn2015-10-131-3/+3
| | | | |
* | | | | docs, fix highlighting for code examples in calculations.rb [ci skip]Yves Senn2015-10-131-20/+20
| | | | |
* | | | | `:to_table` when adding a fk through `add_reference`.Yves Senn2015-10-134-3/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #21563. The `name` argument of `add_references` was both used to generate the column name `<name>_id` and as the target table for the foreign key `name.pluralize`. It's primary purpose is to define the column name. In cases where the `to_table` of the foreign key is different than the column name we should be able to specify it individually.
* | | | | Merge pull request #21938 from ↵Yves Senn2015-10-135-92/+107
|\ \ \ \ \ | |_|_|_|/ |/| | | | | | | | | | | | | | kamipo/move_schema_dumping_methods_into_appropriate_files Move the methods for schema dumping into `{mysql,postgresql}/schema_dumper.rb`
| * | | | Move the methods for schema dumping into `{mysql,postgresql}/schema_dumper.rb`Ryuta Kamizono2015-10-135-92/+107
| | | | | | | | | | | | | | | | | | | | | | | | | Current master branch includes many schema dumping improvements. It extract these features to the appropriate files.
* | | | | Merge pull request #21288 from yahonda/mysql_requires_passwordArthur Nogueira Neves2015-10-122-5/+5
|\ \ \ \ \ | | | | | | | | | | | | Allow mysql and mysql2 tests run by database user with password
| * | | | | Allow mysql and mysql2 tests run by database user with passwordYasuo Honda2015-08-182-5/+5
| | | | | |
* | | | | | Merge pull request #17388 from akampjes/masterArthur Nogueira Neves2015-10-124-0/+23
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | ActionMailer https on URL with force_ssl = true
| * | | | | ActionMailer https on URL with force_ssl = trueAndrew Kampjes2015-08-144-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `config.force_ssl = true` will set config.action_mailer.default_url_options = { protocol: 'https' } If you have turned on force_ssl, and then gone to the effort of setting config.action_mailer.default_url_options = {host: 'example.com'} then you are probably pointing people back to your current app and want https on that too.
* | | | | | Merge pull request #21931 from paul/bugfix/remove-deprecated-pg_dump-flagYves Senn2015-10-123-5/+9
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | Remove deprecated pg_dump -i flag
| * | | | | | Remove deprecated pg_dump -i flagPaul Sadauskas2015-10-101-1/+1
| | | | | | |
* | | | | | | Merge pull request #21933 from ↵Yves Senn2015-10-123-115/+129
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kamipo/move_schema_definiton_classes_into_appropriate_file Move schema definiton classes into the appropriate files
| * | | | | | | Move schema creation class into `mysql/schema_creation.rb`Ryuta Kamizono2015-10-112-53/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current master branch includes many schema creation improvements in MySQL. It extract these features to the appropriate file.
| * | | | | | | Move schema definition classes into `mysql/schema_definitions.rb`Ryuta Kamizono2015-10-112-62/+70
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current master branch includes many schema definition improvements in MySQL. It extract these features to the appropriate file.
* | | | | | | Merge pull request #21849 from yui-knk/refactor_regexp_to_stringAndrew White2015-10-124-7/+14
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Change `Journey::Route#verb` to return string instead of regexp.
| * | | | | | | Change `Journey::Route#verb` to return string instead of regexp.yui-knk2015-10-034-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By [this commit](https://github.com/rails/rails/commit/0b476de445faf330c58255e2ec3eea0f3a7c1bfc) `Journey::Route#verb` need not to return verb as regexp. The returned value is used by inspector, so change it to be a string. Add inspect_with_multiple_verbs test case to keep the behavior of inspector correctly.
* | | | | | | | edit pass over the project Gemfile [ci skip]Xavier Noria2015-10-121-18/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Revises the name of Rails components (they have a space). * Uniform word wrap at column 80.. * Uniform punctuation, according to our guidelines. * Minor edits of details seen in passing.
* | | | | | | | Merge pull request #21936 from y-yagi/do_not_generate_manifest_in_pluginsJeremy Daer2015-10-112-1/+2
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | do not generate manifest.js in plugins
| * | | | | | | | do not generate manifest.js in pluginsyuuji.yaginuma2015-10-122-1/+2
| | |/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | Since the plugin generator do not generate assets, I think manifest.js also that it unnecessary.
* | | | | | | | Merge pull request #21934 from etdev/docs/deep-dup-typoClaudio B.2015-10-111-1/+1
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | [ci skip] Fix typo in deep_dup docs
| * | | | | | | [ci skip] Fix typo in deep_dup docsEric Turner2015-10-121-1/+1
|/ / / / / / /
* | | | | | | Merge pull request #11410 from bogdan/increment-concurencyJeremy Daer2015-10-105-40/+42
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Make AR#increment! and #decrement! concurrency-safe