File tree 2 files changed +29
-3
lines changed
spec/dummy/config/environments
2 files changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,28 @@ def fields_configuration
55
55
##
56
56
# If we don't have a globalized model yet we return our temporary layout
57
57
def layout
58
- globalized_model . nil? ? @layout : globalized_model . layout
58
+ # Since respond_to_missing? has been reimplemented in
59
+ # NoCms::Blocks::Concerns::SerializingFields we need to first check that
60
+ # we have the foreign key to access the globalized_model association
61
+ #
62
+ # This is due to the empty translations Globalize creates sometimes that
63
+ # only have locale.
64
+ #
65
+ # If we don't check then we will throw a non defined attribute
66
+ # exception.
67
+
68
+ # First we check wether we don't respond to the foreign key of the
69
+ # globalize model association
70
+ if !respond_to? ( self . class . reflections . symbolize_keys [ :globalized_model ] . foreign_key ) ||
71
+ globalized_model . nil? # and then that the globalized model is nil
72
+
73
+ # In any of these cases we return our stored layout
74
+ @layout
75
+ else
76
+ # If we can access to the globalized_model, then we return its
77
+ # information
78
+ globalized_model . layout
79
+ end
59
80
end
60
81
61
82
include NoCms ::Blocks ::Concerns ::SerializingFields
Original file line number Diff line number Diff line change 13
13
config . eager_load = false
14
14
15
15
# Configure static asset server for tests with Cache-Control for performance.
16
- config . serve_static_files = true
17
- config . static_cache_control = "public, max-age=3600"
16
+ if Rails . version > "5"
17
+ config . public_file_server . enabled = true
18
+ config . public_file_server . headers = { 'Cache-Control' => 'public, max-age=3600' }
19
+ else
20
+ config . serve_static_files = true
21
+ config . static_cache_control = "public, max-age=3600"
22
+ end
18
23
19
24
# Show full error reports and disable caching.
20
25
config . consider_all_requests_local = true
You can’t perform that action at this time.
0 commit comments