[Git][noosfero/noosfero][rails4] 6 commits: travis: fix ruby version

Bráulio Bhavamitra gitlab at gitlab.com
Sun Sep 13 10:02:27 BRT 2015


Bráulio Bhavamitra pushed to branch rails4 at Noosfero / noosfero


Commits:
190f639e by Braulio Bhavamitra at 2015-09-11T23:25:55Z
travis: fix ruby version

- - - - -
ab2d95ff by Braulio Bhavamitra at 2015-09-12T11:39:32Z
rails4: simbolize keys on full hash assign

- - - - -
b3d6f944 by Braulio Bhavamitra at 2015-09-13T07:50:18Z
rails4: fix asset pipeline use

- - - - -
0bb637b2 by Braulio Bhavamitra at 2015-09-13T07:51:42Z
rails4: rename remaining old named_scope

- - - - -
41f821e8 by Braulio Bhavamitra at 2015-09-13T08:40:52Z
rails4: fix more redirect_to params error

- - - - -
b71858da by Braulio Bhavamitra at 2015-09-13T09:29:49Z
rails4: remove silencers from backtrace_cleaner

- - - - -


15 changed files:

- .travis.yml
- app/controllers/my_profile/profile_editor_controller.rb
- app/controllers/public/account_controller.rb
- app/controllers/public/search_controller.rb
- config/initializers/exception_notification.rb
- lib/acts_as_having_settings.rb
- plugins/bsc/lib/bsc_plugin/contract.rb
- plugins/bsc/lib/bsc_plugin/ext/enterprise.rb
- plugins/shopping_cart/views/shopping_cart_plugin/buy.html.erb
- plugins/shopping_cart/views/shopping_cart_plugin_myprofile/edit.html.erb
- plugins/stoa/lib/stoa_plugin.rb
- plugins/work_assignment/views/content_viewer/work_assignment.html.erb
- test/unit/category_test.rb
- test/unit/person_test.rb
- test/unit/task_test.rb


Changes:

=====================================
.travis.yml
=====================================
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,7 +19,7 @@ addons:
 
 # workaround for https://github.com/travis-ci/travis-ci/issues/4536
 before_install:
-  - export GEM_HOME=$PWD/vendor/bundle/ruby/2.1.0
+  - export GEM_HOME=$PWD/vendor/bundle/ruby/2.2.0
   - gem install bundler
 cache: bundler
 


=====================================
app/controllers/my_profile/profile_editor_controller.rb
=====================================
--- a/app/controllers/my_profile/profile_editor_controller.rb
+++ b/app/controllers/my_profile/profile_editor_controller.rb
@@ -80,7 +80,7 @@ class ProfileEditorController < MyProfileController
       if @profile.destroy
         session[:notice] = _('The profile was deleted.')
         if(params[:return_to])
-          redirect_to params[:return_to]
+          redirect_to url_for(params[:return_to])
         else
           redirect_to :controller => 'home'
         end


=====================================
app/controllers/public/account_controller.rb
=====================================
--- a/app/controllers/public/account_controller.rb
+++ b/app/controllers/public/account_controller.rb
@@ -426,7 +426,7 @@ class AccountController < ApplicationController
 
   def go_to_initial_page
     if params[:return_to]
-      redirect_to params[:return_to]
+      redirect_to url_for(params[:return_to])
     elsif environment.enabled?('allow_change_of_redirection_after_login')
       check_redirection_options(user, user.preferred_login_redirection, user.admin_url)
     else


=====================================
app/controllers/public/search_controller.rb
=====================================
--- a/app/controllers/public/search_controller.rb
+++ b/app/controllers/public/search_controller.rb
@@ -14,7 +14,7 @@ class SearchController < PublicController
   # Backwards compatibility with old URLs
   def redirect_asset_param
     return unless params.has_key?(:asset)
-    redirect_to params.merge(:action => params.delete(:asset))
+    redirect_to url_for(params.merge action: params.delete(:asset))
   end
 
   no_design_blocks


=====================================
config/initializers/exception_notification.rb
=====================================
--- a/config/initializers/exception_notification.rb
+++ b/config/initializers/exception_notification.rb
@@ -6,3 +6,7 @@ unless NOOSFERO_CONF['exception_recipients'].blank?
       :exception_recipients => NOOSFERO_CONF['exception_recipients']
     }
 end
+
+# show full backtrace
+Rails.backtrace_cleaner.remove_silencers!
+


=====================================
lib/acts_as_having_settings.rb
=====================================
--- a/lib/acts_as_having_settings.rb
+++ b/lib/acts_as_having_settings.rb
@@ -13,7 +13,9 @@ module ActiveRecord
     end
     class Hash < Value
       def cast_value value
-        ::Hash[value]
+        h = ::Hash[value]
+        h.symbolize_keys!
+        h
       end
     end
   end


=====================================
plugins/bsc/lib/bsc_plugin/contract.rb
=====================================
--- a/plugins/bsc/lib/bsc_plugin/contract.rb
+++ b/plugins/bsc/lib/bsc_plugin/contract.rb
@@ -8,8 +8,8 @@ class BscPlugin::Contract < ActiveRecord::Base
 
   belongs_to :bsc, :class_name => 'BscPlugin::Bsc'
 
-  named_scope :status, -> status_list { where 'status in (?)', status_list if status_list.present? }
-  named_scope :sorted_by, -> sorter, direction { order "#{sorter} #{direction}" }
+  scope :status, -> status_list { where 'status in (?)', status_list if status_list.present? }
+  scope :sorted_by, -> sorter, direction { order "#{sorter} #{direction}" }
 
   before_create do |contract|
     contract.created_at ||= Time.now.utc


=====================================
plugins/bsc/lib/bsc_plugin/ext/enterprise.rb
=====================================
--- a/plugins/bsc/lib/bsc_plugin/ext/enterprise.rb
+++ b/plugins/bsc/lib/bsc_plugin/ext/enterprise.rb
@@ -8,6 +8,6 @@ class Enterprise
   FIELDS << 'enabled'
   FIELDS << 'validated'
 
-  named_scope :validated, -> { where validated: true }
-  named_scope :not_validated, -> { where validated: false }
+  scope :validated, -> { where validated: true }
+  scope :not_validated, -> { where validated: false }
 end


=====================================
plugins/shopping_cart/views/shopping_cart_plugin/buy.html.erb
=====================================
--- a/plugins/shopping_cart/views/shopping_cart_plugin/buy.html.erb
+++ b/plugins/shopping_cart/views/shopping_cart_plugin/buy.html.erb
@@ -26,4 +26,4 @@
   <%= items_table(@cart[:items], @profile, delivery_option) %>
 </div>
 
-<%= javascript_include_tag '../plugins/shopping_cart/buy' %>
+<%= javascript_include_tag 'plugins/shopping_cart/buy' %>


=====================================
plugins/shopping_cart/views/shopping_cart_plugin_myprofile/edit.html.erb
=====================================
--- a/plugins/shopping_cart/views/shopping_cart_plugin_myprofile/edit.html.erb
+++ b/plugins/shopping_cart/views/shopping_cart_plugin_myprofile/edit.html.erb
@@ -44,4 +44,4 @@
   </div>
 <% end%>
 
-<%= javascript_include_tag '../plugins/shopping_cart/edit' %>
+<%= javascript_include_tag 'plugins/shopping_cart/edit' %>


=====================================
plugins/stoa/lib/stoa_plugin.rb
=====================================
--- a/plugins/stoa/lib/stoa_plugin.rb
+++ b/plugins/stoa/lib/stoa_plugin.rb
@@ -37,7 +37,7 @@ class StoaPlugin < Noosfero::Plugin
         content_tag('div', labelled_check_box(c_('Public'), '', '', false, :disabled => true, :title => _('This field must be private'), :class => 'disabled'), :class => 'field-privacy-selector'), :class => 'field-with-privacy-selector') +
         content_tag('div', required(labelled_form_field(_('Birth date (yyyy-mm-dd)'), text_field_tag('birth_date', ''))), :id => 'signup-birth-date', :style => 'display: none') +
         content_tag('div', required(labelled_form_field(_('CPF'), text_field_tag('cpf', ''))), :id => 'signup-cpf', :style => 'display:none') +
-        javascript_include_tag('../plugins/stoa/javascripts/jquery.observe_field', '../plugins/stoa/javascripts/signup_complement')
+        javascript_include_tag('plugins/stoa/javascripts/jquery.observe_field', 'plugins/stoa/javascripts/signup_complement')
       }
     end
   end


=====================================
plugins/work_assignment/views/content_viewer/work_assignment.html.erb
=====================================
--- a/plugins/work_assignment/views/content_viewer/work_assignment.html.erb
+++ b/plugins/work_assignment/views/content_viewer/work_assignment.html.erb
@@ -7,4 +7,4 @@
 
 <%= display_submissions(@page, user) %>
 
-<%= javascript_include_tag '../plugins/work_assignment/show_versions' %>
+<%= javascript_include_tag 'plugins/work_assignment/show_versions' %>


=====================================
test/unit/category_test.rb
=====================================
--- a/test/unit/category_test.rb
+++ b/test/unit/category_test.rb
@@ -497,7 +497,7 @@ class CategoryTest < ActiveSupport::TestCase
     assert_includes Category.on_level(c3), c6
   end
 
-  should 'on level named_scope must be able to receive parent or parent_id' do
+  should 'on level scope must be able to receive parent or parent_id' do
     parent = fast_create(Category)
     category = fast_create(Category, :parent_id => parent)
 


=====================================
test/unit/person_test.rb
=====================================
--- a/test/unit/person_test.rb
+++ b/test/unit/person_test.rb
@@ -1372,7 +1372,7 @@ class PersonTest < ActiveSupport::TestCase
     assert_includes non_abusers, not_abuser
   end
 
-  should 'admins named_scope return persons who are admin users' do
+  should 'admins scope return persons who are admin users' do
     Person.delete_all
     e = Environment.default
     admins = []
@@ -1387,7 +1387,7 @@ class PersonTest < ActiveSupport::TestCase
     assert_equivalent admins, Person.admins
   end
 
-  should 'activated named_scope return persons who are activated users' do
+  should 'activated scope return persons who are activated users' do
     Person.delete_all
     e = Environment.default
     activated = []
@@ -1403,7 +1403,7 @@ class PersonTest < ActiveSupport::TestCase
     assert_equivalent activated, Person.activated
   end
 
-  should 'deactivated named_scope return persons who are deactivated users' do
+  should 'deactivated scope return persons who are deactivated users' do
     Person.delete_all
     e = Environment.default
     deactivated = []


=====================================
test/unit/task_test.rb
=====================================
--- a/test/unit/task_test.rb
+++ b/test/unit/task_test.rb
@@ -317,7 +317,7 @@ class TaskTest < ActiveSupport::TestCase
     assert_includes Task.to(another_person), t4
   end
 
-  should 'filter tasks by type with named_scope' do
+  should 'filter tasks by type with scope' do
     class CleanHouse < Task; end
     class FeedDog < Task; end
     requestor = fast_create(Person)



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/df51a028c8f75152f21f4a3bb46f666ac3566e4d...b71858da889cf79ea0a95faebab89bd95be81912
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150913/2ed4d1d1/attachment-0001.html>


More information about the Noosfero-dev mailing list