sunrise-cms 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/controllers/sunrise/manager_controller.rb +4 -4
- data/app/helpers/sunrise/structure_helper.rb +1 -1
- data/lib/sunrise/abstract_model.rb +2 -3
- data/lib/sunrise/config/association.rb +4 -0
- data/lib/sunrise/config/model.rb +0 -1
- data/lib/sunrise/version.rb +1 -1
- data/spec/dummy/log/test.log +2629 -0
- data/spec/models/sunrise/abstract_model_spec.rb +1 -1
- data/spec/tmp/app/models/defaults/ability.rb +18 -0
- data/spec/tmp/app/models/defaults/asset.rb +7 -0
- data/spec/tmp/app/models/defaults/attachment_file.rb +5 -0
- data/spec/tmp/app/models/defaults/avatar.rb +7 -0
- data/spec/tmp/app/models/defaults/picture.rb +7 -0
- data/spec/tmp/app/models/defaults/position_type.rb +7 -0
- data/spec/tmp/app/models/defaults/role_type.rb +8 -0
- data/spec/tmp/app/models/defaults/settings.rb +3 -0
- data/spec/tmp/app/models/defaults/structure.rb +9 -0
- data/spec/tmp/app/models/defaults/structure_type.rb +9 -0
- data/spec/tmp/app/models/defaults/user.rb +13 -0
- data/spec/tmp/app/models/sunrise/sunrise_navigation.rb +14 -0
- data/spec/tmp/app/models/sunrise/sunrise_page.rb +10 -0
- data/spec/tmp/app/models/sunrise/sunrise_structure.rb +35 -0
- data/spec/tmp/app/models/sunrise/sunrise_user.rb +50 -0
- data/spec/tmp/app/uploaders/attachment_file_uploader.rb +5 -0
- data/spec/tmp/app/uploaders/avatar_uploader.rb +15 -0
- data/spec/tmp/app/uploaders/picture_uploader.rb +15 -0
- data/spec/tmp/app/views/layouts/application.html.erb +22 -0
- data/spec/tmp/app/views/pages/show.html.erb +2 -0
- data/spec/tmp/app/views/shared/_notice.html.erb +17 -0
- data/spec/tmp/config/application.rb +63 -0
- data/spec/tmp/config/database.yml.sample +34 -0
- data/spec/tmp/config/initializers/sunrise.rb +18 -0
- data/spec/tmp/config/logrotate-config.sample +9 -0
- data/spec/tmp/config/nginx-config.sample +99 -0
- data/spec/tmp/config/routes.rb +9 -0
- data/spec/tmp/db/seeds.rb +31 -0
- data/spec/tmp/spec/controllers/pages_controller_spec.rb +22 -0
- data/spec/tmp/spec/controllers/welcome_controller_spec.rb +18 -0
- data/spec/tmp/spec/factories/structure_factory.rb +22 -0
- data/spec/tmp/spec/factories/user_factory.rb +61 -0
- data/spec/tmp/spec/spec_helper.rb +37 -0
- data/spec/tmp/spec/support/helpers/controller_macros.rb +52 -0
- metadata +69 -1
@@ -115,7 +115,7 @@ module Sunrise
|
|
115
115
|
templates << [path, scope, action] if scope
|
116
116
|
|
117
117
|
if Sunrise::Config.scoped_views?
|
118
|
-
templates << [path, abstract_model.
|
118
|
+
templates << [path, abstract_model.plural, scope, action]
|
119
119
|
end
|
120
120
|
|
121
121
|
templates.reverse.each do |keys|
|
@@ -129,8 +129,8 @@ module Sunrise
|
|
129
129
|
templates << [ path, abstract_model.current_list, scope ]
|
130
130
|
|
131
131
|
if Sunrise::Config.scoped_views?
|
132
|
-
templates << [ path, abstract_model.
|
133
|
-
templates << [ path, abstract_model.
|
132
|
+
templates << [ path, abstract_model.plural, scope ]
|
133
|
+
templates << [ path, abstract_model.plural, abstract_model.current_list, scope ]
|
134
134
|
end
|
135
135
|
|
136
136
|
templates.reverse.each do |keys|
|
@@ -155,7 +155,7 @@ module Sunrise
|
|
155
155
|
|
156
156
|
def redirect_after_update
|
157
157
|
if abstract_model.without_list?
|
158
|
-
index_path(:model_name => abstract_model.
|
158
|
+
index_path(:model_name => abstract_model.plural)
|
159
159
|
else
|
160
160
|
scoped_index_path
|
161
161
|
end
|
@@ -12,7 +12,7 @@ module Sunrise
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def show_model_path(abstract_model, record)
|
15
|
-
model_name = abstract_model.
|
15
|
+
model_name = abstract_model.plural
|
16
16
|
|
17
17
|
case model_name
|
18
18
|
when :some_collection then index_path(:model_name => :stores, :parent_type => :some_collection, :parent_id => record.id)
|
@@ -44,7 +44,7 @@ module Sunrise
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
attr_accessor :model_name, :current_list, :sort_column, :
|
47
|
+
attr_accessor :model_name, :current_list, :sort_column, :available_list_view
|
48
48
|
|
49
49
|
delegate :config, :model, :to => 'self.class'
|
50
50
|
delegate :label, :to => 'self.class.config'
|
@@ -55,7 +55,6 @@ module Sunrise
|
|
55
55
|
@current_list = config.default_list_view
|
56
56
|
@available_list_view = config.available_list_view
|
57
57
|
@sort_column = config.sort_column
|
58
|
-
@scoped_path = @model_name.plural
|
59
58
|
@request_params = params.symbolize_keys
|
60
59
|
self.current_list = params[:view]
|
61
60
|
end
|
@@ -190,7 +189,7 @@ module Sunrise
|
|
190
189
|
|
191
190
|
def association_scope
|
192
191
|
if parent_record
|
193
|
-
parent_record.send(
|
192
|
+
parent_record.send(parent_association.relation_name).scoped
|
194
193
|
end
|
195
194
|
end
|
196
195
|
|
data/lib/sunrise/config/model.rb
CHANGED
data/lib/sunrise/version.rb
CHANGED