activerecord_views 0.0.18 → 0.0.19
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4abfbb8e0d3997f414810c95fec10c72d205b496
|
4
|
+
data.tar.gz: 0a441b8cbf5102e31a6dcabe631aca2ba0573448
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32ea38c39c48f983b5bf77343b70e2744ec15352dfabd157dbc944299a41eda074863430fb73af3840e63ea22f0c08b2b16b0ad1ca5c67a20bb675c016d6ce1a
|
7
|
+
data.tar.gz: 99df12b314ab50305db7e276ac18421c82fc01a548ccc266f71e53d3ad4c13d37e60f21d2399068691fe9be88384b19ba7fd177a97fe054102d95298d616584b
|
@@ -4,10 +4,10 @@ module ActiveRecordViews
|
|
4
4
|
ActiveSupport.on_load :active_record do
|
5
5
|
ActiveRecordViews.sql_load_path << Rails.root + 'app/models'
|
6
6
|
ActiveRecordViews.init!
|
7
|
+
ActiveRecordViews::Extension.create_enabled = !Rails.env.production?
|
7
8
|
end
|
8
9
|
|
9
10
|
ActiveSupport.on_load :action_controller do
|
10
|
-
ActiveRecordViews::Extension.create_enabled = !app.config.cache_classes
|
11
11
|
unless app.config.cache_classes
|
12
12
|
ActionDispatch::Callbacks.before do
|
13
13
|
ActiveRecordViews.reload_stale_views!
|
data/spec/internal/Rakefile
CHANGED
@@ -8,7 +8,8 @@ Combustion::Database.instance_eval do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
Combustion.initialize! :active_record, :action_controller do
|
11
|
-
config.cache_classes =
|
11
|
+
config.cache_classes = false
|
12
|
+
config.log_level = :debug
|
12
13
|
end
|
13
14
|
|
14
15
|
load 'active_record/railties/databases.rake'
|
data/spec/tasks_spec.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe 'rake tasks' do
|
4
|
-
def rake(task_name,
|
4
|
+
def rake(task_name, production: false)
|
5
5
|
system(*%W[
|
6
6
|
rake
|
7
7
|
-f spec/internal/Rakefile
|
8
8
|
#{task_name}
|
9
|
-
|
9
|
+
RAILS_ENV=#{production ? 'production' : 'development'}
|
10
10
|
])
|
11
11
|
raise unless $?.success?
|
12
12
|
end
|
@@ -26,9 +26,9 @@ describe 'rake tasks' do
|
|
26
26
|
expect(view_names).to be_empty
|
27
27
|
end
|
28
28
|
|
29
|
-
it 'creates database views
|
29
|
+
it 'creates database views in production mode' do
|
30
30
|
expect(view_names).to be_empty
|
31
|
-
rake 'db:migrate',
|
31
|
+
rake 'db:migrate', production: true
|
32
32
|
expect(view_names).to_not be_empty
|
33
33
|
end
|
34
34
|
|
@@ -43,9 +43,9 @@ describe 'rake tasks' do
|
|
43
43
|
expect(view_names).to include 'old_view'
|
44
44
|
end
|
45
45
|
|
46
|
-
it 'drops unregistered views
|
46
|
+
it 'drops unregistered views in production mode' do
|
47
47
|
expect(view_names).to include 'old_view'
|
48
|
-
rake 'db:migrate',
|
48
|
+
rake 'db:migrate', production: true
|
49
49
|
expect(view_names).to_not include 'old_view'
|
50
50
|
end
|
51
51
|
end
|