Update to Rails 4.1
This commit is contained in:
parent
acc8691487
commit
42b08e8ab8
17 changed files with 73 additions and 70 deletions
2
Gemfile
2
Gemfile
|
|
@ -1,6 +1,6 @@
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
gem 'rails', '4.0.9'
|
gem 'rails', '4.1.5'
|
||||||
|
|
||||||
# Legacy Rails features, remove me!
|
# Legacy Rails features, remove me!
|
||||||
|
|
||||||
|
|
|
||||||
71
Gemfile.lock
71
Gemfile.lock
|
|
@ -1,40 +1,42 @@
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actionmailer (4.0.9)
|
actionmailer (4.1.5)
|
||||||
actionpack (= 4.0.9)
|
actionpack (= 4.1.5)
|
||||||
|
actionview (= 4.1.5)
|
||||||
mail (~> 2.5.4)
|
mail (~> 2.5.4)
|
||||||
actionpack (4.0.9)
|
actionpack (4.1.5)
|
||||||
activesupport (= 4.0.9)
|
actionview (= 4.1.5)
|
||||||
builder (~> 3.1.0)
|
activesupport (= 4.1.5)
|
||||||
erubis (~> 2.7.0)
|
|
||||||
rack (~> 1.5.2)
|
rack (~> 1.5.2)
|
||||||
rack-test (~> 0.6.2)
|
rack-test (~> 0.6.2)
|
||||||
actionpack-action_caching (1.1.1)
|
actionpack-action_caching (1.1.1)
|
||||||
actionpack (>= 4.0.0, < 5.0)
|
actionpack (>= 4.0.0, < 5.0)
|
||||||
actionpack-page_caching (1.0.2)
|
actionpack-page_caching (1.0.2)
|
||||||
actionpack (>= 4.0.0, < 5)
|
actionpack (>= 4.0.0, < 5)
|
||||||
activemodel (4.0.9)
|
actionview (4.1.5)
|
||||||
activesupport (= 4.0.9)
|
activesupport (= 4.1.5)
|
||||||
builder (~> 3.1.0)
|
builder (~> 3.1)
|
||||||
activerecord (4.0.9)
|
erubis (~> 2.7.0)
|
||||||
activemodel (= 4.0.9)
|
activemodel (4.1.5)
|
||||||
activerecord-deprecated_finders (~> 1.0.2)
|
activesupport (= 4.1.5)
|
||||||
activesupport (= 4.0.9)
|
builder (~> 3.1)
|
||||||
arel (~> 4.0.0)
|
activerecord (4.1.5)
|
||||||
activerecord-deprecated_finders (1.0.3)
|
activemodel (= 4.1.5)
|
||||||
|
activesupport (= 4.1.5)
|
||||||
|
arel (~> 5.0.0)
|
||||||
activerecord-import (0.5.0)
|
activerecord-import (0.5.0)
|
||||||
activerecord (>= 3.0)
|
activerecord (>= 3.0)
|
||||||
activeresource (4.0.0)
|
activeresource (4.0.0)
|
||||||
activemodel (~> 4.0)
|
activemodel (~> 4.0)
|
||||||
activesupport (~> 4.0)
|
activesupport (~> 4.0)
|
||||||
rails-observers (~> 0.1.1)
|
rails-observers (~> 0.1.1)
|
||||||
activesupport (4.0.9)
|
activesupport (4.1.5)
|
||||||
i18n (~> 0.6, >= 0.6.9)
|
i18n (~> 0.6, >= 0.6.9)
|
||||||
minitest (~> 4.2)
|
json (~> 1.7, >= 1.7.7)
|
||||||
multi_json (~> 1.3)
|
minitest (~> 5.1)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
tzinfo (~> 0.3.37)
|
tzinfo (~> 1.1)
|
||||||
acts-as-taggable-on (3.2.6)
|
acts-as-taggable-on (3.2.6)
|
||||||
activerecord (>= 3, < 5)
|
activerecord (>= 3, < 5)
|
||||||
acts_as_api (0.4.2)
|
acts_as_api (0.4.2)
|
||||||
|
|
@ -42,7 +44,7 @@ GEM
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
rack (>= 1.1.0)
|
rack (>= 1.1.0)
|
||||||
addressable (2.3.6)
|
addressable (2.3.6)
|
||||||
arel (4.0.2)
|
arel (5.0.1.20140414130214)
|
||||||
asset_sync (1.0.0)
|
asset_sync (1.0.0)
|
||||||
activemodel
|
activemodel
|
||||||
fog (>= 1.8.0)
|
fog (>= 1.8.0)
|
||||||
|
|
@ -58,7 +60,7 @@ GEM
|
||||||
bcrypt (3.1.7)
|
bcrypt (3.1.7)
|
||||||
bootstrap-sass (2.3.2.2)
|
bootstrap-sass (2.3.2.2)
|
||||||
sass (~> 3.2)
|
sass (~> 3.2)
|
||||||
builder (3.1.4)
|
builder (3.2.2)
|
||||||
capybara (2.4.1)
|
capybara (2.4.1)
|
||||||
mime-types (>= 1.16)
|
mime-types (>= 1.16)
|
||||||
nokogiri (>= 1.3.3)
|
nokogiri (>= 1.3.3)
|
||||||
|
|
@ -254,7 +256,7 @@ GEM
|
||||||
mini_magick (3.7.0)
|
mini_magick (3.7.0)
|
||||||
subexec (~> 0.2.1)
|
subexec (~> 0.2.1)
|
||||||
mini_portile (0.5.3)
|
mini_portile (0.5.3)
|
||||||
minitest (4.7.5)
|
minitest (5.4.0)
|
||||||
mobile-fu (1.3.1)
|
mobile-fu (1.3.1)
|
||||||
rack-mobile-detect
|
rack-mobile-detect
|
||||||
rails
|
rails
|
||||||
|
|
@ -321,13 +323,15 @@ GEM
|
||||||
rack
|
rack
|
||||||
rack-test (0.6.2)
|
rack-test (0.6.2)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
rails (4.0.9)
|
rails (4.1.5)
|
||||||
actionmailer (= 4.0.9)
|
actionmailer (= 4.1.5)
|
||||||
actionpack (= 4.0.9)
|
actionpack (= 4.1.5)
|
||||||
activerecord (= 4.0.9)
|
actionview (= 4.1.5)
|
||||||
activesupport (= 4.0.9)
|
activemodel (= 4.1.5)
|
||||||
|
activerecord (= 4.1.5)
|
||||||
|
activesupport (= 4.1.5)
|
||||||
bundler (>= 1.3.0, < 2.0)
|
bundler (>= 1.3.0, < 2.0)
|
||||||
railties (= 4.0.9)
|
railties (= 4.1.5)
|
||||||
sprockets-rails (~> 2.0)
|
sprockets-rails (~> 2.0)
|
||||||
rails-i18n (4.0.2)
|
rails-i18n (4.0.2)
|
||||||
i18n (~> 0.6)
|
i18n (~> 0.6)
|
||||||
|
|
@ -353,9 +357,9 @@ GEM
|
||||||
sass-rails (~> 4.0)
|
sass-rails (~> 4.0)
|
||||||
rails_autolink (1.1.5)
|
rails_autolink (1.1.5)
|
||||||
rails (> 3.1)
|
rails (> 3.1)
|
||||||
railties (4.0.9)
|
railties (4.1.5)
|
||||||
actionpack (= 4.0.9)
|
actionpack (= 4.1.5)
|
||||||
activesupport (= 4.0.9)
|
activesupport (= 4.1.5)
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
thor (>= 0.18.1, < 2.0)
|
thor (>= 0.18.1, < 2.0)
|
||||||
raindrops (0.13.0)
|
raindrops (0.13.0)
|
||||||
|
|
@ -446,7 +450,8 @@ GEM
|
||||||
simple_oauth (~> 0.2)
|
simple_oauth (~> 0.2)
|
||||||
typhoeus (0.6.8)
|
typhoeus (0.6.8)
|
||||||
ethon (>= 0.7.0)
|
ethon (>= 0.7.0)
|
||||||
tzinfo (0.3.41)
|
tzinfo (1.2.2)
|
||||||
|
thread_safe (~> 0.1)
|
||||||
uglifier (2.5.0)
|
uglifier (2.5.0)
|
||||||
execjs (>= 0.3.0)
|
execjs (>= 0.3.0)
|
||||||
json (>= 1.8.0)
|
json (>= 1.8.0)
|
||||||
|
|
@ -528,7 +533,7 @@ DEPENDENCIES
|
||||||
rack-protection (= 1.2)
|
rack-protection (= 1.2)
|
||||||
rack-rewrite (= 1.5.0)
|
rack-rewrite (= 1.5.0)
|
||||||
rack-ssl (= 1.4.1)
|
rack-ssl (= 1.4.1)
|
||||||
rails (= 4.0.9)
|
rails (= 4.1.5)
|
||||||
rails-i18n (= 4.0.2)
|
rails-i18n (= 4.0.2)
|
||||||
rails-timeago (= 2.4.0)
|
rails-timeago (= 2.4.0)
|
||||||
rails_admin (= 0.6.2)
|
rails_admin (= 0.6.2)
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ class PeopleController < ApplicationController
|
||||||
@block = current_user.blocks.where(:person_id => @person.id).first
|
@block = current_user.blocks.where(:person_id => @person.id).first
|
||||||
@contact = current_user.contact_for(@person)
|
@contact = current_user.contact_for(@person)
|
||||||
if @contact && !params[:only_posts]
|
if @contact && !params[:only_posts]
|
||||||
@contacts_of_contact_count = @contact.contacts.count
|
@contacts_of_contact_count = @contact.contacts.count(:all)
|
||||||
@contacts_of_contact = @contact.contacts.limit(8)
|
@contacts_of_contact = @contact.contacts.limit(8)
|
||||||
else
|
else
|
||||||
@contact ||= Contact.new
|
@contact ||= Contact.new
|
||||||
|
|
@ -147,7 +147,7 @@ class PeopleController < ApplicationController
|
||||||
@contact = current_user.contact_for(@person)
|
@contact = current_user.contact_for(@person)
|
||||||
@aspect = :profile
|
@aspect = :profile
|
||||||
@contacts_of_contact = @contact.contacts.paginate(:page => params[:page], :per_page => (params[:limit] || 15))
|
@contacts_of_contact = @contact.contacts.paginate(:page => params[:page], :per_page => (params[:limit] || 15))
|
||||||
@contacts_of_contact_count = @contact.contacts.count
|
@contacts_of_contact_count = @contact.contacts.count(:all)
|
||||||
@hashes = hashes_for_people @contacts_of_contact, @aspects
|
@hashes = hashes_for_people @contacts_of_contact, @aspects
|
||||||
else
|
else
|
||||||
flash[:error] = I18n.t 'people.show.does_not_exist'
|
flash[:error] = I18n.t 'people.show.does_not_exist'
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ class PhotosController < ApplicationController
|
||||||
|
|
||||||
if @contact
|
if @contact
|
||||||
@contacts_of_contact = @contact.contacts
|
@contacts_of_contact = @contact.contacts
|
||||||
@contacts_of_contact_count = @contact.contacts.count
|
@contacts_of_contact_count = @contact.contacts.count(:all)
|
||||||
else
|
else
|
||||||
@contact = Contact.new
|
@contact = Contact.new
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ class Profile < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def receive(user, person)
|
def receive(user, person)
|
||||||
|
person.reload # make sure to have old profile referenced
|
||||||
Rails.logger.info("event=receive payload_type=profile sender=#{person} to=#{user}")
|
Rails.logger.info("event=receive payload_type=profile sender=#{person} to=#{user}")
|
||||||
profiles_attr = self.attributes.merge('tag_string' => self.tag_string).slice('diaspora_handle', 'first_name', 'last_name', 'image_url', 'image_url_small', 'image_url_medium', 'birthday', 'gender', 'bio', 'location', 'searchable', 'nsfw', 'tag_string')
|
profiles_attr = self.attributes.merge('tag_string' => self.tag_string).slice('diaspora_handle', 'first_name', 'last_name', 'image_url', 'image_url_small', 'image_url_medium', 'birthday', 'gender', 'bio', 'location', 'searchable', 'nsfw', 'tag_string')
|
||||||
person.profile.update_attributes(profiles_attr)
|
person.profile.update_attributes(profiles_attr)
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@
|
||||||
%h4
|
%h4
|
||||||
= t('.photos')
|
= t('.photos')
|
||||||
.item_count
|
.item_count
|
||||||
= "#{@photos.count}"
|
= "#{@photos.count(:all)}"
|
||||||
- @photos.limit(8).each do |photo|
|
- @photos.limit(8).each do |photo|
|
||||||
= image_tag(photo.url(:thumb_small))
|
= image_tag(photo.url(:thumb_small))
|
||||||
%br
|
%br
|
||||||
|
|
|
||||||
|
|
@ -16,18 +16,16 @@ class Postzord::Receiver::Private < Postzord::Receiver
|
||||||
end
|
end
|
||||||
|
|
||||||
def receive!
|
def receive!
|
||||||
begin
|
if @sender && self.salmon.verified_for_key?(@sender.public_key)
|
||||||
if @sender && self.salmon.verified_for_key?(@sender.public_key)
|
parse_and_receive(salmon.parsed_data)
|
||||||
parse_and_receive(salmon.parsed_data)
|
else
|
||||||
else
|
FEDERATION_LOGGER.info("event=receive status=abort recipient=#{@user.diaspora_handle} sender=#{@salmon.author_id} reason='not_verified for key'")
|
||||||
FEDERATION_LOGGER.info("event=receive status=abort recipient=#{@user.diaspora_handle} sender=#{@salmon.author_id} reason='not_verified for key'")
|
false
|
||||||
false
|
|
||||||
end
|
|
||||||
rescue => e
|
|
||||||
#this sucks
|
|
||||||
FEDERATION_LOGGER.error("Failure to receive #{@object.class} from sender:#{@sender.id} for user:#{@user.id}: #{e.message}\n#{@object.inspect}")
|
|
||||||
raise e
|
|
||||||
end
|
end
|
||||||
|
rescue => e
|
||||||
|
#this sucks
|
||||||
|
FEDERATION_LOGGER.error("Failure to receive #{@object.class} from sender:#{@sender.id} for user:#{@user.id}: #{e.message}\n#{@object.inspect}")
|
||||||
|
raise e
|
||||||
end
|
end
|
||||||
|
|
||||||
def parse_and_receive(xml)
|
def parse_and_receive(xml)
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ class Postzord::Receiver::Public < Postzord::Receiver
|
||||||
|
|
||||||
# @return [Array<Integer>] User ids
|
# @return [Array<Integer>] User ids
|
||||||
def recipient_user_ids
|
def recipient_user_ids
|
||||||
User.all_sharing_with_person(@author).select('users.id').map!{ |u| u.id }
|
User.all_sharing_with_person(@author).pluck('users.id')
|
||||||
end
|
end
|
||||||
|
|
||||||
def xml_author
|
def xml_author
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ describe AspectsController do
|
||||||
@alices_aspect_1.contacts_visible = false
|
@alices_aspect_1.contacts_visible = false
|
||||||
@alices_aspect_1.save
|
@alices_aspect_1.save
|
||||||
|
|
||||||
get :toggle_contact_visibility, :format => 'js', :aspect_id => @alices_aspect_1.id
|
xhr :get, :toggle_contact_visibility, :format => 'js', :aspect_id => @alices_aspect_1.id
|
||||||
@alices_aspect_1.reload.contacts_visible.should be_true
|
@alices_aspect_1.reload.contacts_visible.should be_true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -170,7 +170,7 @@ describe AspectsController do
|
||||||
@alices_aspect_1.contacts_visible = true
|
@alices_aspect_1.contacts_visible = true
|
||||||
@alices_aspect_1.save
|
@alices_aspect_1.save
|
||||||
|
|
||||||
get :toggle_contact_visibility, :format => 'js', :aspect_id => @alices_aspect_1.id
|
xhr :get, :toggle_contact_visibility, :format => 'js', :aspect_id => @alices_aspect_1.id
|
||||||
@alices_aspect_1.reload.contacts_visible.should be_false
|
@alices_aspect_1.reload.contacts_visible.should be_false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -261,7 +261,7 @@ describe ConversationsController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'succeeds with js' do
|
it 'succeeds with js' do
|
||||||
get :show, :id => @conversation.id, :format => :js
|
xhr :get, :show, :id => @conversation.id, :format => :js
|
||||||
response.should be_success
|
response.should be_success
|
||||||
assigns[:conversation].should == @conversation
|
assigns[:conversation].should == @conversation
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ describe PeopleController do
|
||||||
|
|
||||||
describe '#tag_index' do
|
describe '#tag_index' do
|
||||||
it 'works for js' do
|
it 'works for js' do
|
||||||
get :tag_index, :name => 'jellybeans', :format => :js
|
xhr :get, :tag_index, :name => 'jellybeans', :format => :js
|
||||||
response.should be_success
|
response.should be_success
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -126,7 +126,7 @@ describe PeopleController do
|
||||||
f = FactoryGirl.create(:person)
|
f = FactoryGirl.create(:person)
|
||||||
f.profile.tag_string = "#seeded"
|
f.profile.tag_string = "#seeded"
|
||||||
f.profile.save
|
f.profile.save
|
||||||
get :tag_index, :name => 'seeded', :format => :js
|
xhr :get, :tag_index, :name => 'seeded', :format => :js
|
||||||
assigns[:people].count.should == 1
|
assigns[:people].count.should == 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ describe PhotosController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'will let you delete your profile picture' do
|
it 'will let you delete your profile picture' do
|
||||||
get :make_profile_photo, :photo_id => @alices_photo.id, :format => :js
|
xhr :get, :make_profile_photo, :photo_id => @alices_photo.id, :format => :js
|
||||||
delete :destroy, :id => @alices_photo.id
|
delete :destroy, :id => @alices_photo.id
|
||||||
Photo.find_by_id(@alices_photo.id).should be_nil
|
Photo.find_by_id(@alices_photo.id).should be_nil
|
||||||
end
|
end
|
||||||
|
|
@ -182,7 +182,7 @@ describe PhotosController do
|
||||||
|
|
||||||
describe "#make_profile_photo" do
|
describe "#make_profile_photo" do
|
||||||
it 'should return a 201 on a js success' do
|
it 'should return a 201 on a js success' do
|
||||||
get :make_profile_photo, :photo_id => @alices_photo.id, :format => 'js'
|
xhr :get, :make_profile_photo, :photo_id => @alices_photo.id, :format => 'js'
|
||||||
response.code.should == "201"
|
response.code.should == "201"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -212,7 +212,7 @@ describe "attack vectors" do
|
||||||
expect {
|
expect {
|
||||||
receive_post(retraction, :from => alice, :by => bob)
|
receive_post(retraction, :from => alice, :by => bob)
|
||||||
}.to raise_error Diaspora::AuthorXMLAuthorMismatch
|
}.to raise_error Diaspora::AuthorXMLAuthorMismatch
|
||||||
}.to_not change(bob.visible_shareables(Post), :count)
|
}.to_not change { bob.visible_shareables(Post).count(:all) }
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ describe 'a user receives a post' do
|
||||||
bob.dispatch_post(sm, :to => @bobs_aspect)
|
bob.dispatch_post(sm, :to => @bobs_aspect)
|
||||||
end
|
end
|
||||||
|
|
||||||
alice.visible_shareables(Post).count.should == 1
|
alice.visible_shareables(Post).count(:all).should == 1
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with mentions, ' do
|
context 'with mentions, ' do
|
||||||
|
|
@ -362,7 +362,6 @@ describe 'a user receives a post' do
|
||||||
|
|
||||||
#Build xml for profile
|
#Build xml for profile
|
||||||
xml = new_profile.to_diaspora_xml
|
xml = new_profile.to_diaspora_xml
|
||||||
|
|
||||||
#Marshal profile
|
#Marshal profile
|
||||||
zord = Postzord::Receiver::Private.new(alice, :person => person)
|
zord = Postzord::Receiver::Private.new(alice, :person => person)
|
||||||
zord.parse_and_receive(xml)
|
zord.parse_and_receive(xml)
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ describe Postzord::Receiver::Public do
|
||||||
|
|
||||||
describe '#recipient_user_ids' do
|
describe '#recipient_user_ids' do
|
||||||
it 'calls User.all_sharing_with_person' do
|
it 'calls User.all_sharing_with_person' do
|
||||||
User.should_receive(:all_sharing_with_person).and_return(double(:select => []))
|
User.should_receive(:all_sharing_with_person).and_return(double(:pluck => []))
|
||||||
receiver = Postzord::Receiver::Public.new(@xml)
|
receiver = Postzord::Receiver::Public.new(@xml)
|
||||||
receiver.perform!
|
receiver.perform!
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ describe Post do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should return the three visible posts' do
|
it 'should return the three visible posts' do
|
||||||
StatusMessage.owned_or_visible_by_user(@you).count.should == 3
|
StatusMessage.owned_or_visible_by_user(@you).count(:all).should == 3
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ describe User::Querying do
|
||||||
describe "#visible_shareables" do
|
describe "#visible_shareables" do
|
||||||
it 'never contains posts from people not in your aspects' do
|
it 'never contains posts from people not in your aspects' do
|
||||||
FactoryGirl.create(:status_message, :public => true)
|
FactoryGirl.create(:status_message, :public => true)
|
||||||
bob.visible_shareables(Post).count.should == 0
|
bob.visible_shareables(Post).count(:all).should == 0
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with two posts with the same timestamp' do
|
context 'with two posts with the same timestamp' do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue