aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | Merge pull request #7937 from ↵Rafael Mendonça França2012-10-136-15/+61
|\| | | | | | | | | | | | | | | | | | | arturopie/7914-defaults-on-domains-and-multiple-schemas Fixes #7914 - PostgreSQL adapter doesn't fetch column defaults when using multiple schemas and domains
| * | | #7914 Remove code for unsupported postgreSQL version.Arturo Pie2012-10-132-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove parsing of character type default values for 8.1 formatting since Rails doesn't support postgreSQL 8.1 anymore. Remove misleading comment unrelated to code.
| * | | #7914 Using a better way to get the defaults from db.Arturo Pie2012-10-132-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to postgreSQL documentation: (http://www.postgresql.org/docs/8.2/static/catalog-pg-attrdef.html) we should not be using 'adsrc' field because this field is unaware of outside changes that could affect the way that default values are represented. Thus, I changed the queries to use "pg_get_expr(adbin, adrelid)" instead of the historical "adsrc" field.
| * | | #7914 Add change of previous commit to CHANGELOG.mdArturo Pie2012-10-131-0/+4
| | | |
| * | | #7914 get default value when type uses schema nameArturo Pie2012-10-134-3/+50
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PostgreSQL adapter properly parses default values when using multiple schemas and domains. When using domains across schemas, PostgresSQL prefixes the type of the default value with the name of the schema where that type (or domain) is. For example, this query: ``` SELECT a.attname, d.adsrc FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = "defaults"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum; ``` could return something like "'<default_value>'::pg_catalog.text" or "(''<default_value>'::pg_catalog.text)::text" for the text columns with defaults. I modified the regexp used to parse this value so that it ignores anything between ':: and \b(?:character varying|bpchar|text), and it allows to have optional parens like in the above second example.
* | | Merge pull request #7935 from leereilly/minor-gemfile-twerkRafael Mendonça França2012-10-131-1/+1
|\ \ \ | | | | | | | | Clean up Gemfile entry (replace double quotes with single quotes) [ci skip]
| * | | Replace double quotes with single quotesLee Reilly2012-10-131-1/+1
|/ / /
* | | Test that a Rails.queue consumer is automatically started in productionJeremy Kemper2012-10-133-3/+14
| | |
* | | Backpedal from class-oriented config.queue. Set an actual queue instance.Jeremy Kemper2012-10-1210-26/+14
| | |
* | | Tighten up asset precompile testsJeremy Kemper2012-10-122-4/+3
| | |
* | | Remove the queue container. Premature consolidation. Set up and maintain ↵Jeremy Kemper2012-10-125-68/+9
| | | | | | | | | | | | queues in the classes that use them instead.
* | | Merge pull request #7891 from schneems/schneems/rake_command_warningJosé Valim2012-10-121-23/+32
|\ \ \ | | | | | | | | Prompt to run rake when accidentally typed rails
| * | | Prompt to run rake when accidentally typed railsschneems2012-10-121-23/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Developers from all levels will accidentally run rake tasks using the `rails` keyword when they meant to use `rake`. Often times beginners struggle with the difference between the tools. The most common example would be `$ rails db:migrate` Rather than telling the developer simply that they did not use a valid rails command, we can see if it was a valid rake command first. If it is a valid rake command we can auto execute it giving the user a period of time to cancel if that isn't what they intended. Here is what `rake db:migrate` would look like if you cancel the command: ```sh $ rails db:migrate Assuming you meant: $ rake db:migrate press any key to cancel in 3 seconds > command terminated ... ``` Here is what it looks like if you don't cancel the command: ```sh $ rails db:migrate Assuming you meant: $ rake db:migrate press any key to cancel in 3 seconds > Running: $ rake db:migrate == Foo: migrating ============================================================ == Foo: migrated (0.0000s) =================================================== ```
* | | | performance improvements to joins!Aaron Patterson2012-10-122-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: Calculating ------------------------------------- ar 87 i/100ms ------------------------------------------------- ar 823.4 (±11.8%) i/s - 4089 in 5.070234s After: Calculating ------------------------------------- ar 88 i/100ms ------------------------------------------------- ar 894.1 (±3.9%) i/s - 4488 in 5.028161s Same test as 3a6dfca7f5f5bd45cea2f6ac348178e72423e1d5
* | | | Speed up relation merging by reducing calls to Array#-Aaron Patterson2012-10-121-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | before: Calculating ------------------------------------- ar 83 i/100ms ------------------------------------------------- ar 832.1 (±4.0%) i/s - 4233 in 5.096611s after: Calculating ------------------------------------- ar 87 i/100ms ------------------------------------------------- ar 839.0 (±9.3%) i/s - 4176 in 5.032782s Benchmark: require 'config/environment' require 'benchmark/ips' GC.disable unless User.find_by_login('tater') u = User.new u.login = 'tater' u.save! end def active_record user = User.find_by_login('tater') starred = user.starred_items.count end active_record Benchmark.ips do |x| x.report("ar") { active_record } end
* | | | Merge pull request #7007 from Mik-die/hash_extractRafael Mendonça França2012-10-124-6/+49
|\ \ \ \ | | | | | | | | | | make Hash#extract! more symmetric with Hash#slice
| * | | | add more testcases and doc about Hash#extract!Mikhail Dieterle2012-10-083-6/+21
| | | | |
| * | | | make Hash#extract! more symmetric with Hash#sliceMikhail Dieterle2012-10-083-3/+31
| | | | |
* | | | | Merge pull request #7926 from senny/whitespace_cleanupRafael Mendonça França2012-10-121-12/+12
|\ \ \ \ \ | | | | | | | | | | | | trailling whitespace cleanup in query_methods.rb [ci skip]
| * | | | | trailling whitespace cleanup in query_methods.rbYves Senn2012-10-121-12/+12
| | | | | |
| | | | * | Remove old asset_path from rails configJoshua Peek2012-10-153-26/+1
| | | | | |
| | | | * | :fire: Rails asset id supportJoshua Peek2012-10-157-246/+2
| | | | | |
| | | | * | merge! default asset tag optionsJoshua Peek2012-10-151-12/+12
| | | | | |
| | | | * | Just check request instead of controller.requestJoshua Peek2012-10-151-13/+2
| | | | | |
| | | | * | Allow asset url config to be undefinedJoshua Peek2012-10-132-2/+45
| | | | | |
| | | | * | Add a few more compute_asset_path testsJoshua Peek2012-10-131-0/+8
| | | | | |
| | | | * | All asset url helpers should pass optionsJoshua Peek2012-10-121-24/+24
| | | | | |
| | | | * | JAVASCRIPTS_DIR, STYLESHEETS_DIR, ASSETS_DIR don't even exist anymoreJoshua Peek2012-10-121-28/+0
| | | | | |
| | | | * | Ensure AssetUrlHelper can be mixed into AC::BaseJoshua Peek2012-10-122-6/+46
| | | | | |
| | | | * | Refactor AssetUrlHelper to make it friendly for plugins and extensionsJoshua Peek2012-10-129-346/+275
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add asset_path/url helper for a consolidated entry point Expose compute_asset_path as a public API Expose compute_asset_host as a public API Move RAILS_ASSET_ID to its own module, AssetIdHelper Removed AV::AssetPaths
| | | | * | Add asset_path and asset_url helpersJoshua Peek2012-10-123-17/+72
| |_|_|/ / |/| | | |
* | | | | Merge pull request #7923 from josh/seperate-asset-tag-and-url-concernsRafael Mendonça França2012-10-125-419/+416
|\ \ \ \ \ | |/ / / / |/| | | | Split asset url helpers into seperate AssetUrlHelper
| * | | | Split asset url helpers into seperate AssetUrlHelperJoshua Peek2012-10-125-419/+416
|/ / / /
* | | | ActiveSupport::SynchronousQueue doesn't have the drain method.Rafael Mendonça França2012-10-121-4/+4
| | | | | | | | | | | | | | | | | | | | Now we are using teh SynchronousQueue in the test environment instead of the TestQueue
* | | | Move the TestQueue tests to the proper fileRafael Mendonça França2012-10-122-47/+44
| | | |
* | | | Merge pull request #7871 from bjnord/masterRafael Mendonça França2012-10-123-8/+12
|\ \ \ \ | | | | | | | | | | Support another file type .rake in `rake notes`
| * | | | Add .rake to `rake notes` and `rake notes:custom`Brent J. Nordquist2012-10-123-8/+12
| | | | |
* | | | | Merge pull request #7913 from mje113/masterXavier Noria2012-10-121-0/+4
|\ \ \ \ \ | | | | | | | | | | | | MemCacheStore's move to dalli as a backend broke :race_condition_ttl support
| * | | | | Padding expires_in by 5 minutes on dalli key write to facilitate ↵Mike Evans2012-10-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | :race_condition_ttl working correctly.
* | | | | | Merge pull request #7919 from arunagw/warning_removed_shadowingRafael Mendonça França2012-10-121-2/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | warning removed: shadowing outer local variable - value
| * | | | | | warning removed: shadowing outer local variable - valueArun Agrawal2012-10-121-2/+2
| | | | | | |
* | | | | | | Merge pull request #7765 from insside/clever-orderJon Leighton2012-10-123-4/+73
|\ \ \ \ \ \ \ | |_|_|/ / / / |/| | | | | | learn ActiveReccord::Querying#order work with hash arguments
| * | | | | | learn ActiveRecord::QueryMethods#order work with hash argumentsTima Maslyuchenko2012-10-123-4/+73
|/ / / / / /
* / / / / / Immediately run queued jobs in tests. Otherwise you have to explicitly drain ↵Jeremy Kemper2012-10-122-5/+5
|/ / / / / | | | | | | | | | | | | | | | the queue to actually deliver your emails.
* | | | | Don't allocate new strings in compiled attribute methodsJon Leighton2012-10-122-20/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This improves memory and performance without having to use symbols which present DoS problems. Thanks @headius and @tenderlove for the suggestion. Benchmark --------- require 'active_record' require 'benchmark/ips' ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') class Post < ActiveRecord::Base connection.create_table :posts, force: true do |t| t.string :name end end post = Post.create name: 'omg' Benchmark.ips do |r| r.report('Post.new') { Post.new name: 'omg' } r.report('post.name') { post.name } r.report('post.name=') { post.name = 'omg' } r.report('Post.find(1).name') { Post.find(1).name } end Before ------ Calculating ------------------------------------- Post.new 1419 i/100ms post.name 7538 i/100ms post.name= 3024 i/100ms Post.find(1).name 243 i/100ms ------------------------------------------------- Post.new 20637.6 (±12.7%) i/s - 102168 in 5.039578s post.name 1167897.7 (±18.2%) i/s - 5186144 in 4.983077s post.name= 64305.6 (±9.6%) i/s - 317520 in 4.998720s Post.find(1).name 2678.8 (±10.8%) i/s - 13365 in 5.051265s After ----- Calculating ------------------------------------- Post.new 1431 i/100ms post.name 7790 i/100ms post.name= 3181 i/100ms Post.find(1).name 245 i/100ms ------------------------------------------------- Post.new 21308.8 (±12.2%) i/s - 105894 in 5.053879s post.name 1534103.8 (±2.1%) i/s - 7634200 in 4.979405s post.name= 67441.0 (±7.5%) i/s - 337186 in 5.037871s Post.find(1).name 2681.9 (±10.6%) i/s - 13475 in 5.084511s
* | | | | Revert "Key the attributes hash with symbols"Jon Leighton2012-10-124-14/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 86c3dfbd47cb96af02daaa655963292b1a1b110e. Conflicts: activerecord/lib/active_record/attribute_methods/read.rb Reason: whilst this increased performance, it also presents a DoS risk via memory exhaustion if users were allowing user input to dictate the arguments of read/write_attribute. I will investigate alternative ways to cut down on string allocations here.
* | | | | Merge pull request #7917 from dfens/masterJosé Valim2012-10-128-8/+8
|\ \ \ \ \ | | | | | | | | | | | | Cosmetic changes: remove trailing whitespaces from tests
| * | | | | Cleanup trailing whitespacesdfens2012-10-128-8/+8
|/ / / / /
* | | | | Merge pull request #7915 from frodsan/docs_permitRafael Mendonça França2012-10-111-0/+22
|\ \ \ \ \ | | | | | | | | | | | | update AC::Parameters#permit documentation [ci skip]
| * | | | | update AC::Parameters#permit documentation [ci skip]Francesco Rodriguez2012-10-111-0/+22
|/ / / / / | | | | | | | | | | | | | | | bdd105d changes the behaviour of AC::Parameters#permit.