From 62c6c157bf68702960b0ab82410bb6ce42651a3e Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Wed, 4 Jun 2014 19:52:38 -0400 Subject: [PATCH 01/14] upgraded ruby version to 2.1.2 --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 25e9042c..4a2df98b 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -ruby '2.1.0' +ruby '2.1.2' gem 'rails', '4.0.3' From 12e74e7b3e90e8644d1db08232d17b6736812915 Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Wed, 4 Jun 2014 21:26:01 -0400 Subject: [PATCH 02/14] Upgraded rails to 4.1.1, fixed moip-ruby version to avoid problems with MoIP API, changed feedzira to feedjira. --- Gemfile | 6 +- Gemfile.lock | 302 +++++++++++++++++++++++++++------------------------ lib/blog.rb | 2 +- 3 files changed, 163 insertions(+), 147 deletions(-) diff --git a/Gemfile b/Gemfile index 4a2df98b..f9ee1df5 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' ruby '2.1.2' -gem 'rails', '4.0.3' +gem 'rails', '~> 4.1.1' gem 'protected_attributes', '~> 1.0.5' # When upgrade to strong_parameters, remove this gem. gem 'rails-observers', '~> 0.1.2' @@ -70,7 +70,7 @@ gem 'rmagick', :require => 'RMagick' # Other Tools gem 'to_xls' gem 'ranked-model' -gem 'feedzirra' +gem 'feedjira' gem 'inherited_resources', '~> 1.4.1' gem 'has_scope', '~> 0.6.0.rc' gem 'spectator-validates_email', require: 'validates_email' @@ -82,7 +82,7 @@ gem 'http_accept_language' gem 'routing-filter', '~> 0.4.0.pre' # Payment -gem 'moip', github: 'catarse/moip-ruby' +gem 'moip', github: 'catarse/moip-ruby', ref: 'c0225ad71645cd1df35dafa1e45c9f092b3abb9e' gem 'httpclient', '>= 2.2.5' group :production do diff --git a/Gemfile.lock b/Gemfile.lock index 2d453bb2..4a86fbbb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,6 +10,7 @@ GIT GIT remote: git://github.com/catarse/moip-ruby.git revision: c0225ad71645cd1df35dafa1e45c9f092b3abb9e + ref: c0225ad71645cd1df35dafa1e45c9f092b3abb9e specs: moip (1.0.2) activesupport (>= 2.3.2) @@ -20,19 +21,23 @@ GEM remote: https://rubygems.org/ specs: RedCloth (4.2.9) - actionmailer (4.0.3) - actionpack (= 4.0.3) + actionmailer (4.1.1) + actionpack (= 4.1.1) + actionview (= 4.1.1) mail (~> 2.5.4) - actionpack (4.0.3) - activesupport (= 4.0.3) - 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) - active_utils (2.0.2) + actionview (4.1.1) + activesupport (= 4.1.1) + builder (~> 3.1) + erubis (~> 2.7.0) + active_utils (2.2.1) activesupport (>= 2.3.11) i18n - activemerchant (1.42.6) + activemerchant (1.43.1) active_utils (~> 2.0, >= 2.0.1) activesupport (>= 2.3.14, < 5.0.0) builder (>= 2.1.2, < 4.0.0) @@ -40,23 +45,21 @@ GEM json (~> 1.7) money (< 7.0.0) nokogiri (~> 1.4) - activemodel (4.0.3) - activesupport (= 4.0.3) - builder (~> 3.1.0) - activerecord (4.0.3) - activemodel (= 4.0.3) - activerecord-deprecated_finders (~> 1.0.2) - activesupport (= 4.0.3) - arel (~> 4.0.0) - activerecord-deprecated_finders (1.0.3) - activesupport (4.0.3) - i18n (~> 0.6, >= 0.6.4) - minitest (~> 4.2) - multi_json (~> 1.3) + 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) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) thread_safe (~> 0.1) - tzinfo (~> 0.3.37) - addressable (2.3.5) - arel (4.0.2) + tzinfo (~> 1.1) + addressable (2.3.6) + arel (5.0.1.20140414130214) auto_html (1.4.2) RedCloth redcarpet @@ -68,8 +71,8 @@ GEM erubis (>= 2.6.6) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) - browser (0.3.2) - builder (3.1.4) + browser (0.5.0) + builder (3.2.2) capybara (2.1.0) mime-types (>= 1.16) nokogiri (>= 1.3.3) @@ -85,21 +88,21 @@ GEM enumerate_it libxml-ruby (~> 2.6.0) rails (~> 4.0) - catarse_monkeymail (0.1.2) + catarse_monkeymail (0.1.3) mailchimp-api (~> 2.0.4) - rails (~> 4.0.3) + rails (>= 4.0.3) catarse_paypal_express (2.2.3) activemerchant (>= 1.34.0) rails (~> 4.0) slim-rails - catarse_settings_db (0.0.1) - rails (~> 4.0.3) + catarse_settings_db (0.0.2) + rails (~> 4.1.1) celluloid (0.15.2) timers (~> 1.1.0) - chartkick (1.2.1) - childprocess (0.4.0) + chartkick (1.2.4) + childprocess (0.5.3) ffi (~> 1.0, >= 1.0.11) - chunky_png (1.2.9) + chunky_png (1.3.1) cliver (0.3.2) coderay (1.1.0) coffee-rails (4.0.1) @@ -108,16 +111,17 @@ GEM coffee-script (2.2.0) coffee-script-source execjs - coffee-script-source (1.6.3) - compass (0.12.2) + coffee-script-source (1.7.0) + compass (0.12.6) chunky_png (~> 1.2) fssm (>= 0.2.7) - sass (~> 3.1) + sass (~> 3.2.19) compass-960-plugin (0.10.4) compass (>= 0.10.0) - compass-rails (1.1.3) + compass-rails (1.1.7) compass (>= 0.12.2) - connection_pool (1.2.0) + sprockets (<= 2.11.0) + connection_pool (2.0.0) coveralls (0.7.0) multi_json (~> 1.3) rest-client @@ -126,7 +130,7 @@ GEM thor crack (0.1.8) curb (0.8.5) - database_cleaner (1.2.0) + database_cleaner (1.3.0) debug_inspector (0.0.2) devise (3.2.4) bcrypt (~> 3.0) @@ -135,8 +139,10 @@ GEM thread_safe (~> 0.1) warden (~> 1.2.3) diff-lcs (1.2.5) - docile (1.1.1) - dotenv (0.9.0) + docile (1.1.3) + dotenv (0.11.1) + dotenv-deployment (~> 0.0.2) + dotenv-deployment (0.0.2) draper (1.3.0) actionpack (>= 3.0) activemodel (>= 3.0) @@ -145,80 +151,89 @@ GEM enumerate_it (1.2.1) activesupport (>= 3.0.0) erubis (2.7.0) - excon (0.31.0) - execjs (2.0.2) + excon (0.36.0) + execjs (2.1.0) ezcrypto (0.7.2) - factory_girl (4.3.0) + factory_girl (4.4.0) activesupport (>= 3.0.0) - factory_girl_rails (4.3.0) - factory_girl (~> 4.3.0) + factory_girl_rails (4.4.1) + factory_girl (~> 4.4.0) railties (>= 3.0.0) fakeweb (1.3.0) - faraday (0.8.8) - multipart-post (~> 1.2.0) - feedzirra (0.7.0) + faraday (0.9.0) + multipart-post (>= 1.2, < 3) + feedjira (1.3.0) curb (~> 0.8.1) - loofah (~> 1.2.1) + loofah (~> 2.0.0) sax-machine (~> 0.2.1) ffi (1.9.3) - fog (1.19.0) + fog (1.22.1) + fog-brightbox + fog-core (~> 1.22) + fog-json + ipaddress (~> 0.5) + nokogiri (~> 1.5, >= 1.5.11) + fog-brightbox (0.0.2) + fog-core + fog-json + fog-core (1.22.0) builder - excon (~> 0.31.0) - formatador (~> 0.2.0) + excon (~> 0.33) + formatador (~> 0.2) mime-types - multi_json (~> 1.0) net-scp (~> 1.1) net-ssh (>= 2.1.3) - nokogiri (~> 1.5) - ruby-hmac - foreman (0.63.0) - dotenv (>= 0.7) - thor (>= 0.13.6) - formatador (0.2.4) + fog-json (1.0.0) + multi_json (~> 1.0) + foreman (0.71.0) + dotenv (~> 0.11.1) + thor (~> 0.19.1) + formatador (0.2.5) formtastic (2.2.1) actionpack (>= 3.0) fssm (0.2.10) has_scope (0.6.0.rc) actionpack (>= 3.2, < 5) activesupport (>= 3.2, < 5) - hashie (2.0.5) + hashie (2.1.1) heroku-deflater (0.5.3) rack (>= 1.4.5) high_voltage (2.1.0) hike (1.2.3) - htmlentities (4.3.1) - http_accept_language (2.0.0) + htmlentities (4.3.2) + http_accept_language (2.0.1) httparty (0.6.1) crack (= 0.1.8) - httpauth (0.2.0) + httpauth (0.2.1) httpclient (2.3.4.1) i18n (0.6.9) inherited_resources (1.4.1) has_scope (~> 0.6.0.rc) responders (~> 1.0.0.rc) + ipaddress (0.8.0) jasmine-core (2.0.0) - jasmine-rails (0.6.0) + jasmine-rails (0.9.0) jasmine-core (>= 1.3, < 3.0) phantomjs - rails (>= 3.1.0) + railties (>= 3.1.0) sprockets-rails - jquery-rails (3.0.4) + jquery-rails (3.1.0) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) json (1.8.1) - jwt (0.1.8) + jwt (0.1.13) multi_json (>= 1.5) - kaminari (0.15.0) + kaminari (0.15.1) actionpack (>= 3.0.0) activesupport (>= 3.0.0) - kgio (2.8.1) + kgio (2.9.2) launchy (2.4.2) addressable (~> 2.3) letter_opener (1.2.0) launchy (~> 2.2) libxml-ruby (2.6.0) - loofah (1.2.1) - nokogiri (>= 1.4.4) + loofah (2.0.0) + nokogiri (>= 1.5.9) mail (2.5.4) mime-types (~> 1.16) treetop (~> 1.4.8) @@ -227,21 +242,19 @@ GEM json (>= 1.7.7) method_source (0.8.2) mime-types (1.25.1) - mini_portile (0.5.2) - minitest (4.7.5) + mini_portile (0.6.0) + minitest (5.3.4) mixpanel-ruby (1.4.0) - monetize (0.1.4) - money (6.0.1) + money (6.1.1) i18n (~> 0.6.4) - monetize (~> 0.1.3) multi_json (1.10.1) - multipart-post (1.2.0) - net-scp (1.1.2) + multipart-post (2.0.0) + net-scp (1.2.1) net-ssh (>= 2.6.5) - net-ssh (2.7.0) + net-ssh (2.9.1) newrelic_rpm (3.6.5.130) - nokogiri (1.6.1) - mini_portile (~> 0.5.0) + nokogiri (1.6.2.1) + mini_portile (= 0.6.0) oauth (0.4.7) oauth2 (0.8.1) faraday (~> 0.8) @@ -249,9 +262,9 @@ GEM jwt (~> 0.1.4) multi_json (~> 1.0) rack (~> 1.2) - omniauth (1.1.4) + omniauth (1.2.1) hashie (>= 1.2, < 3) - rack + rack (~> 1.0) omniauth-facebook (1.4.0) omniauth-oauth2 (~> 1.0.2) omniauth-oauth (1.0.1) @@ -265,12 +278,12 @@ GEM omniauth-oauth (~> 1.0) orm_adapter (0.5.0) pg (0.17.1) - pg_search (0.7.2) + pg_search (0.7.4) activerecord (>= 3.1) activesupport (>= 3.1) arel - phantomjs (1.9.7.0) - poltergeist (1.5.0) + phantomjs (1.9.7.1) + poltergeist (1.5.1) capybara (~> 2.1) cliver (~> 0.3.1) multi_json (~> 1.0) @@ -281,27 +294,29 @@ GEM pg rails (~> 4.0) responders - protected_attributes (1.0.5) + protected_attributes (1.0.7) activemodel (>= 4.0.1, < 5.0) - pry (0.9.12.4) + pry (0.9.12.6) coderay (~> 1.0) method_source (~> 0.8) slop (~> 3.4) - pundit (0.2.1) + pundit (0.2.3) activesupport (>= 3.0.0) rack (1.5.2) - rack-protection (1.5.1) + rack-protection (1.5.3) rack rack-test (0.6.2) rack (>= 1.0) - rails (4.0.3) - actionmailer (= 4.0.3) - actionpack (= 4.0.3) - activerecord (= 4.0.3) - activesupport (= 4.0.3) + 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.3) - sprockets-rails (~> 2.0.0) + railties (= 4.1.1) + sprockets-rails (~> 2.0) rails-observers (0.1.2) activemodel (~> 4.0) rails_12factor (0.0.2) @@ -309,17 +324,17 @@ GEM rails_stdout_logging rails_serve_static_assets (0.0.2) rails_stdout_logging (0.0.3) - railties (4.0.3) - actionpack (= 4.0.3) - activesupport (= 4.0.3) + railties (4.1.1) + actionpack (= 4.1.1) + activesupport (= 4.1.1) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - raindrops (0.12.0) + raindrops (0.13.0) rake (10.3.2) - ranked-model (0.3) + ranked-model (0.4.0) activerecord (>= 3.1.12) - redcarpet (3.0.0) - redis (3.0.6) + redcarpet (3.1.2) + redis (3.0.7) redis-namespace (1.4.1) redis (~> 3.0.4) request_store (1.0.5) @@ -331,11 +346,11 @@ GEM rmagick (2.13.2) routing-filter (0.4.0.pre) actionpack - rspec-core (2.14.7) - rspec-expectations (2.14.4) + rspec-core (2.14.8) + rspec-expectations (2.14.5) diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.14.4) - rspec-rails (2.14.1) + rspec-mocks (2.14.6) + rspec-rails (2.14.2) actionpack (>= 3.0) activemodel (>= 3.0) activesupport (>= 3.0) @@ -343,31 +358,31 @@ GEM rspec-core (~> 2.14.0) rspec-expectations (~> 2.14.0) rspec-mocks (~> 2.14.0) - ruby-hmac (0.4.0) ruby-ole (1.2.11.7) - rubyzip (1.1.0) - sass (3.2.13) - sass-rails (4.0.1) + rubyzip (1.1.4) + sass (3.2.19) + sass-rails (4.0.3) railties (>= 4.0.0, < 5.0) - sass (>= 3.1.10) - sprockets-rails (~> 2.0.0) + sass (~> 3.2.0) + sprockets (~> 2.8, <= 2.11.0) + sprockets-rails (~> 2.0) sax-machine (0.2.1) nokogiri (~> 1.6.0) schema_associations (1.2.0) schema_plus (>= 1.2.0) - schema_plus (1.3.2) - rails (>= 3.2) + schema_plus (1.5.1) + activerecord (>= 3.2) valuable - selenium-webdriver (2.39.0) - childprocess (>= 0.2.5) + selenium-webdriver (2.42.0) + childprocess (>= 0.5.0) multi_json (~> 1.0) rubyzip (~> 1.0) websocket (~> 1.0.4) shoulda (3.5.0) shoulda-context (~> 1.0, >= 1.0.1) shoulda-matchers (>= 1.4.1, < 3.0) - shoulda-context (1.1.6) - shoulda-matchers (2.4.0) + shoulda-context (1.2.1) + shoulda-matchers (2.6.1) activesupport (>= 3.0.0) sidekiq (2.15.2) celluloid (>= 0.15.2) @@ -375,72 +390,73 @@ GEM json redis (>= 3.0.4) redis-namespace (>= 1.3.1) - simple_form (3.0.1) - actionpack (>= 4.0.0, < 4.1) - activemodel (>= 4.0.0, < 4.1) + simple_form (3.0.2) + actionpack (~> 4.0) + activemodel (~> 4.0) simplecov (0.8.2) docile (~> 1.1.0) multi_json simplecov-html (~> 0.8.0) simplecov-html (0.8.0) - sinatra (1.4.4) + sinatra (1.4.5) rack (~> 1.4) rack-protection (~> 1.4) tilt (~> 1.3, >= 1.3.4) slim (2.0.2) temple (~> 0.6.6) tilt (>= 1.3.3, < 2.1) - slim-rails (2.1.2) - actionpack (>= 3.0, < 4.1) - activesupport (>= 3.0, < 4.1) - railties (>= 3.0, < 4.1) + slim-rails (2.1.4) + actionpack (>= 3.0, < 4.2) + activesupport (>= 3.0, < 4.2) + railties (>= 3.0, < 4.2) slim (~> 2.0) - slop (3.4.7) + slop (3.5.0) spectator-validates_email (0.2.0) activemodel (>= 3.0.0) - spreadsheet (0.9.6) + spreadsheet (0.9.7) ruby-ole (>= 1.0) sprockets (2.10.1) hike (~> 1.2) 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) state_machine (1.2.0) tag_helper (0.0.3) temple (0.6.7) - term-ansicolor (1.2.2) - tins (~> 0.8) + term-ansicolor (1.3.0) + tins (~> 1.0) thor (0.19.1) thread_safe (0.3.4) tilt (1.4.1) timers (1.1.0) - tins (0.13.1) - to_xls (1.5.2) + tins (1.3.0) + to_xls (1.5.3) spreadsheet treetop (1.4.15) polyglot polyglot (>= 0.3.1) - tzinfo (0.3.39) - uglifier (2.4.0) + tzinfo (1.2.1) + thread_safe (~> 0.1) + uglifier (2.5.0) execjs (>= 0.3.0) json (>= 1.8.0) - unicorn (4.7.0) + unicorn (4.8.3) kgio (~> 2.6) rack raindrops (~> 0.7) valuable (0.9.8) - video_info (2.0.2) + video_info (2.3.1) addressable htmlentities multi_json warden (1.2.3) rack (>= 1.0) websocket (1.0.7) - websocket-driver (0.3.2) + websocket-driver (0.3.3) weekdays (1.0.2) xpath (2.0.0) nokogiri (~> 1.3) @@ -472,7 +488,7 @@ DEPENDENCIES ezcrypto factory_girl_rails fakeweb - feedzirra + feedjira fog (>= 1.3.1) foreman formtastic (~> 2.2.1) @@ -501,7 +517,7 @@ DEPENDENCIES protected_attributes (~> 1.0.5) pry pundit - rails (= 4.0.3) + rails (~> 4.1.1) rails-observers (~> 0.1.2) rails_12factor ranked-model diff --git a/lib/blog.rb b/lib/blog.rb index 136a4b1d..ba07d7f7 100644 --- a/lib/blog.rb +++ b/lib/blog.rb @@ -3,7 +3,7 @@ class Blog def fetch_last_posts Rails.cache.fetch('blog_posts', expires_in: 10.minutes) do begin - feed = Feedzirra::Feed.fetch_and_parse("#{CatarseSettings[:blog_url]}?feed=rss2") + feed = Feedjira::Feed.fetch_and_parse("#{CatarseSettings[:blog_url]}?feed=rss2") feed.entries rescue [] From ff52b668b03d930cfa659182a855ebf2588770cd Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Wed, 4 Jun 2014 21:26:48 -0400 Subject: [PATCH 03/14] changed .scoped for .all (scoped was removed in rails 4.1) --- app/models/project.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/project.rb b/app/models/project.rb index 57bd0d3d..1f61ec03 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -133,7 +133,7 @@ class Project < ActiveRecord::Base end def self.order_by(sort_field) - return scoped unless sort_field =~ /^\w+(\.\w+)?\s(desc|asc)$/i + return self.all unless sort_field =~ /^\w+(\.\w+)?\s(desc|asc)$/i order(sort_field) end From f6dc569a5345805356e77448264a7ae32c79b7be Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Wed, 4 Jun 2014 21:27:19 -0400 Subject: [PATCH 04/14] added hack to make state_machine work with rails. let's consider migrating to aasm --- config/initializers/state_machine.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 config/initializers/state_machine.rb diff --git a/config/initializers/state_machine.rb b/config/initializers/state_machine.rb new file mode 100644 index 00000000..c86b1c94 --- /dev/null +++ b/config/initializers/state_machine.rb @@ -0,0 +1,14 @@ +# Rails 4.1.0 and StateMachine don't play nice +# https://github.com/pluginaweek/state_machine/issues/295 + +require 'state_machine/version' + +unless StateMachine::VERSION == '1.2.0' + # If you see this message, please test removing this file + # If it's still required, please bump up the version above + Rails.logger.warn "Please remove me, StateMachine version has changed" +end + +module StateMachine::Integrations::ActiveModel + public :around_validation +end From 78a7d27b32eee7555874f9cd2f07ecf17c396adb Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Wed, 4 Jun 2014 21:37:12 -0400 Subject: [PATCH 05/14] Fixed has_and_belongs_to_many problem using has_many through instead. We already had an intermediary model. --- app/models/channel.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/channel.rb b/app/models/channel.rb index 3ddc0962..95a91dd2 100644 --- a/app/models/channel.rb +++ b/app/models/channel.rb @@ -9,7 +9,7 @@ class Channel < ActiveRecord::Base validates_uniqueness_of :permalink has_and_belongs_to_many :projects, -> { order_for_search } - has_and_belongs_to_many :subscribers, class_name: 'User', join_table: :channels_subscribers + has_many :subscribers, class_name: 'User', through: :channels_subscribers, source: :user has_many :subscriber_reports catarse_auto_html_for field: :how_it_works, video_width: 560, video_height: 340 From acd88d84d623310ea429e16e0e471e199a63cc7a Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Thu, 5 Jun 2014 09:15:54 -0400 Subject: [PATCH 06/14] fixed video handler, now the // comes in the video_embed_url method --- app/models/concerns/shared/video_handler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/concerns/shared/video_handler.rb b/app/models/concerns/shared/video_handler.rb index 0751aed5..f99c73f0 100644 --- a/app/models/concerns/shared/video_handler.rb +++ b/app/models/concerns/shared/video_handler.rb @@ -14,7 +14,7 @@ module Shared::VideoHandler def display_video_embed_url if self.video_embed_url - "//#{self.video_embed_url}?title=0&byline=0&portrait=0&autoplay=0" + "#{self.video_embed_url}?title=0&byline=0&portrait=0&autoplay=0" end end From 332850f79842335abdfd4c13b88f5f8f34834139 Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Thu, 5 Jun 2014 13:17:35 -0400 Subject: [PATCH 07/14] fixed another video spec. now URL always comes with // --- spec/models/concerns/project/video_handler_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/models/concerns/project/video_handler_spec.rb b/spec/models/concerns/project/video_handler_spec.rb index 5c1a2763..e527c10f 100644 --- a/spec/models/concerns/project/video_handler_spec.rb +++ b/spec/models/concerns/project/video_handler_spec.rb @@ -24,7 +24,7 @@ describe Project::VideoHandler do end it "should store the new embed url" do - project.video_embed_url.should == 'player.vimeo.com/video/49584778' + project.video_embed_url.should == '//player.vimeo.com/video/49584778' end end end From c6e623a2c8215e3ea6262e304e6e68ea1afe40d2 Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Thu, 5 Jun 2014 13:17:49 -0400 Subject: [PATCH 08/14] removed nonexistent images from SASS --- app/assets/stylesheets/miv/_projects.sass | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/assets/stylesheets/miv/_projects.sass b/app/assets/stylesheets/miv/_projects.sass index b3041ecf..b106973c 100644 --- a/app/assets/stylesheets/miv/_projects.sass +++ b/app/assets/stylesheets/miv/_projects.sass @@ -15,8 +15,6 @@ div.project height: 110px overflow: hidden position: absolute - &.pt - background: image-url("redesign/success_pt110x110.png") left top no-repeat .box .project_content padding: 5px @@ -127,7 +125,7 @@ div.project color: black +opacity(0.5) +border-radius(3px) - background: image-url("redesign/follow_project_start12x11.png") 4px 4px no-repeat $minimal_gryn + background: $minimal_gryn text-transform: uppercase &:hover +box-shadow($grafiti 0 0 6px) From 40c0c156ea496cc6aaf02d438e5d8c1da34bdc8e Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Thu, 5 Jun 2014 13:18:02 -0400 Subject: [PATCH 09/14] fixed problem with render_to_string in rails 4.1 --- config/initializers/fix_render_to_string.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 config/initializers/fix_render_to_string.rb diff --git a/config/initializers/fix_render_to_string.rb b/config/initializers/fix_render_to_string.rb new file mode 100644 index 00000000..59f4cb4c --- /dev/null +++ b/config/initializers/fix_render_to_string.rb @@ -0,0 +1,15 @@ +module AbstractController + module Rendering + # Normalize args and options. + # :api: private + def _normalize_render(*args, &block) + options = _normalize_args(*args, &block) + # TODO: remove defined? when we restore AP <=> AV dependency + if defined?(request) && request && request.variant.present? + options[:variant] = request.variant + end + _normalize_options(options) + options + end + end +end From fd791a9cfdb761b57498b5b5df32c71d31b3f985 Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Thu, 5 Jun 2014 13:19:48 -0400 Subject: [PATCH 10/14] added comments pointing to issue in github on fix_render_to_string initializer --- config/initializers/fix_render_to_string.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/initializers/fix_render_to_string.rb b/config/initializers/fix_render_to_string.rb index 59f4cb4c..531265ec 100644 --- a/config/initializers/fix_render_to_string.rb +++ b/config/initializers/fix_render_to_string.rb @@ -1,3 +1,5 @@ +# Fix issue with render_to_string in Rails 4.1.1 +# Done according to https://github.com/rails/rails/issues/14125 module AbstractController module Rendering # Normalize args and options. From f2e38219726aba4021615f6db224510d743f8f70 Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Thu, 5 Jun 2014 13:58:45 -0400 Subject: [PATCH 11/14] changed formtastic for simple_form --- app/views/projects/_project_edit.html.slim | 51 +++++++++++----------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/app/views/projects/_project_edit.html.slim b/app/views/projects/_project_edit.html.slim index 836ead4d..a76779c4 100644 --- a/app/views/projects/_project_edit.html.slim +++ b/app/views/projects/_project_edit.html.slim @@ -3,30 +3,29 @@ p = "Para saber tudo sobre como estruturar o seu projeto, baixe o #{link_to 'Guia Completo', "#{CatarseSettings[:base_url]}/guia_realizadores.pdf", target: '_blank'}".html_safe .bootstrap-form - = semantic_form_for @project do |form| - = form.inputs do - - if current_user.admin - = form.input :user_id - = form.input :permalink, as: :string - - if policy(@project).permitted_for?(:name, :update) - = form.input :name, as: :string, required: false - - if policy(@project).permitted_for?(:headline, :update) - = form.input :headline, as: :string, required: false - - if policy(@project).permitted_for?(:category_id, :update) - = form.input :category, as: :select, required: false - - if policy(@project).permitted_for?(:video_url, :update) - = form.input :video_url, as: :string, hint: t('formtastic.hints.project.video_url_edit'),required: false - - if policy(@project).permitted_for?(:uploaded_image, :update) - = form.input :uploaded_image, as: :file, required: false, - hint: (@project.uploaded_image.present? ? image_tag(@project.uploaded_image.project_thumb.url, size: '220x172') : t('formtastic.hints.project.uploaded_image') ) - - if policy(@project).permitted_for?(:online_days, :update) - = form.input :online_days, as: :number, required: false - - if policy(@project).permitted_for?(:goal, :update) - = form.input :goal, as: :number, required: false, hint: t('formtastic.hints.project.goal').html_safe - - if policy(@project).permitted_for?(:about, :update) - = form.input :about, required: false - = render 'formatting_tips' + = simple_form_for @project do |form| + - if current_user.admin + = form.input :user_id + = form.input :permalink, as: :string + - if policy(@project).permitted_for?(:name, :update) + = form.input :name, as: :string, required: false + - if policy(@project).permitted_for?(:headline, :update) + = form.input :headline, as: :string, required: false + - if policy(@project).permitted_for?(:category_id, :update) + = form.input :category, as: :select, required: false + - if policy(@project).permitted_for?(:video_url, :update) + = form.input :video_url, as: :string, hint: t('formtastic.hints.project.video_url_edit'),required: false + - if policy(@project).permitted_for?(:uploaded_image, :update) + = form.input :uploaded_image, as: :file, required: false, + hint: (@project.uploaded_image.present? ? image_tag(@project.uploaded_image.project_thumb.url, size: '220x172') : t('formtastic.hints.project.uploaded_image') ) + - if policy(@project).permitted_for?(:online_days, :update) + = form.input :online_days, as: :numeric, required: false + - if policy(@project).permitted_for?(:goal, :update) + = form.input :goal, as: :numeric, required: false, hint: t('formtastic.hints.project.goal').html_safe + - if policy(@project).permitted_for?(:about, :update) + = form.input :about, required: false + = render 'formatting_tips' - .clearfix - .form-actions.bootstrap-twitter - = form.submit class: 'btn' + .clearfix + .form-actions.bootstrap-twitter + = form.submit class: 'btn' From b6609fe231ae056519c232586d49d5a8351ed2ca Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Thu, 5 Jun 2014 14:36:49 -0400 Subject: [PATCH 12/14] migration to fix video_embed_url in existing projects (the new url will always contain the // before the host --- db/migrate/20140605174230_fix_vide_embed_urls.rb | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 db/migrate/20140605174230_fix_vide_embed_urls.rb diff --git a/db/migrate/20140605174230_fix_vide_embed_urls.rb b/db/migrate/20140605174230_fix_vide_embed_urls.rb new file mode 100644 index 00000000..a6edb08c --- /dev/null +++ b/db/migrate/20140605174230_fix_vide_embed_urls.rb @@ -0,0 +1,7 @@ +class FixVideEmbedUrls < ActiveRecord::Migration + def change + execute " + UPDATE projects SET video_embed_url = regexp_replace(video_embed_url, '^(\\w)', '//\\1'); + " + end +end From b1071e6fd8579df54c6df75f2f1ebb6e9a0e795b Mon Sep 17 00:00:00 2001 From: pedromarins Date: Fri, 6 Jun 2014 08:48:20 -0300 Subject: [PATCH 13/14] fix on projects/edit form to be with the same style as the original form --- app/assets/stylesheets/resources/projects/_show.sass | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/resources/projects/_show.sass b/app/assets/stylesheets/resources/projects/_show.sass index 92aa2971..e17ca562 100644 --- a/app/assets/stylesheets/resources/projects/_show.sass +++ b/app/assets/stylesheets/resources/projects/_show.sass @@ -612,6 +612,12 @@ width: 92% +border-radius (0) .bootstrap-form + div + margin-bottom: 20px + border-bottom: dotted 1px #cccccc + padding: 25px 0 + display: inline-block + width: 100% .inputs li.input margin-bottom: 20px @@ -631,7 +637,7 @@ text-align: center width: 160px margin-right: 10px - p.inline-hints + span.hint color: #777777 float: right margin-right: 20px From 803c5b56e852b52829ba9755901ccd91dced6e1f Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Fri, 6 Jun 2014 09:23:42 -0400 Subject: [PATCH 14/14] updated travis to 2.1.2 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7cc6c971..7b990956 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ rvm: - - 2.1.0 + - 2.1.2 before_install: - "gem install bundler -v '= 1.5.1'"