These are the examples used in the Active Record PostgreSQL guide. They are executable and verifiable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler' | |
Bundler.setup(:default) | |
require 'active_record' | |
require 'minitest/autorun' | |
require 'logger' | |
# This connection will do for database-independent bug reports. | |
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') | |
ActiveRecord::Base.logger = Logger.new(STDOUT) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler' | |
Bundler.setup(:default) | |
require 'rails' | |
require 'action_controller/railtie' | |
class TestApp < Rails::Application | |
config.root = File.dirname(__FILE__) | |
config.session_store :cookie_store, key: 'cookie_store_key' | |
config.secret_token = 'secret_token' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler' | |
Bundler.setup(:default) | |
require 'active_record' | |
require 'minitest/autorun' | |
require 'logger' | |
# This connection will do for database-independent bug reports. | |
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') | |
ActiveRecord::Base.logger = Logger.new(STDOUT) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unless File.exist?('Gemfile') | |
File.write('Gemfile', <<-GEMFILE) | |
source 'https://rubygems.org' | |
gem 'rails', github: 'rails/rails' | |
gem 'arel', github: 'rails/arel' | |
gem 'sqlite3' | |
GEMFILE | |
system 'bundle' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/actionview/CHANGELOG.md b/actionview/CHANGELOG.md | |
index c05ed10..baf8323 100644 | |
--- a/actionview/CHANGELOG.md | |
+++ b/actionview/CHANGELOG.md | |
@@ -1,3 +1,7 @@ | |
+* Fix ActionView label translation for more than 10 nested elements. | |
+ | |
+ *Vladimir Krylov* | |
+ | |
* Added `:plain`, `:html` and `:body` option for `render` method. Please see |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__update_callbacks | |
_attr_readonly | |
_attr_readonly= | |
_attr_readonly? | |
_commit_callbacks | |
_commit_callbacks= | |
_commit_callbacks? | |
_create_callbacks | |
_create_callbacks= | |
_create_callbacks? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
def extract_schema_and_table(name) | |
table, schema = name.scan(/[^".\s]+|"[^"]*"/)[0..1].collect{|m| m.gsub(/(^"|"$)/,'') }.reverse | |
[schema, table] | |
end | |
def extract_pg_identifier_from_name(name) | |
match_data = name.start_with?('"') ? name.match(/\"([^\"]+)\"/) : name.match(/([^\.]+)/) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb | |
index a22849f..021c50d 100644 | |
--- a/activerecord/lib/active_record/relation/query_methods.rb | |
+++ b/activerecord/lib/active_record/relation/query_methods.rb | |
@@ -1030,13 +1030,14 @@ module ActiveRecord | |
arel.order(*orders) unless orders.empty? | |
end | |
- VALID_DIRECTIONS = [:asc, :desc, 'asc', 'desc'] # :nodoc: | |
+ VALID_DIRECTIONS = [:asc, :desc, :ASC, :DESC, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/activerecord/test/cases/adapters/postgresql/hstore_test.rb b/activerecord/test/cases/adapters/postgresql/hstore_test.rb | |
index 90ec152..640ca73 100644 | |
--- a/activerecord/test/cases/adapters/postgresql/hstore_test.rb | |
+++ b/activerecord/test/cases/adapters/postgresql/hstore_test.rb | |
@@ -258,6 +258,34 @@ class PostgresqlHstoreTest < ActiveRecord::TestCase | |
Hstore.update_all tags: { } | |
assert_equal({ }, hstore.reload.tags) | |
end | |
+ | |
+ class TagCollection |