aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix typo in inet and cidr savingMiguel Herranz2012-10-142-1/+14
|
* #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
| | | |
* | | | 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.
* | | | When executing permit with just a key that points to a hash, DO NOT allow ↵Santiago Pastorino2012-10-122-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | all the hash params.require(:person).permit(:projects_attributes) was returning => {"projects_attributes"=>{"0"=>{"name"=>"Project 1"}}} When should return => {} You should be doing ... params.require(:person).permit(projects_attributes: :name) to get just the projects attributes you want to allow
* | | | adding a test for b21f24d9807bd161af947cf0f0cc440c9adffb73Aaron Patterson2012-10-111-0/+14
| | | |
* | | | Merge pull request #7912 from mrship/masterRafael Mendonça França2012-10-114-1/+8
|\ \ \ \ | |/ / / |/| | | CacheDigests: Support templates in directories several levels deep
| * | | Allow for deep directory path for view templates.Andy Shipman2012-10-114-1/+8
|/ / /
* | | Merge pull request #7886 from ↵Rafael Mendonça França2012-10-115-13/+50
|\ \ \ | | | | | | | | | | | | | | | | senny/3675_assert_template_twice_against_same_partial assert_template works when the same partial was rendered multiple times
| * | | refactor `ActionView::TestCase` internals to track rendered localsYves Senn2012-10-112-20/+33
| | | | | | | | | | | | | | | | | | | | this refactoring extracts the semi complex data structure of rendered locals per view into into a separate class
| * | | recognizes when a partial was rendered twice. Closes #3675Yves Senn2012-10-115-9/+33
| | | |
* | | | Merge pull request #7908 from arunagw/build_fix_railtiesRafael Mendonça França2012-10-111-5/+0
|\ \ \ \ | |/ / / |/| | | No need to test for rack-cache present in gem file
| * | | No need to test for rack-cache present in GemfileArun Agrawal2012-10-111-5/+0
|/ / / | | | | | | | | | | | | | | | as it's removed here 1fc795468525d8622cdca474a54c8310a514aa46
* | | Merge pull request #7050 from kytrinyx/documentation-reset-column-infoVijay Dev2012-10-101-0/+21
|\ \ \ | | | | | | | | Expand the caveat about models in migrations in the rails guide.
| * | | Expand caveat about models in migrations (rails guide)Katrina Owen2012-10-101-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an attempt to address issue #6939, where an earlier migration added a column to the database, and a later migration uses a model and references that column. When both migrations were run together with `rake db:migrate` the column information in memory still referenced the old table structure. Running the migrations separately fixed this, as a new connection was then established before referencing the model. Explicitly calling `reset_column_information` is a more reliable workaround.