Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 4.1.1 #415

Merged
merged 4 commits into from
Jun 10, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source 'https://rubygems.org'
ruby '2.0.0'

gem 'rails', '~> 4.0.5'
gem 'rails', '~> 4.1.1'

gem 'magiconf'
gem 'omniauth'
Expand Down Expand Up @@ -56,7 +56,7 @@ group :test do
gem 'capybara'
gem 'factory_girl'
gem 'poltergeist'
gem 'shoulda-matchers'
gem 'shoulda-matchers', github: 'thoughtbot/shoulda-matchers', ref: '380d18f0621c66a79445ebc6dcc0048fcc969911'
gem 'database_cleaner'
gem 'vcr', require: false
gem 'webmock', require: false
Expand Down
99 changes: 55 additions & 44 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ GIT
octokit (3.0.0)
sawyer (~> 0.5.3)

GIT
remote: git://github.com/thoughtbot/shoulda-matchers.git
revision: 380d18f0621c66a79445ebc6dcc0048fcc969911
ref: 380d18f0621c66a79445ebc6dcc0048fcc969911
specs:
shoulda-matchers (2.6.1)
activesupport (>= 3.0.0)

GIT
remote: git://github.com/tobiassvn/sidetiq.git
revision: 4f7d7daea3873443b17bf2f3da61619532bbeba2
Expand All @@ -26,35 +34,37 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.0.5)
actionpack (= 4.0.5)
actionmailer (4.1.1)
actionpack (= 4.1.1)
actionview (= 4.1.1)
mail (~> 2.5.4)
actionpack (4.0.5)
activesupport (= 4.0.5)
builder (~> 3.1.0)
erubis (~> 2.7.0)
actionpack (4.1.1)
actionview (= 4.1.1)
activesupport (= 4.1.1)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
activemodel (4.0.5)
activesupport (= 4.0.5)
builder (~> 3.1.0)
activerecord (4.0.5)
activemodel (= 4.0.5)
activerecord-deprecated_finders (~> 1.0.2)
activesupport (= 4.0.5)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.3)
activesupport (4.0.5)
actionview (4.1.1)
activesupport (= 4.1.1)
builder (~> 3.1)
erubis (~> 2.7.0)
activemodel (4.1.1)
activesupport (= 4.1.1)
builder (~> 3.1)
activerecord (4.1.1)
activemodel (= 4.1.1)
activesupport (= 4.1.1)
arel (~> 5.0.0)
activesupport (4.1.1)
i18n (~> 0.6, >= 0.6.9)
minitest (~> 4.2)
multi_json (~> 1.3)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
tzinfo (~> 1.1)
addressable (2.3.6)
analytics-ruby (1.0.0)
and_feathers (1.0.0.pre.1)
and_feathers-gzipped_tarball (1.0.0.pre)
arel (4.0.2)
arel (5.0.1.20140414130214)
ast (1.1.0)
aws-sdk (1.38.0)
json (~> 1.4)
Expand All @@ -64,7 +74,7 @@ GEM
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
builder (3.1.4)
builder (3.2.2)
byebug (2.7.0)
columnize (~> 0.3)
debugger-linecache (~> 1.2)
Expand Down Expand Up @@ -153,7 +163,7 @@ GEM
highline (1.6.21)
hike (1.2.3)
htmlentities (4.3.1)
httparty (0.13.0)
httparty (0.13.1)
json (~> 1.8)
multi_xml (>= 0.5.2)
i18n (0.6.9)
Expand All @@ -172,7 +182,7 @@ GEM
kgio (2.9.2)
launchy (2.4.2)
addressable (~> 2.3)
license_finder (1.0.0.0)
license_finder (1.1.0)
bundler
httparty
sequel
Expand All @@ -188,15 +198,15 @@ GEM
method_source (0.8.2)
mime-types (1.25.1)
mini_portile (0.6.0)
minitest (4.7.5)
minitest (5.3.4)
mixlib-authentication (1.3.0)
mixlib-log
mixlib-cli (1.4.0)
mixlib-config (2.1.0)
mixlib-log (1.6.0)
mixlib-shellout (1.3.0)
moneta (0.6.0)
multi_json (1.10.0)
multi_json (1.10.1)
multi_xml (0.5.5)
multipart-post (2.0.0)
net-ssh (2.8.0)
Expand Down Expand Up @@ -251,7 +261,7 @@ GEM
cliver (~> 0.3.1)
multi_json (~> 1.0)
websocket-driver (>= 0.2.0)
polyglot (0.3.4)
polyglot (0.3.5)
powerpack (0.0.9)
premailer (1.8.2)
css_parser (>= 1.3.5)
Expand All @@ -272,17 +282,19 @@ GEM
rack (1.5.2)
rack-test (0.6.2)
rack (>= 1.0)
rails (4.0.5)
actionmailer (= 4.0.5)
actionpack (= 4.0.5)
activerecord (= 4.0.5)
activesupport (= 4.0.5)
rails (4.1.1)
actionmailer (= 4.1.1)
actionpack (= 4.1.1)
actionview (= 4.1.1)
activemodel (= 4.1.1)
activerecord (= 4.1.1)
activesupport (= 4.1.1)
bundler (>= 1.3.0, < 2.0)
railties (= 4.0.5)
sprockets-rails (~> 2.0.0)
railties (4.0.5)
actionpack (= 4.0.5)
activesupport (= 4.0.5)
railties (= 4.1.1)
sprockets-rails (~> 2.0)
railties (4.1.1)
actionpack (= 4.1.1)
activesupport (= 4.1.1)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (2.0.0)
Expand Down Expand Up @@ -328,9 +340,7 @@ GEM
faraday (>= 0.7.6)
hashie (>= 1.1.0)
uuidtools
sequel (4.9.0)
shoulda-matchers (2.5.0)
activesupport (>= 3.0.0)
sequel (4.11.0)
sidekiq (3.0.0)
celluloid (>= 0.15.2)
connection_pool (>= 2.0.0)
Expand All @@ -353,7 +363,7 @@ GEM
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.0.1)
sprockets-rails (2.1.3)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (~> 2.8)
Expand All @@ -363,14 +373,15 @@ GEM
term-ansicolor (1.3.0)
tins (~> 1.0)
thor (0.19.1)
thread_safe (0.3.3)
thread_safe (0.3.4)
tilt (1.4.1)
timers (1.1.0)
tins (1.1.0)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.39)
tzinfo (1.2.1)
thread_safe (~> 0.1)
uglifier (2.5.0)
execjs (>= 0.3.0)
json (>= 1.8.0)
Expand Down Expand Up @@ -438,14 +449,14 @@ DEPENDENCIES
premailer-rails
pundit
quiet_assets
rails (~> 4.0.5)
rails (~> 4.1.1)
redcarpet
rspec-rails
rubocop
sass-rails (~> 4.0.1)
semverse
sentry-raven (~> 0.8.0)
shoulda-matchers
shoulda-matchers!
sidekiq
sidetiq!
sitemap_generator
Expand Down
8 changes: 3 additions & 5 deletions app/assets/stylesheets/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,9 @@ O Generic
*/
@font-face {
font-family: "platform_icons";
src: url(image-path('platform_icons.ttf'));
src: url(image-path('platform_icons?#iefix')) format('embedded-opentype'),
url(image-path('platform_icons.woff')) format('woff'),
url(image-path('platform_icons.ttf')) format('truetype'),
url(image-path('platform_icons.svg#platform_icons')) format('svg');
src: url(asset-path('platform_icons.woff')) format('woff'),
url(asset-path('platform_icons.ttf')) format('truetype'),
url(asset-path('platform_icons.svg')) format('svg');
font-weight: normal;
font-style: normal;
}
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v1/cookbooks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ def search
@results = Cookbook.search(
params.fetch(:q, nil)
).offset(@start).limit(@items)

@total = @results.count(:all)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the (:all) is necessary, is it? Isn't that just an alias for *, which is the default for count?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a recent change to the count method it doesn't play nice with pg_search see this issue and this issue the recommendation seems to be to explicitly call count(:all) if you have any better suggestions let me know.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for enlightening me.

end

private
Expand Down
1 change: 1 addition & 0 deletions app/controllers/cookbooks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def index
@cookbooks = @cookbooks.search(params[:q])
end

@number_of_cookbooks = @cookbooks.count(:all)
@cookbooks = @cookbooks.page(params[:page]).per(20)

respond_to do |format|
Expand Down
2 changes: 1 addition & 1 deletion app/views/api/v1/cookbooks/search.json.jbuilder
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
json.start @start
json.total @results.count
json.total @total
json.items @results do |cookbook|
json.cookbook_name cookbook.name
json.cookbook_maintainer cookbook.maintainer
Expand Down
2 changes: 1 addition & 1 deletion app/views/application/_flash.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% flash.each do |name, msg| %>
<% if msg.is_a?(String) %>
<div data-alert class="alert-box <%= name == :notice ? "success" : "alert" %>">
<div data-alert class="alert-box <%= name == "notice" ? "success" : "alert" %>">
<%= content_tag :div, msg %>
<a href="#" class="close">&times;</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/cookbooks/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

</div>
<h1 class="cookbook_content_heading">
<%= pluralize(@cookbooks.count, 'Cookbook') %>
<%= pluralize(@number_of_cookbooks, 'Cookbook') %>
<small>
<%= link_to '<i class="fa fa-rss"></i> RSS'.html_safe, params.merge(format: 'atom'), :class => 'rss_feed_link show-for-medium-up' %>
</small>
Expand Down
28 changes: 14 additions & 14 deletions spec/authorizers/cla_signature_authorizer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@
context 'as an admin' do
let(:user) { build(:user, roles: 'admin') }

it { should permit(:index) }
it { should permit(:show) }
it { should permit(:create) }
it { should permit(:update) }
it { should permit(:destroy) }
it { should permit(:edit) }
it { should permit(:new) }
it { should permit_authorization(:index) }
it { should permit_authorization(:show) }
it { should permit_authorization(:create) }
it { should permit_authorization(:update) }
it { should permit_authorization(:destroy) }
it { should permit_authorization(:edit) }
it { should permit_authorization(:new) }
end

context 'as a user with a cla owned by said user' do
let(:user) { build(:user) }
let(:record) { build(:icla_signature, user: user) }

it { should permit(:index) }
it { should permit(:show) }
it { should permit(:create) }
it { should permit(:update) }
it { should permit(:destroy) }
it { should permit(:edit) }
it { should permit(:new) }
it { should permit_authorization(:index) }
it { should permit_authorization(:show) }
it { should permit_authorization(:create) }
it { should permit_authorization(:update) }
it { should permit_authorization(:destroy) }
it { should permit_authorization(:edit) }
it { should permit_authorization(:new) }
end
end
24 changes: 12 additions & 12 deletions spec/authorizers/cookbook_authorizer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

subject { described_class.new(user, record) }

it { should permit(:create) }
it { should permit(:destroy) }
it { should permit(:create_collaborator) }
it { should permit(:manage_cookbook_urls) }
it { should permit_authorization(:create) }
it { should permit_authorization(:destroy) }
it { should permit_authorization(:create_collaborator) }
it { should permit_authorization(:manage_cookbook_urls) }
end

context 'as a cookbook collaborator' do
Expand All @@ -23,20 +23,20 @@
create(:cookbook_collaborator, user: user, cookbook: record)
end

it { should_not permit(:create_collaborator) }
it { should_not permit(:destroy) }
it { should permit(:create) }
it { should permit(:manage_cookbook_urls) }
it { should_not permit_authorization(:create_collaborator) }
it { should_not permit_authorization(:destroy) }
it { should permit_authorization(:create) }
it { should permit_authorization(:manage_cookbook_urls) }
end

context 'as not the cookbook owner or a cookbook collaborator' do
let(:record) { build(:cookbook) }

subject { described_class.new(user, record) }

it { should_not permit(:create) }
it { should_not permit(:destroy) }
it { should_not permit(:create_collaborator) }
it { should_not permit(:manage_cookbook_urls) }
it { should_not permit_authorization(:create) }
it { should_not permit_authorization(:destroy) }
it { should_not permit_authorization(:create_collaborator) }
it { should_not permit_authorization(:manage_cookbook_urls) }
end
end
Loading