-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from DmitryTsepelev/0.2.1
0.2.1
- Loading branch information
Showing
27 changed files
with
118 additions
and
180 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ spec/dummy/yarn-error.log | |
spec/dummy/storage/ | ||
spec/dummy/tmp/ | ||
coverage/ | ||
Gemfile.lock |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,12 @@ | ||
# frozen_string_literal: true | ||
|
||
require "ar_lazy_preload/configuration" | ||
require "ar_lazy_preload/ext/base" | ||
require "ar_lazy_preload/ext/relation" | ||
require "ar_lazy_preload/ext/association" | ||
require "ar_lazy_preload/ext/merger" | ||
require "ar_lazy_preload/ext/association_relation" | ||
require "ar_lazy_preload/railtie" | ||
|
||
module ArLazyPreload | ||
class << self | ||
def config | ||
@config ||= Configuration.new | ||
end | ||
end | ||
|
||
ActiveRecord::Base.include(ArLazyPreload::Base) | ||
|
||
ActiveRecord::Relation.prepend(ArLazyPreload::Relation) | ||
ActiveRecord::AssociationRelation.prepend(ArLazyPreload::AssociationRelation) | ||
ActiveRecord::Relation::Merger.prepend(ArLazyPreload::Merger) | ||
|
||
[ | ||
ActiveRecord::Associations::CollectionAssociation, | ||
ActiveRecord::Associations::Association | ||
].each { |klass| klass.prepend(ArLazyPreload::Association) } | ||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# frozen_string_literal: true | ||
|
||
require "ar_lazy_preload/active_record/base" | ||
require "ar_lazy_preload/active_record/relation" | ||
require "ar_lazy_preload/active_record/association" | ||
require "ar_lazy_preload/active_record/merger" | ||
require "ar_lazy_preload/active_record/association_relation" | ||
|
||
module ArLazyPreload | ||
class Railtie < Rails::Railtie | ||
config.to_prepare do |_app| | ||
ActiveSupport.on_load(:active_record) do | ||
ActiveRecord::Base.include(Base) | ||
|
||
ActiveRecord::Relation.prepend(Relation) | ||
ActiveRecord::AssociationRelation.prepend(AssociationRelation) | ||
ActiveRecord::Relation::Merger.prepend(Merger) | ||
|
||
[ | ||
ActiveRecord::Associations::CollectionAssociation, | ||
ActiveRecord::Associations::Association | ||
].each { |klass| klass.prepend(Association) } | ||
end | ||
end | ||
end | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module ArLazyPreload | ||
VERSION = "0.2.0" | ||
VERSION = "0.2.1" | ||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
require File.expand_path("boot", __dir__) | ||
|
||
require "rails" | ||
require "action_controller/railtie" | ||
require "ar_lazy_preload/railtie" | ||
|
||
Bundler.require(*Rails.groups) | ||
|
||
module Dummy | ||
class Application < Rails::Application | ||
config.logger = Logger.new("/dev/null") | ||
config.eager_load = false | ||
end | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
# Set up gems listed in the Gemfile. | ||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__) | ||
|
||
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"]) | ||
$LOAD_PATH.unshift File.expand_path("../../../lib", __dir__) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# SQLite version 3.x | ||
# gem install sqlite3 | ||
# | ||
# Ensure the SQLite 3 gem is defined in your Gemfile | ||
# gem 'sqlite3' | ||
# | ||
default: &default | ||
adapter: sqlite3 | ||
pool: 5 | ||
timeout: 5000 | ||
|
||
development: | ||
<<: *default | ||
database: db/development.sqlite3 | ||
|
||
# Warning: The database defined as "test" will be erased and | ||
# re-generated from your development database when you run "rake". | ||
# Do not set this db to the same as development or production. | ||
test: | ||
<<: *default | ||
database: db/test.sqlite3 | ||
|
||
production: | ||
<<: *default | ||
database: db/production.sqlite3 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
# Load the Rails application. | ||
require File.expand_path("application", __dir__) | ||
|
||
# Initialize the Rails application. | ||
Dummy::Application.initialize! |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
Dummy::Application.configure do | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
Dummy::Application.routes.draw do | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Be sure to restart your server when you modify this file. | ||
|
||
# Your secret key is used for verifying the integrity of signed cookies. | ||
# If you change this key, all old signed cookies will become invalid! | ||
|
||
# Make sure the secret is at least 30 characters and all random, | ||
# no regular words or you'll be exposed to dictionary attacks. | ||
# You can use `rake secret` to generate a secure secret key. | ||
|
||
# Make sure the secrets in this file are kept private | ||
# if you're sharing your code publicly. | ||
|
||
development: | ||
secret_key_base: a6a03acbab7b7658ca0b82967eabfc3f2954a81db06614bbbd7ecbf5a8ef27d2bbda85fc87d71b0475c5d711d6b096fa3f0d9dfbe44bb671841c4e1396b8a9e5 | ||
|
||
test: | ||
secret_key_base: b6d9c9ed45db8aa6336d82dd12332915592299b519f8a4f34045352a9e908409fe057335ee8400df2298ad0ee4e304e7630f52d391bad8b89449bfad62010930 | ||
|
||
# Do not keep production secrets in the repository, | ||
# instead read values from the environment. | ||
production: | ||
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> |
This file contains 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