spree_core 0.50.4 → 0.60.0.RC1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/admin/adjustments_controller.rb +8 -7
- data/app/controllers/admin/base_controller.rb +1 -33
- data/app/controllers/admin/configurations_controller.rb +0 -24
- data/app/controllers/admin/images_controller.rb +10 -25
- data/app/controllers/admin/line_items_controller.rb +41 -26
- data/app/controllers/admin/mail_methods_controller.rb +2 -7
- data/app/controllers/admin/option_types_controller.rb +17 -21
- data/app/controllers/admin/orders_controller.rb +70 -55
- data/app/controllers/admin/payment_methods_controller.rb +33 -22
- data/app/controllers/admin/payments_controller.rb +25 -27
- data/app/controllers/admin/product_groups_controller.rb +22 -20
- data/app/controllers/admin/product_properties_controller.rb +2 -6
- data/app/controllers/admin/product_scopes_controller.rb +24 -20
- data/app/controllers/admin/products_controller.rb +20 -26
- data/app/controllers/admin/properties_controller.rb +2 -20
- data/app/controllers/admin/prototypes_controller.rb +5 -33
- data/app/controllers/admin/resource_controller.rb +221 -0
- data/app/controllers/admin/return_authorizations_controller.rb +3 -9
- data/app/controllers/admin/shipments_controller.rb +68 -35
- data/app/controllers/admin/shipping_categories_controller.rb +1 -15
- data/app/controllers/admin/shipping_methods_controller.rb +6 -12
- data/app/controllers/admin/states_controller.rb +16 -21
- data/app/controllers/admin/tax_categories_controller.rb +1 -12
- data/app/controllers/admin/tax_rates_controller.rb +2 -12
- data/app/controllers/admin/taxonomies_controller.rb +11 -12
- data/app/controllers/admin/taxons_controller.rb +74 -53
- data/app/controllers/admin/trackers_controller.rb +1 -6
- data/app/controllers/admin/users_controller.rb +36 -35
- data/app/controllers/admin/variants_controller.rb +7 -22
- data/app/controllers/admin/zones_controller.rb +12 -25
- data/app/controllers/checkout_controller.rb +2 -6
- data/app/controllers/orders_controller.rb +0 -1
- data/app/controllers/products_controller.rb +12 -16
- data/app/controllers/taxons_controller.rb +8 -15
- data/app/helpers/admin/navigation_helper.rb +4 -0
- data/app/models/address.rb +1 -1
- data/app/models/app_configuration.rb +2 -3
- data/app/models/product.rb +1 -2
- data/app/models/product_group.rb +8 -8
- data/app/models/product_scope.rb +1 -1
- data/app/models/shipping_method.rb +6 -2
- data/app/models/tax_rate.rb +1 -1
- data/app/views/admin/general_settings/edit.html.erb +10 -15
- data/app/views/admin/general_settings/show.html.erb +5 -5
- data/app/views/admin/option_types/{new.html.erb → new.erb} +0 -0
- data/app/views/admin/orders/_form.html.erb +0 -1
- data/app/views/admin/orders/edit.html.erb +2 -2
- data/app/views/admin/orders/index.html.erb +2 -2
- data/app/views/admin/payment_methods/edit.html.erb +1 -1
- data/app/views/admin/payments/new.html.erb +2 -2
- data/app/views/admin/payments/show.html.erb +3 -3
- data/app/views/admin/product_groups/index.html.erb +1 -1
- data/app/views/admin/product_scopes/create.js.erb +3 -3
- data/app/views/admin/product_scopes/destroy.js.erb +2 -2
- data/app/views/admin/products/{new.html.erb → new.erb} +0 -0
- data/app/views/admin/properties/{new.html.erb → new.erb} +0 -0
- data/app/views/admin/prototypes/{new.html.erb → new.erb} +0 -0
- data/app/views/admin/shared/_product_tabs.html.erb +1 -1
- data/app/views/admin/shared/_tabs.html.erb +1 -1
- data/app/views/admin/shipments/edit.html.erb +3 -3
- data/app/views/admin/shipments/index.html.erb +1 -1
- data/app/views/admin/shipments/new.html.erb +1 -1
- data/app/views/admin/states/{new.html.erb → new.erb} +0 -0
- data/app/views/admin/tax_categories/edit.html.erb +1 -1
- data/app/views/admin/taxonomies/{edit.html.erb → edit.erb} +0 -0
- data/app/views/admin/taxons/edit.html.erb +1 -1
- data/app/views/admin/variants/{new.html.erb → new.erb} +0 -0
- data/app/views/admin/zones/index.html.erb +2 -3
- data/app/views/checkout/_address.html.erb +2 -2
- data/app/views/layouts/admin.html.erb +0 -1
- data/app/views/products/_thumbnails.html.erb +2 -2
- data/app/views/shared/_admin_head.html.erb +5 -5
- data/app/views/shared/_order_details.html.erb +1 -1
- data/app/views/states/index.js.erb +1 -1
- data/config/initializers/spree.rb +2 -0
- data/config/locales/en.yml +12 -9
- data/config/routes.rb +2 -6
- data/lib/scopes/product.rb +5 -8
- data/lib/spree/preference_access.rb +2 -2
- data/lib/spree_base.rb +1 -1
- data/lib/spree_core.rb +1 -1
- data/lib/spree_core/action_callbacks.rb +26 -0
- data/lib/spree_core/version.rb +1 -1
- data/lib/tasks/taxon.rake +1 -1
- data/public/javascripts/admin.js +0 -6
- data/public/javascripts/admin/address_states.js +5 -5
- data/public/javascripts/application.js +2 -2
- data/public/stylesheets/admin/admin.css +0 -29
- data/public/stylesheets/screen.css +1 -0
- metadata +97 -79
- data/app/models/spree/alert.rb +0 -13
- data/app/views/account/login.html.erb +0 -4
- data/app/views/admin/configurations/new.html.erb +0 -13
- data/app/views/admin/payments/_card_form.html.erb +0 -49
- data/app/views/admin/shared/_alert.html.erb +0 -6
- data/lib/spree_core/find_by_param.rb +0 -119
@@ -0,0 +1,221 @@
|
|
1
|
+
require 'spree_core/action_callbacks'
|
2
|
+
class Admin::ResourceController < Admin::BaseController
|
3
|
+
helper_method :new_object_url, :edit_object_url, :object_url, :collection_url
|
4
|
+
before_filter :load_resource
|
5
|
+
|
6
|
+
respond_to :html
|
7
|
+
|
8
|
+
def new
|
9
|
+
render :layout => !request.xhr?
|
10
|
+
end
|
11
|
+
|
12
|
+
def edit
|
13
|
+
render :layout => !request.xhr?
|
14
|
+
end
|
15
|
+
|
16
|
+
def update
|
17
|
+
invoke_callbacks(:update, :before)
|
18
|
+
if @object.update_attributes(params[object_name])
|
19
|
+
invoke_callbacks(:update, :after)
|
20
|
+
resource_desc = I18n.t(object_name)
|
21
|
+
resource_desc += " \"#{@object.name}\"" if @object.respond_to?(:name)
|
22
|
+
flash[:notice] = I18n.t(:successfully_updated, :resource => resource_desc)
|
23
|
+
respond_to do |format|
|
24
|
+
format.html { redirect_to location_after_save }
|
25
|
+
format.js { render :layout => false }
|
26
|
+
end
|
27
|
+
else
|
28
|
+
invoke_callbacks(:update, :fails)
|
29
|
+
render :edit
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def create
|
34
|
+
invoke_callbacks(:create, :before)
|
35
|
+
if @object.save
|
36
|
+
invoke_callbacks(:create, :after)
|
37
|
+
resource_desc = I18n.t(object_name)
|
38
|
+
resource_desc += " \"#{@object.name}\"" if @object.respond_to?(:name)
|
39
|
+
flash[:notice] = I18n.t(:successfully_created, :resource => resource_desc)
|
40
|
+
respond_to do |format|
|
41
|
+
format.html { redirect_to location_after_save }
|
42
|
+
format.js { render :layout => false }
|
43
|
+
end
|
44
|
+
else
|
45
|
+
invoke_callbacks(:create, :fails)
|
46
|
+
render :new
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def destroy
|
51
|
+
invoke_callbacks(:destroy, :before)
|
52
|
+
if @object.destroy
|
53
|
+
invoke_callbacks(:destroy, :after)
|
54
|
+
resource_desc = I18n.t(object_name)
|
55
|
+
resource_desc += " \"#{@object.name}\"" if @object.respond_to?(:name)
|
56
|
+
flash[:notice] = I18n.t(:successfully_removed, :resource => resource_desc)
|
57
|
+
respond_to do |format|
|
58
|
+
format.html { redirect_to collection_url }
|
59
|
+
format.js { render :partial => "/admin/shared/destroy" }
|
60
|
+
end
|
61
|
+
else
|
62
|
+
invoke_callbacks(:destroy, :fails)
|
63
|
+
redirect_to collection_url
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
protected
|
68
|
+
|
69
|
+
class << self
|
70
|
+
attr_accessor :parent_data
|
71
|
+
attr_accessor :callbacks
|
72
|
+
|
73
|
+
def belongs_to(model_name, options = {})
|
74
|
+
@parent_data ||= {}
|
75
|
+
@parent_data[:model_name] = model_name
|
76
|
+
@parent_data[:model_class] = model_name.to_s.classify.constantize
|
77
|
+
@parent_data[:find_by] = options[:find_by] || :id
|
78
|
+
end
|
79
|
+
|
80
|
+
def create
|
81
|
+
@callbacks ||= {}
|
82
|
+
@callbacks[:create] ||= Spree::ActionCallbacks.new
|
83
|
+
end
|
84
|
+
|
85
|
+
def update
|
86
|
+
@callbacks ||= {}
|
87
|
+
@callbacks[:update] ||= Spree::ActionCallbacks.new
|
88
|
+
end
|
89
|
+
|
90
|
+
def destroy
|
91
|
+
@callbacks ||= {}
|
92
|
+
@callbacks[:destroy] ||= Spree::ActionCallbacks.new
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
def model_class
|
97
|
+
controller_name.classify.constantize
|
98
|
+
end
|
99
|
+
|
100
|
+
def object_name
|
101
|
+
controller_name.singularize
|
102
|
+
end
|
103
|
+
|
104
|
+
def load_resource
|
105
|
+
if member_action?
|
106
|
+
@object ||= load_resource_instance
|
107
|
+
instance_variable_set("@#{object_name}", @object)
|
108
|
+
else
|
109
|
+
@collection ||= collection
|
110
|
+
instance_variable_set("@#{controller_name}", @collection)
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
def load_resource_instance
|
115
|
+
if new_actions.include?(params[:action].to_sym)
|
116
|
+
build_resource
|
117
|
+
elsif params[:id]
|
118
|
+
find_resource
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
def parent_data
|
123
|
+
self.class.parent_data
|
124
|
+
end
|
125
|
+
|
126
|
+
def parent
|
127
|
+
if parent_data.present?
|
128
|
+
@parent ||= parent_data[:model_class].where(parent_data[:find_by] => params["#{parent_data[:model_name]}_id"]).first
|
129
|
+
instance_variable_set("@#{parent_data[:model_name]}", @parent)
|
130
|
+
else
|
131
|
+
nil
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
def find_resource
|
136
|
+
if parent_data.present?
|
137
|
+
parent.send(controller_name).find(params[:id])
|
138
|
+
else
|
139
|
+
model_class.find(params[:id])
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
def build_resource
|
144
|
+
if parent_data.present?
|
145
|
+
parent.send(controller_name).build(params[object_name])
|
146
|
+
else
|
147
|
+
model_class.new(params[object_name])
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
def collection
|
152
|
+
return parent.send(controller_name) if parent_data.present?
|
153
|
+
|
154
|
+
if model_class.respond_to?(:accessible_by) && !current_ability.has_block?(params[:action], model_class)
|
155
|
+
model_class.accessible_by(current_ability)
|
156
|
+
else
|
157
|
+
model_class.scoped
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
def location_after_save
|
162
|
+
collection_url
|
163
|
+
end
|
164
|
+
|
165
|
+
def invoke_callbacks(action, callback_type)
|
166
|
+
callbacks = self.class.callbacks || {}
|
167
|
+
return if callbacks[action].nil?
|
168
|
+
case callback_type.to_sym
|
169
|
+
when :before then callbacks[action].before_methods.each {|method| send method }
|
170
|
+
when :after then callbacks[action].after_methods.each {|method| send method }
|
171
|
+
when :fails then callbacks[action].fails_methods.each {|method| send method }
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
# URL helpers
|
176
|
+
|
177
|
+
def new_object_url(options = {})
|
178
|
+
if parent_data.present?
|
179
|
+
new_polymorphic_url([:admin, parent, model_class], options)
|
180
|
+
else
|
181
|
+
new_polymorphic_url([:admin, model_class], options)
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
def edit_object_url(object, options = {})
|
186
|
+
if parent_data.present?
|
187
|
+
send "edit_admin_#{parent_data[:model_name]}_#{object_name}_url", parent, object, options
|
188
|
+
else
|
189
|
+
send "edit_admin_#{object_name}_url", object, options
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
def object_url(object = nil, options = {})
|
194
|
+
target = object ? object : @object
|
195
|
+
if parent_data.present?
|
196
|
+
send "admin_#{parent_data[:model_name]}_#{object_name}_url", parent, target, options
|
197
|
+
else
|
198
|
+
send "admin_#{object_name}_url", target, options
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
def collection_url(options = {})
|
203
|
+
if parent_data.present?
|
204
|
+
polymorphic_url([:admin, parent, model_class], options)
|
205
|
+
else
|
206
|
+
polymorphic_url([:admin, model_class], options)
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
def collection_actions
|
211
|
+
[:index]
|
212
|
+
end
|
213
|
+
|
214
|
+
def member_action?
|
215
|
+
!collection_actions.include? params[:action].to_sym
|
216
|
+
end
|
217
|
+
|
218
|
+
def new_actions
|
219
|
+
[:new, :create]
|
220
|
+
end
|
221
|
+
end
|
@@ -1,22 +1,16 @@
|
|
1
|
-
class Admin::ReturnAuthorizationsController < Admin::
|
2
|
-
|
3
|
-
belongs_to :order
|
4
|
-
|
5
|
-
update.wants.html { redirect_to collection_url }
|
6
|
-
create.wants.html { redirect_to collection_url }
|
7
|
-
destroy.success.wants.js { render_js_for_destroy }
|
1
|
+
class Admin::ReturnAuthorizationsController < Admin::ResourceController
|
2
|
+
belongs_to :order, :find_by => :number
|
8
3
|
|
9
4
|
update.after :associate_inventory_units
|
10
5
|
create.after :associate_inventory_units
|
11
6
|
|
12
7
|
def fire
|
13
|
-
load_object
|
14
8
|
@return_authorization.send("#{params[:e]}!")
|
15
9
|
flash.notice = t('return_authorization_updated')
|
16
10
|
redirect_to :back
|
17
11
|
end
|
18
12
|
|
19
|
-
|
13
|
+
protected
|
20
14
|
def associate_inventory_units
|
21
15
|
params[:return_quantity].each { |variant_id, qty| @return_authorization.add_variant(variant_id.to_i, qty.to_i) }
|
22
16
|
end
|
@@ -1,29 +1,65 @@
|
|
1
1
|
class Admin::ShipmentsController < Admin::BaseController
|
2
|
-
before_filter :
|
2
|
+
before_filter :load_order
|
3
|
+
before_filter :load_shipment, :only => [:destroy, :edit, :update, :fire]
|
4
|
+
before_filter :load_shipping_methods, :except => [:country_changed, :index]
|
3
5
|
|
4
|
-
|
5
|
-
belongs_to :order
|
6
|
+
respond_to :html
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
else
|
11
|
-
redirect_to admin_order_adjustments_url(@order)
|
12
|
-
end
|
8
|
+
def index
|
9
|
+
@shipments = @order.shipments
|
10
|
+
respond_with(@shipments)
|
13
11
|
end
|
14
12
|
|
15
|
-
|
16
|
-
|
13
|
+
def new
|
14
|
+
build_shipment
|
15
|
+
@shipment.address ||= @order.ship_address
|
16
|
+
@shipment.address ||= Address.new(:country_id => Spree::Config[:default_country_id])
|
17
|
+
@shipment.shipping_method = @order.shipping_method
|
18
|
+
respond_with(@shipment)
|
17
19
|
end
|
18
20
|
|
19
|
-
|
21
|
+
def create
|
22
|
+
build_shipment
|
23
|
+
assign_inventory_units
|
24
|
+
if @shipment.save
|
25
|
+
flash[:notice] = I18n.t(:successfully_created, :resource => 'shipment')
|
26
|
+
respond_with(@object) do |format|
|
27
|
+
format.html { redirect_to edit_admin_order_shipment_path(@order, @shipment) }
|
28
|
+
end
|
29
|
+
else
|
30
|
+
render :action => 'new'
|
31
|
+
end
|
32
|
+
end
|
20
33
|
|
21
|
-
|
22
|
-
|
34
|
+
def edit
|
35
|
+
@shipment.special_instructions = @order.special_instructions
|
36
|
+
respond_with(@shipment)
|
37
|
+
end
|
23
38
|
|
24
|
-
|
39
|
+
def update
|
40
|
+
assign_inventory_units
|
41
|
+
if @shipment.update_attributes params[:shipment]
|
42
|
+
# copy back to order if instructions are enabled
|
43
|
+
@order.special_instructions = object_params[:special_instructions] if Spree::Config[:shipping_instructions]
|
44
|
+
@order.shipping_method = @order.shipment.shipping_method
|
45
|
+
@order.save
|
46
|
+
|
47
|
+
flash[:notice] = I18n.t(:successfully_updated, :resource => I18n.t('shipment'))
|
48
|
+
return_path = @order.completed? ? edit_admin_order_shipment_path(@order, @shipment) : admin_order_adjustments_path(@order)
|
49
|
+
respond_with(@object) do |format|
|
50
|
+
format.html { redirect_to return_path }
|
51
|
+
end
|
52
|
+
else
|
53
|
+
render :action => 'edit'
|
54
|
+
end
|
55
|
+
end
|
25
56
|
|
26
|
-
destroy
|
57
|
+
def destroy
|
58
|
+
@shipment.destroy
|
59
|
+
respond_to do |format|
|
60
|
+
format.js { render_js_for_destroy }
|
61
|
+
end
|
62
|
+
end
|
27
63
|
|
28
64
|
def fire
|
29
65
|
if @shipment.send("#{params[:e]}")
|
@@ -35,33 +71,30 @@ class Admin::ShipmentsController < Admin::BaseController
|
|
35
71
|
end
|
36
72
|
|
37
73
|
private
|
38
|
-
def build_object
|
39
|
-
@object ||= end_of_association_chain.send parent? ? :build : :new
|
40
|
-
@object.address ||= @order.ship_address
|
41
|
-
@object.address ||= Address.new(:country_id => Spree::Config[:default_country_id])
|
42
|
-
@object.shipping_method ||= @order.shipping_method
|
43
|
-
@object.attributes = object_params
|
44
|
-
@object
|
45
|
-
end
|
46
74
|
|
47
|
-
def
|
48
|
-
load_object
|
75
|
+
def load_shipping_methods
|
49
76
|
@shipping_methods = ShippingMethod.all_available(@order, :back_end)
|
50
77
|
end
|
51
78
|
|
52
|
-
def
|
53
|
-
|
79
|
+
def assign_inventory_units
|
80
|
+
return unless params.has_key? :inventory_units
|
81
|
+
@shipment.inventory_unit_ids = params[:inventory_units].keys
|
54
82
|
end
|
55
83
|
|
56
|
-
def
|
57
|
-
@order
|
58
|
-
@order.shipping_method = @order.shipment.shipping_method
|
59
|
-
@order.save
|
84
|
+
def load_order
|
85
|
+
@order = Order.find_by_number(params[:order_id])
|
60
86
|
end
|
61
87
|
|
62
|
-
def
|
63
|
-
|
64
|
-
|
88
|
+
def load_shipment
|
89
|
+
@shipment = Shipment.find_by_number(params[:id])
|
90
|
+
end
|
91
|
+
|
92
|
+
def build_shipment
|
93
|
+
@shipment = @order.shipments.build
|
94
|
+
@shipment.address ||= @order.ship_address
|
95
|
+
@shipment.address ||= Address.new(:country_id => Spree::Config[:default_country_id])
|
96
|
+
@shipment.shipping_method ||= @order.shipping_method
|
97
|
+
@shipment.attributes = params[:shipment]
|
65
98
|
end
|
66
99
|
|
67
100
|
end
|
@@ -1,16 +1,2 @@
|
|
1
|
-
class Admin::ShippingCategoriesController < Admin::
|
2
|
-
resource_controller
|
3
|
-
|
4
|
-
layout 'admin'
|
5
|
-
|
6
|
-
update.response do |wants|
|
7
|
-
wants.html { redirect_to collection_url }
|
8
|
-
end
|
9
|
-
|
10
|
-
create.response do |wants|
|
11
|
-
wants.html { redirect_to collection_url }
|
12
|
-
end
|
13
|
-
|
14
|
-
destroy.success.wants.js { render_js_for_destroy }
|
15
|
-
|
1
|
+
class Admin::ShippingCategoriesController < Admin::ResourceController
|
16
2
|
end
|
@@ -1,20 +1,14 @@
|
|
1
|
-
class Admin::ShippingMethodsController < Admin::
|
2
|
-
|
3
|
-
before_filter :load_data
|
4
|
-
|
5
|
-
update.wants.html { redirect_to edit_object_url }
|
6
|
-
create.wants.html { redirect_to edit_object_url }
|
7
|
-
destroy.success.wants.js { render_js_for_destroy }
|
1
|
+
class Admin::ShippingMethodsController < Admin::ResourceController
|
2
|
+
before_filter :load_data, :except => [:index]
|
8
3
|
|
9
4
|
private
|
10
|
-
|
11
|
-
|
12
|
-
@
|
13
|
-
@object
|
5
|
+
|
6
|
+
def location_after_save
|
7
|
+
edit_admin_shipping_method_path(@shipping_method)
|
14
8
|
end
|
15
9
|
|
16
10
|
def load_data
|
17
11
|
@available_zones = Zone.order(:name)
|
18
|
-
@calculators = ShippingMethod.calculators.sort_by(&:
|
12
|
+
@calculators = ShippingMethod.calculators.sort_by(&:name)
|
19
13
|
end
|
20
14
|
end
|
@@ -1,30 +1,25 @@
|
|
1
|
-
class Admin::StatesController < Admin::
|
2
|
-
resource_controller
|
3
|
-
|
1
|
+
class Admin::StatesController < Admin::ResourceController
|
4
2
|
belongs_to :country
|
5
3
|
before_filter :load_data
|
6
4
|
|
7
|
-
index
|
8
|
-
|
9
|
-
|
10
|
-
render :partial => 'state_list.html.erb'
|
5
|
+
def index
|
6
|
+
respond_to do |format|
|
7
|
+
format.html
|
8
|
+
format.js { render :partial => 'state_list.html.erb' }
|
11
9
|
end
|
12
10
|
end
|
13
11
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
update.wants.html { redirect_to admin_country_states_url(@country) }
|
20
|
-
|
21
|
-
private
|
12
|
+
protected
|
13
|
+
|
14
|
+
def location_after_save
|
15
|
+
admin_country_states_url(@country)
|
16
|
+
end
|
22
17
|
|
23
|
-
|
24
|
-
|
25
|
-
|
18
|
+
def collection
|
19
|
+
super.order(:name)
|
20
|
+
end
|
26
21
|
|
27
|
-
|
28
|
-
|
29
|
-
|
22
|
+
def load_data
|
23
|
+
@countries = Country.order(:name)
|
24
|
+
end
|
30
25
|
end
|