[Git][noosfero/noosfero][api] 6 commits: Gemfile: organize API dependencies in a block

Antonio Terceiro gitlab at gitlab.com
Wed Jul 15 17:11:17 BRT 2015


Antonio Terceiro pushed to branch api at Noosfero / noosfero


Commits:
e7fa6348 by Antonio Terceiro at 2015-07-14T18:52:21Z
Gemfile: organize API dependencies in a block

- - - - -
eefb51d7 by Antonio Terceiro at 2015-07-14T18:54:46Z
Gemfile: remove unused API dependencies

- - - - -
4fbaaa68 by Leandro Nunes dos Santos at 2015-07-13T20:32:24Z
should load load community templates correctly

- - - - -
6fb823a9 by Leandro Nunes dos Santos at 2015-07-13T23:07:36Z
Plugin-PeopleBlock: load suggestions with suggested_profiles named scope

- - - - -
fe08fd63 by Antonio Terceiro at 2015-07-14T18:54:54Z
Merge branch 'master' into api

- - - - -
80b3f8bd by Antonio Terceiro at 2015-07-15T10:44:37Z
Gemfile: use latest grape version, and be opmistic

- - - - -


5 changed files:

- Gemfile
- plugins/people_block/lib/friends_block.rb
- plugins/people_block/test/functional/profile_controller_test.rb
- plugins/people_block/test/unit/friends_block_test.rb
- plugins/statistics/lib/statistics_block.rb


Changes:

=====================================
Gemfile
=====================================
--- a/Gemfile
+++ b/Gemfile
@@ -19,18 +19,14 @@ gem 'gettext',                  '~> 2.2.1', :require => false
 gem 'locale',                   '~> 2.0.5'
 gem 'whenever', :require => false
 gem 'eita-jrails', '~> 0.9.5', require: 'jrails'
-gem 'grape',                    '~> 0.11.0'
+
+# API dependencies
+gem 'grape',                    '~> 0.12'
 gem 'grape-entity'
-gem 'grape-swagger'
 gem 'grape_logging'
-gem 'api-pagination',           '~> 4.1.1'
 gem 'rack-cors'
 gem 'rack-contrib'
 
-
-# FIXME list here all actual dependencies (i.e. the ones in debian/control),
-# with their GEM names (not the Debian package names)
-
 # asset pipeline
 gem 'uglifier', '>= 1.0.3'
 gem 'sass-rails'


=====================================
plugins/people_block/lib/friends_block.rb
=====================================
--- a/plugins/people_block/lib/friends_block.rb
+++ b/plugins/people_block/lib/friends_block.rb
@@ -17,7 +17,7 @@ class FriendsBlock < PeopleBlockBase
   end
 
   def suggestions
-    owner.profile_suggestions.of_person.enabled.limit(3).includes(:suggestion)
+    owner.suggested_profiles.of_person.enabled.limit(3).includes(:suggestion)
   end
 
   def footer


=====================================
plugins/people_block/test/functional/profile_controller_test.rb
=====================================
--- a/plugins/people_block/test/functional/profile_controller_test.rb
+++ b/plugins/people_block/test/functional/profile_controller_test.rb
@@ -17,8 +17,8 @@ class ProfileControllerTest < ActionController::TestCase
     login_as(user.login)
     owner = user.person
 
-    suggestion1 = owner.profile_suggestions.create(:suggestion => fast_create(Person))
-    suggestion2 = owner.profile_suggestions.create(:suggestion => fast_create(Person))
+    suggestion1 = ProfileSuggestion.create!(:suggestion => fast_create(Person), :person => owner)
+    suggestion2 = ProfileSuggestion.create!(:suggestion => fast_create(Person), :person => owner)
 
     FriendsBlock.delete_all
     block = FriendsBlock.new


=====================================
plugins/people_block/test/unit/friends_block_test.rb
=====================================
--- a/plugins/people_block/test/unit/friends_block_test.rb
+++ b/plugins/people_block/test/unit/friends_block_test.rb
@@ -138,8 +138,8 @@ class FriendsBlockTest < ActionView::TestCase
 
   should 'list owner\'s friends suggestions' do
     owner = fast_create(Person)
-    suggestion1 = owner.profile_suggestions.create(:suggestion => fast_create(Person))
-    suggestion2 = owner.profile_suggestions.create(:suggestion => fast_create(Person))
+    suggestion1 = ProfileSuggestion.create!(:suggestion => fast_create(Person), :person => owner)
+    suggestion2 = ProfileSuggestion.create!(:suggestion => fast_create(Person), :person => owner)
 
     block = FriendsBlock.new
     block.stubs(:owner).returns(owner)


=====================================
plugins/statistics/lib/statistics_block.rb
=====================================
--- a/plugins/statistics/lib/statistics_block.rb
+++ b/plugins/statistics/lib/statistics_block.rb
@@ -61,7 +61,7 @@ class StatisticsBlock < Block
   end
 
   def templates
-    Community.templates(environment)
+    self.environment.community_templates
   end
 
   def is_template_counter_active? template_id



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/0702669bc8e4d0b418f4f815abdff534197766a2...80b3f8bd57282a04b1fc2cfaffab50e9d340920f
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150715/cc52b178/attachment.html>


More information about the Noosfero-dev mailing list