- 09 9月, 2015 10 次提交
-
-
由 Kasper Timm Hansen 提交于
Cuts down on the duplicated reading parts.
-
由 Kasper Timm Hansen 提交于
Gets rid of the option parsing and makes what the encryptor does stand out.
-
由 Kasper Timm Hansen 提交于
Lets us avoid worrying about parsing the options and doing just what we need.
-
由 Kasper Timm Hansen 提交于
Remove the clutter to make PermanentCookieJar's one change stand out.
-
由 Kasper Timm Hansen 提交于
Eventually this will be the superclass of all the chained jars.
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
`url_for` does not modify polymorphic options
-
由 Richard Schneeman 提交于
Fixed Time conversion example for UTC time zone [ci skip]
-
由 Ronak Jangir 提交于
-
由 Rafael Mendonça França 提交于
Validate multiple contexts on `valid?` and `invalid?` at once
-
- 08 9月, 2015 28 次提交
-
-
由 Yves Senn 提交于
[Rails Guides] clarify `ActiveRecord::ConnectionTimeoutError`
-
由 Eileen M. Uchitelle 提交于
Removes mandatory arguments from AR exceptions
-
由 Yves Senn 提交于
Define `SchemaStatements#tables` as interface
-
由 yui-knk 提交于
These 3 methods expect `ConnectionAdapters` to have `tables` method, so make it clear that `tables` method is interface. * `ConnectionAdapters::SchemaCache#prepare_tables` * `db:schema:cache:dump` task * `SchemaDumper#tables`
-
由 Yves Senn 提交于
Replace AR with ActiveRecord to make it more readable [ci skip]
-
由 Yves Senn 提交于
Add tests for test/cases/adapters/mysql2/view_test.rb
-
由 yui-knk 提交于
Basically view tests for MySQL are same with `test/cases/adapters/postgresql/view_test.rb`. So move `test/cases/adapters/postgresql/view_test.rb` to `test/cases/view_test.rb` and make them only run if `current_adapter` supports writable view.
-
由 arvind 提交于
-
由 Kasper Timm Hansen 提交于
raise LoadError when a non-existent file or directory is specified to the test runner
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
Its value never change since associations are defined at class load time so there is no need to build the hash everytime the method is called. Before this change: Calculating ------------------------------------- reflections 804.000 i/100ms ------------------------------------------------- reflections 8.213k (±26.2%) i/s - 36.180k After this change: Calculating ------------------------------------- reflections 24.548k i/100ms ------------------------------------------------- reflections 1.591M (±25.7%) i/s - 7.364M Benchmark script: require 'bundler/setup' require 'active_record' require 'benchmark/ips' ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') ActiveRecord::Migration.verbose = false ActiveRecord::Schema.define do 100.times do |i| create_table "users#{i}", force: true end create_table :cars, force: true do |t| 100.times do |i| t.references "users#{i}" end end end class Car < ActiveRecord::Base 100.times do |i| belongs_to "users#{i}".to_sym end end Benchmark.ips do |x| x.report('reflections') { Car.reflections } end
-
由 Rafael Mendonça França 提交于
PERF: Reduce allocation in `resolve_column_aliases`.
-
由 Guo Xiang Tan 提交于
Benchmark Script Used: ``` begin require 'bundler/inline' rescue LoadError => e $stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' raise e end gemfile(true) do source 'https://rubygems.org' gem 'rails', path: '~/rails' # master against ref "f1f0a3f8" gem 'arel', github: 'rails/arel', branch: 'master' gem 'rack', github: 'rack/rack', branch: 'master' gem 'sass' gem 'sprockets-rails', github: 'rails/sprockets-rails', branch: 'master' gem 'sprockets', github: 'rails/sprockets', branch: 'master' gem 'pg' gem 'benchmark-ips' end require 'active_record' require 'benchmark/ips' ActiveRecord::Base.establish_connection('postgres://postgres@localhost:5432/rubybench') ActiveRecord::Migration.verbose = false ActiveRecord::Schema.define do create_table :users, force: true do |t| t.string :name, :email t.timestamps null: false end end class User < ActiveRecord::Base; end attributes = { name: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", email: "foobar@email.com", } 1000.times { User.create!(attributes) } Benchmark.ips(5, 3) do |x| x.report('where with hash single') { User.where(name: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.") } x.report('where with string single') { User.where("users.name = ?", "Lorem ipsum dolor sit amet, consectetur adipiscing elit.") } x.report('where with hash double') { User.where(name: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", email: "foobar@email.com") } x.report('where with string double') { User.where("users.name = ? AND users.email = ?", "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "foobar@email.com") } x.compare! end ``` Before: ``` Calculating ------------------------------------- where with hash single 3.300k i/100ms where with string single 4.965k i/100ms where with hash double 2.594k i/100ms where with string double 4.400k i/100ms ------------------------------------------------- where with hash single 35.161k (± 1.2%) i/s - 178.200k where with string single 53.368k (± 2.9%) i/s - 268.110k where with hash double 27.364k (± 1.1%) i/s - 137.482k where with string double 46.876k (± 2.1%) i/s - 237.600k Comparison: where with string single: 53368.1 i/s where with string double: 46875.5 i/s - 1.14x slower where with hash single: 35160.8 i/s - 1.52x slower where with hash double: 27364.0 i/s - 1.95x slower ``` After: ``` Calculating ------------------------------------- where with hash single 3.403k i/100ms where with string single 5.167k i/100ms where with hash double 2.659k i/100ms where with string double 4.597k i/100ms ------------------------------------------------- where with hash single 36.410k (± 1.3%) i/s - 183.762k where with string single 55.009k (± 2.6%) i/s - 279.018k where with hash double 27.951k (± 1.4%) i/s - 140.927k where with string double 48.362k (± 2.6%) i/s - 243.641k Comparison: where with string single: 55008.6 i/s where with string double: 48361.5 i/s - 1.14x slower where with hash single: 36410.1 i/s - 1.51x slower where with hash double: 27950.9 i/s - 1.97x slower ```
-
由 Jeremy Daer (Kemper) 提交于
Make `config.force_ssl` less dangerous to try and easier to disable
-
由 Jeremy Daer 提交于
SSL redirect: * Move `:host` and `:port` options within `redirect: { … }`. Deprecate. * Introduce `:status` and `:body` to customize the redirect response. The 301 permanent default makes it difficult to test the redirect and back out of it since browsers remember the 301. Test with a 302 or 307 instead, then switch to 301 once you're confident that all is well. HTTP Strict Transport Security (HSTS): * Shorter max-age. Shorten the default max-age from 1 year to 180 days, the low end for https://www.ssllabs.com/ssltest/ grading and greater than the 18-week minimum to qualify for browser preload lists. * Disabling HSTS. Setting `hsts: false` now sets `hsts: { expires: 0 }` instead of omitting the header. Omitting does nothing to disable HSTS since browsers hang on to your previous settings until they expire. Sending `{ hsts: { expires: 0 }}` flushes out old browser settings and actually disables HSTS: http://tools.ietf.org/html/rfc6797#section-6.1.1 * HSTS Preload. Introduce `preload: true` to set the `preload` flag, indicating that your site may be included in browser preload lists, including Chrome, Firefox, Safari, IE11, and Edge. Submit your site: https://hstspreload.appspot.com
-
由 Jeremy Daer (Kemper) 提交于
Support mysql2 0.4.0, first release with prepared statements support
-
由 Jeremy Daer 提交于
Known failure on Ruby 2.3/trunk: brianmario/mysql2#671
-
由 Jeremy Daer 提交于
-
由 yuuji.yaginuma 提交于
test runner sets file to be tested in plugin_rails_options, but in plugin_rails_options, processing has been made to the argument of the actual command rather than the argument of Minitest.run. For example, if you run `./bin rake db:migrate test`, the options[:patterns], `db:migrate test` was incorrectly set.
-
由 Dmitry Polushkin 提交于
Example: ```ruby class Person include ActiveModel::Validations attr_reader :name, :title validates_presence_of :name, on: :create validates_presence_of :title, on: :update end person = Person.new person.valid?([:create, :update]) # => true person.errors.messages # => {:name=>["can't be blank"], :title=>["can't be blank"]} ```
-
由 Rafael Mendonça França 提交于
Related with #20418
-
由 Rafael Mendonça França 提交于
[Rails Guides] Clarify custom code configuration [ci skip]
-
由 Rafael Mendonça França 提交于
This reverts commit 51dd2588, reversing changes made to ecb4e4b2. This broke Active Record tests
-
由 Rafael Mendonça França 提交于
Validate multiple contexts on `valid?` and `invalid?` at once
-
由 Rafael Mendonça França 提交于
PERF: Scope performance.
-
由 Matthew Draper 提交于
Generic cast-to-text was only added in 8.3.
-
由 Rafael Mendonça França 提交于
PERF: Don't create a Relation when it is not needed.
-
由 Arun Agrawal 提交于
Typo fix (ci skip)
-
- 07 9月, 2015 2 次提交
-
-
由 amitkumarsuroliya 提交于
`lengh` should be `length`
-
由 Yves Senn 提交于
Add require to ensure Time#advance works without implicit required
-