has_many_polymorphs 2.11 → 2.12
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/CHANGELOG +3 -1
- data/Manifest +43 -61
- data/README +30 -0
- data/TODO +0 -3
- data/generators/tagging/tagging_generator.rb +2 -0
- data/generators/tagging/templates/tag_test.rb +7 -2
- data/generators/tagging/templates/tagging.rb +2 -2
- data/generators/tagging/templates/tagging_extensions.rb +49 -2
- data/generators/tagging/templates/tagging_test.rb +32 -9
- data/generators/tagging/templates/tags.yml +2 -2
- data/has_many_polymorphs.gemspec +20 -13
- data/lib/has_many_polymorphs.rb +0 -1
- data/lib/has_many_polymorphs/autoload.rb +45 -37
- data/lib/has_many_polymorphs/class_methods.rb +2 -15
- data/lib/has_many_polymorphs/configuration.rb +2 -2
- data/lib/has_many_polymorphs/rake_task_redefine_task.rb +9 -1
- data/test/generator/tagging_generator_test.rb +42 -0
- data/test/integration/app/app/controllers/bones_controller.rb +5 -0
- data/test/integration/app/app/helpers/bones_helper.rb +2 -0
- data/test/integration/app/app/models/bone.rb +2 -0
- data/test/integration/app/app/models/double_sti_parent.rb +2 -0
- data/test/integration/app/app/models/double_sti_parent_relationship.rb +2 -0
- data/test/integration/app/app/models/organic_substance.rb +2 -0
- data/test/integration/app/app/models/single_sti_parent.rb +4 -0
- data/test/integration/app/app/models/single_sti_parent_relationship.rb +4 -0
- data/test/integration/app/app/models/stick.rb +2 -0
- data/test/integration/app/app/models/stone.rb +2 -0
- data/test/integration/app/app/views/bones/index.rhtml +5 -0
- data/test/integration/app/config/boot.rb +97 -32
- data/test/integration/app/config/database.yml +8 -12
- data/test/integration/app/config/environment.rb +9 -3
- data/test/integration/app/config/environment.rb.canonical +19 -0
- data/test/integration/app/config/environments/development.rb +6 -5
- data/test/integration/app/db/migrate/001_create_sticks.rb +11 -0
- data/test/integration/app/db/migrate/002_create_stones.rb +11 -0
- data/test/integration/app/db/migrate/003_create_organic_substances.rb +11 -0
- data/test/integration/app/db/migrate/004_create_bones.rb +8 -0
- data/test/integration/app/db/migrate/005_create_single_sti_parents.rb +11 -0
- data/test/integration/app/db/migrate/006_create_double_sti_parents.rb +11 -0
- data/test/integration/app/db/migrate/007_create_single_sti_parent_relationships.rb +13 -0
- data/test/integration/app/db/migrate/008_create_double_sti_parent_relationships.rb +14 -0
- data/test/integration/app/db/migrate/009_create_library_model.rb +11 -0
- data/test/integration/app/db/schema.rb +21 -121
- data/test/integration/app/hmp_development +0 -0
- data/test/integration/app/lib/library_model.rb +2 -0
- data/test/integration/app/test/fixtures/double_sti_parent_relationships.yml +7 -0
- data/test/integration/app/test/fixtures/double_sti_parents.yml +7 -0
- data/test/integration/app/test/fixtures/organic_substances.yml +5 -0
- data/test/integration/app/test/fixtures/single_sti_parent_relationships.yml +7 -0
- data/test/integration/app/test/fixtures/single_sti_parents.yml +7 -0
- data/test/integration/app/test/fixtures/sticks.yml +7 -0
- data/test/integration/app/test/fixtures/stones.yml +7 -0
- data/test/integration/app/test/{unit/user_test.rb → functional/bones_controller_test.rb} +1 -3
- data/test/integration/app/test/test_helper.rb +1 -21
- data/test/integration/app/test/unit/{state_test.rb → bone_test.rb} +1 -3
- data/test/integration/app/test/unit/{seller_test.rb → double_sti_parent_relationship_test.rb} +1 -3
- data/test/integration/app/test/unit/{address_test.rb → double_sti_parent_test.rb} +1 -3
- data/test/integration/app/test/unit/organic_substance_test.rb +8 -0
- data/test/integration/app/test/unit/single_sti_parent_relationship_test.rb +8 -0
- data/test/integration/app/test/unit/single_sti_parent_test.rb +8 -0
- data/test/integration/app/test/unit/stick_test.rb +8 -0
- data/test/integration/app/test/unit/stone_test.rb +8 -0
- data/test/integration/server_test.rb +43 -0
- data/test/patches/symlinked_plugins_1.2.6.diff +46 -0
- data/test/setup.rb +6 -2
- data/test/test_helper.rb +32 -16
- data/test/unit/{polymorph_test.rb → has_many_polymorphs_test.rb} +16 -16
- metadata +49 -65
- metadata.gz.sig +0 -0
- data/generators/commenting/commenting_generator.rb +0 -94
- data/generators/commenting/templates/comment.rb +0 -33
- data/generators/commenting/templates/comment_test.rb +0 -12
- data/generators/commenting/templates/commenting.rb +0 -13
- data/generators/commenting/templates/commenting_extensions.rb +0 -30
- data/generators/commenting/templates/commenting_test.rb +0 -30
- data/generators/commenting/templates/commentings.yml +0 -23
- data/generators/commenting/templates/comments.yml +0 -13
- data/generators/commenting/templates/migration.rb +0 -28
- data/lib/has_many_polymorphs/dependencies.rb +0 -41
- data/test/integration/app/app/controllers/addresses_controller.rb +0 -85
- data/test/integration/app/app/controllers/sellers_controller.rb +0 -85
- data/test/integration/app/app/controllers/states_controller.rb +0 -85
- data/test/integration/app/app/controllers/users_controller.rb +0 -85
- data/test/integration/app/app/models/address.rb +0 -4
- data/test/integration/app/app/models/citation.rb +0 -3
- data/test/integration/app/app/models/citations_item.rb +0 -4
- data/test/integration/app/app/models/seller.rb +0 -4
- data/test/integration/app/app/models/state.rb +0 -3
- data/test/integration/app/app/models/user.rb +0 -4
- data/test/integration/app/db/migrate/001_create_users.rb +0 -16
- data/test/integration/app/db/migrate/002_create_sellers.rb +0 -14
- data/test/integration/app/db/migrate/003_create_addresses.rb +0 -19
- data/test/integration/app/db/migrate/004_create_states.rb +0 -12
- data/test/integration/app/db/migrate/005_add_capitalization_to_seller.rb +0 -9
- data/test/integration/app/db/migrate/006_add_deleted_to_user.rb +0 -9
- data/test/integration/app/db/migrate/007_add_lat_and_long_to_address.rb +0 -11
- data/test/integration/app/db/migrate/008_create_citations.rb +0 -12
- data/test/integration/app/db/migrate/009_create_citations_items.rb +0 -14
- data/test/integration/app/generated_models/aquatic_fish.rb +0 -109
- data/test/integration/app/generated_models/aquatic_pupils_whale.rb +0 -13
- data/test/integration/app/generated_models/aquatic_whale.rb +0 -42
- data/test/integration/app/generated_models/beautiful_fight_relationship.rb +0 -25
- data/test/integration/app/generated_models/citation.rb +0 -40
- data/test/integration/app/generated_models/citations_item.rb +0 -12
- data/test/integration/app/generated_models/dog.rb +0 -183
- data/test/integration/app/generated_models/eaters_foodstuff.rb +0 -13
- data/test/integration/app/generated_models/frog.rb +0 -78
- data/test/integration/app/generated_models/kitten.rb +0 -161
- data/test/integration/app/generated_models/parentship.rb +0 -14
- data/test/integration/app/generated_models/person.rb +0 -53
- data/test/integration/app/generated_models/petfood.rb +0 -125
- data/test/integration/app/generated_models/polymorph_test_some_model.rb +0 -25
- data/test/integration/app/generated_models/seller.rb +0 -30
- data/test/integration/app/generated_models/tabby.rb +0 -26
- data/test/integration/app/generated_models/user.rb +0 -34
- data/test/integration/app/generated_models/wild_boar.rb +0 -87
- data/test/integration/app/test/fixtures/addresses.yml +0 -13
- data/test/integration/app/test/fixtures/citations.yml +0 -9
- data/test/integration/app/test/fixtures/citations_items.yml +0 -9
- data/test/integration/app/test/fixtures/sellers.yml +0 -10
- data/test/integration/app/test/fixtures/states.yml +0 -216
- data/test/integration/app/test/fixtures/users.yml +0 -11
- data/test/integration/app/test/unit/citation_test.rb +0 -10
- data/test/integration/app/test/unit/citations_item_test.rb +0 -10
- data/test/test_all.rb +0 -16
data/lib/has_many_polymorphs.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
|
2
|
-
require 'initializer' unless defined? Rails::Initializer
|
2
|
+
require 'initializer' unless defined? ::Rails::Initializer
|
3
|
+
require 'dispatcher' unless defined? ::ActionController::Dispatcher
|
3
4
|
|
4
|
-
|
5
|
+
module HasManyPolymorphs
|
5
6
|
|
6
7
|
=begin rdoc
|
7
8
|
Searches for models that use <tt>has_many_polymorphs</tt> or <tt>acts_as_double_polymorphic_join</tt> and makes sure that they get loaded during app initialization. This ensures that helper methods are injected into the target classes.
|
@@ -11,52 +12,59 @@ Note that you can override DEFAULT_OPTIONS via Rails::Configuration#has_many_pol
|
|
11
12
|
# your other configuration here
|
12
13
|
|
13
14
|
config.after_initialize do
|
14
|
-
config.has_many_polymorphs_options['requirements'] << '
|
15
|
+
config.has_many_polymorphs_options['requirements'] << 'lib/my_extension'
|
15
16
|
end
|
16
17
|
end
|
17
18
|
|
18
19
|
=end
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
mattr_accessor :options
|
29
|
-
@@options = HashWithIndifferentAccess.new(DEFAULT_OPTIONS)
|
21
|
+
DEFAULT_OPTIONS = {
|
22
|
+
:file_pattern => "#{RAILS_ROOT}/app/models/**/*.rb",
|
23
|
+
:file_exclusions => ['svn', 'CVS', 'bzr'],
|
24
|
+
:methods => ['has_many_polymorphs', 'acts_as_double_polymorphic_join'],
|
25
|
+
:requirements => []}
|
26
|
+
|
27
|
+
mattr_accessor :options
|
28
|
+
@@options = HashWithIndifferentAccess.new(DEFAULT_OPTIONS)
|
30
29
|
|
31
|
-
|
32
|
-
|
33
|
-
after_initialize_without_autoload
|
30
|
+
# Dispatcher callback to load polymorphic relationships from the top down.
|
31
|
+
def self.autoload
|
34
32
|
|
35
|
-
|
36
|
-
|
37
|
-
HasManyPolymorphsAutoload.options[:requirements].each do |requirement|
|
38
|
-
require requirement
|
39
|
-
end
|
33
|
+
_logger_debug "autoload hook invoked"
|
40
34
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
35
|
+
options[:requirements].each do |requirement|
|
36
|
+
_logger_warn "forcing requirement load of #{requirement}"
|
37
|
+
require requirement
|
38
|
+
end
|
39
|
+
|
40
|
+
Dir[options[:file_pattern]].each do |filename|
|
41
|
+
next if filename =~ /#{options[:file_exclusions].join("|")}/
|
42
|
+
open filename do |file|
|
43
|
+
if file.grep(/#{options[:methods].join("|")}/).any?
|
44
|
+
begin
|
45
|
+
model = File.basename(filename)[0..-4].camelize
|
46
|
+
_logger_warn "preloading parent model #{model}"
|
47
|
+
model.constantize
|
48
|
+
rescue Object => e
|
49
|
+
_logger_warn "#{model} could not be preloaded: #{e.inspect}"
|
52
50
|
end
|
53
51
|
end
|
54
52
|
end
|
55
|
-
end
|
53
|
+
end
|
54
|
+
end
|
56
55
|
|
56
|
+
end
|
57
|
+
|
58
|
+
class Rails::Initializer #:nodoc:
|
59
|
+
# Make sure it gets loaded in the console, tests, and migrations
|
60
|
+
def after_initialize_with_autoload
|
61
|
+
after_initialize_without_autoload
|
62
|
+
HasManyPolymorphs.autoload
|
57
63
|
end
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
64
|
+
alias_method_chain :after_initialize, :autoload
|
65
|
+
end
|
66
|
+
|
67
|
+
Dispatcher.to_prepare(:has_many_polymorphs_autoload) do
|
68
|
+
# Make sure it gets loaded in the app
|
69
|
+
HasManyPolymorphs.autoload
|
62
70
|
end
|
@@ -340,11 +340,7 @@ Be aware, however, that <tt>NULL != 'Spot'</tt> returns <tt>false</tt> due to SQ
|
|
340
340
|
options[:parent_extend] = spiked_create_extension_module(association_id, Array(options[:parent_extend]), "Parent")
|
341
341
|
|
342
342
|
# create the reflection object
|
343
|
-
returning(create_reflection(:has_many_polymorphs, association_id, options, self)) do |reflection|
|
344
|
-
if defined? Dependencies and defined? RAILS_ENV and RAILS_ENV == "development"
|
345
|
-
inject_dependencies(association_id, reflection) if Dependencies.mechanism == :load
|
346
|
-
end
|
347
|
-
|
343
|
+
returning(create_reflection(:has_many_polymorphs, association_id, options, self)) do |reflection|
|
348
344
|
# set up the other related associations
|
349
345
|
create_join_association(association_id, reflection)
|
350
346
|
create_has_many_through_associations_for_parent_to_children(association_id, reflection)
|
@@ -381,16 +377,7 @@ Be aware, however, that <tt>NULL != 'Spot'</tt> returns <tt>false</tt> due to SQ
|
|
381
377
|
"#{table} AS #{_alias}"
|
382
378
|
end.sort).join(", ")
|
383
379
|
end
|
384
|
-
|
385
|
-
# model caching
|
386
|
-
def inject_dependencies(association_id, reflection)
|
387
|
-
_logger_debug "injecting dependencies"
|
388
|
-
requirements = [self, reflection.klass].map{|klass| [klass, klass.base_class]}.flatten.uniq
|
389
|
-
(all_classes_for(association_id, reflection) - requirements).each do |target_klass|
|
390
|
-
Dependencies.inject_dependency(target_klass, *requirements)
|
391
|
-
end
|
392
|
-
end
|
393
|
-
|
380
|
+
|
394
381
|
# method sub-builders
|
395
382
|
|
396
383
|
def create_join_association(association_id, reflection)
|
@@ -6,11 +6,11 @@ Access the <tt>has_many_polymorphs_options</tt> hash in your Rails::Initializer.
|
|
6
6
|
class Rails::Configuration
|
7
7
|
|
8
8
|
def has_many_polymorphs_options
|
9
|
-
|
9
|
+
::HasManyPolymorphs.options
|
10
10
|
end
|
11
11
|
|
12
12
|
def has_many_polymorphs_options=(hash)
|
13
|
-
|
13
|
+
::HasManyPolymorphs.options = HashWithIndifferentAccess.new(hash)
|
14
14
|
end
|
15
15
|
|
16
16
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
3
|
+
|
4
|
+
class TaggingGeneratorTest < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
Dir.chdir RAILS_ROOT do
|
8
|
+
truncate
|
9
|
+
|
10
|
+
# Revert environment lib requires
|
11
|
+
FileUtils.cp "config/environment.rb.canonical", "config/environment.rb"
|
12
|
+
|
13
|
+
# Delete generator output
|
14
|
+
["app/models/tag.rb", "app/models/tagging.rb",
|
15
|
+
"test/unit/tag_test.rb", "test/unit/tagging_test.rb",
|
16
|
+
"test/fixtures/tags.yml", "test/fixtures/taggings.yml",
|
17
|
+
"lib/tagging_extensions.rb",
|
18
|
+
"db/migrate/010_create_tags_and_taggings.rb"].each do |file|
|
19
|
+
File.delete file if File.exist? file
|
20
|
+
end
|
21
|
+
|
22
|
+
# Rebuild database
|
23
|
+
Echoe.silence do
|
24
|
+
system("ruby #{HERE}/setup.rb")
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
alias :teardown :setup
|
30
|
+
|
31
|
+
def test_generator
|
32
|
+
Dir.chdir RAILS_ROOT do
|
33
|
+
Echoe.silence do
|
34
|
+
assert system("script/generate tagging Stick Stone -q -f")
|
35
|
+
assert system("rake db:migrate")
|
36
|
+
assert system("rake db:fixtures:load")
|
37
|
+
assert system("rake test:units")
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
@@ -1,45 +1,110 @@
|
|
1
|
-
# Don't change this file
|
1
|
+
# Don't change this file!
|
2
|
+
# Configure your app in config/environment.rb and config/environments/*.rb
|
2
3
|
|
3
|
-
unless defined?(RAILS_ROOT)
|
4
|
-
root_path = File.join(File.dirname(__FILE__), '..')
|
4
|
+
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
module Rails
|
7
|
+
class << self
|
8
|
+
def boot!
|
9
|
+
unless booted?
|
10
|
+
preinitialize
|
11
|
+
pick_boot.run
|
12
|
+
end
|
13
|
+
end
|
10
14
|
|
11
|
-
|
12
|
-
|
15
|
+
def booted?
|
16
|
+
defined? Rails::Initializer
|
17
|
+
end
|
18
|
+
|
19
|
+
def pick_boot
|
20
|
+
(vendor_rails? ? VendorBoot : GemBoot).new
|
21
|
+
end
|
22
|
+
|
23
|
+
def vendor_rails?
|
24
|
+
File.exist?("#{RAILS_ROOT}/vendor/rails")
|
25
|
+
end
|
13
26
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
else
|
18
|
-
require 'rubygems'
|
27
|
+
def preinitialize
|
28
|
+
load(preinitializer_path) if File.exists?(preinitializer_path)
|
29
|
+
end
|
19
30
|
|
20
|
-
|
21
|
-
|
22
|
-
|
31
|
+
def preinitializer_path
|
32
|
+
"#{RAILS_ROOT}/config/preinitializer.rb"
|
33
|
+
end
|
34
|
+
end
|
23
35
|
|
24
|
-
|
25
|
-
|
26
|
-
|
36
|
+
class Boot
|
37
|
+
def run
|
38
|
+
load_initializer
|
39
|
+
Rails::Initializer.run(:set_load_path)
|
40
|
+
end
|
41
|
+
end
|
27
42
|
|
28
|
-
|
29
|
-
|
30
|
-
|
43
|
+
class VendorBoot < Boot
|
44
|
+
def load_initializer
|
45
|
+
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
class GemBoot < Boot
|
50
|
+
def load_initializer
|
51
|
+
self.class.load_rubygems
|
52
|
+
load_rails_gem
|
53
|
+
require 'initializer'
|
54
|
+
end
|
55
|
+
|
56
|
+
def load_rails_gem
|
57
|
+
if version = self.class.gem_version
|
58
|
+
STDERR.puts "Boot.rb loading version #{version}"
|
59
|
+
gem 'rails', version
|
31
60
|
else
|
32
|
-
STDERR.puts
|
33
|
-
|
34
|
-
|
35
|
-
|
61
|
+
STDERR.puts "Boot.rb loading latest available version"
|
62
|
+
gem 'rails'
|
63
|
+
end
|
64
|
+
rescue Gem::LoadError => load_error
|
65
|
+
$stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
|
66
|
+
exit 1
|
67
|
+
end
|
68
|
+
|
69
|
+
class << self
|
70
|
+
def rubygems_version
|
71
|
+
Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
|
72
|
+
end
|
73
|
+
|
74
|
+
def gem_version
|
75
|
+
if defined? RAILS_GEM_VERSION
|
76
|
+
RAILS_GEM_VERSION
|
77
|
+
elsif ENV.include?('RAILS_GEM_VERSION')
|
78
|
+
ENV['RAILS_GEM_VERSION']
|
79
|
+
else
|
80
|
+
parse_gem_version(read_environment_rb)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def load_rubygems
|
85
|
+
require 'rubygems'
|
86
|
+
|
87
|
+
unless rubygems_version >= '0.9.4'
|
88
|
+
$stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
89
|
+
exit 1
|
90
|
+
end
|
91
|
+
|
92
|
+
rescue LoadError
|
93
|
+
$stderr.puts %(Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
36
94
|
exit 1
|
37
95
|
end
|
38
|
-
|
39
|
-
|
40
|
-
|
96
|
+
|
97
|
+
def parse_gem_version(text)
|
98
|
+
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*'([!~<>=]*\s*[\d.]+)'/
|
99
|
+
end
|
100
|
+
|
101
|
+
private
|
102
|
+
def read_environment_rb
|
103
|
+
File.read("#{RAILS_ROOT}/config/environment.rb")
|
104
|
+
end
|
41
105
|
end
|
42
106
|
end
|
43
|
-
|
44
|
-
Rails::Initializer.run(:set_load_path)
|
45
107
|
end
|
108
|
+
|
109
|
+
# All that for this:
|
110
|
+
Rails.boot!
|
@@ -1,21 +1,17 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
adapter: mysql
|
2
|
+
defaults: &defaults
|
3
|
+
adapter: <%= ENV['DB'] || 'mysql' %>
|
4
4
|
host: localhost
|
5
5
|
database: hmp_development
|
6
6
|
username: root
|
7
7
|
password:
|
8
8
|
|
9
|
+
development:
|
10
|
+
<<: *defaults
|
11
|
+
|
9
12
|
test:
|
10
|
-
|
11
|
-
host: localhost
|
12
|
-
database: hmp_test
|
13
|
-
username: root
|
14
|
-
password:
|
13
|
+
<<: *defaults
|
15
14
|
|
16
15
|
production:
|
17
|
-
|
18
|
-
|
19
|
-
database: hmp_production
|
20
|
-
username: root
|
21
|
-
password:
|
16
|
+
<<: *defaults
|
17
|
+
|
@@ -1,13 +1,19 @@
|
|
1
|
-
|
2
1
|
require File.join(File.dirname(__FILE__), 'boot')
|
2
|
+
require 'action_controller'
|
3
3
|
|
4
4
|
Rails::Initializer.run do |config|
|
5
5
|
|
6
|
-
if
|
7
|
-
config.action_controller.session = {
|
6
|
+
if ActionController::Base.respond_to? 'session='
|
7
|
+
config.action_controller.session = {:session_key => '_app_session', :secret => '22cde4d5c1a61ba69a81795322cde4d5c1a61ba69a817953'}
|
8
8
|
end
|
9
9
|
|
10
10
|
config.load_paths << "#{RAILS_ROOT}/app/models/person" # moduleless model path
|
11
|
+
|
12
|
+
config.after_initialize do
|
13
|
+
config.has_many_polymorphs_options['requirements'] << "#{RAILS_ROOT}/lib/library_model"
|
14
|
+
end
|
11
15
|
end
|
12
16
|
|
13
17
|
# Dependencies.log_activity = true
|
18
|
+
|
19
|
+
ENV['RAILS_ASSET_ID'] = Time.now.to_i.to_s
|