From c3e8a4e4ff39930f4d73078f76fb3df1f4444045 Mon Sep 17 00:00:00 2001 From: Nicolas Bally Date: Sat, 15 May 2021 03:20:00 +0200 Subject: [PATCH] suite --- Gemfile | 9 +- Gemfile.lock | 163 ++++++++++++++++++---------------- app/models/article.rb | 4 +- app/models/block.rb | 2 +- app/models/gallery_content.rb | 2 +- app/models/portfolio.rb | 2 +- app/models/table_content.rb | 2 +- app/models/table_row.rb | 2 +- 8 files changed, 97 insertions(+), 89 deletions(-) diff --git a/Gemfile b/Gemfile index 3fe813e..481cd1c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'http://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '4.0.9' +gem 'rails', '4.2.10' gem 'bcrypt-ruby', '~> 3.1.2' @@ -43,7 +43,7 @@ gem 'formtastic-bootstrap' gem 'kaminari' -gem 'bootstrap3-kaminari-views' +#gem 'bootstrap3-kaminari-views' gem 'carrierwave' @@ -54,11 +54,6 @@ group :doc do gem 'sdoc', require: false end -gem "capistrano", group: :development -gem "rvm-capistrano", group: :development -gem 'net-ssh', '~>2.7.0' -# Use ActiveModel has_secure_password -# gem 'bcrypt-ruby', '~> 3.0.0' # Use unicorn as the app server gem "unicorn" diff --git a/Gemfile.lock b/Gemfile.lock index 7d1e712..dbd0166 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,46 +1,47 @@ GEM remote: http://rubygems.org/ specs: - actionmailer (4.0.9) - actionpack (= 4.0.9) - mail (~> 2.5.4) - actionpack (4.0.9) - activesupport (= 4.0.9) - builder (~> 3.1.0) - erubis (~> 2.7.0) - rack (~> 1.5.2) + actionmailer (4.2.10) + actionpack (= 4.2.10) + actionview (= 4.2.10) + activejob (= 4.2.10) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 1.0, >= 1.0.5) + actionpack (4.2.10) + actionview (= 4.2.10) + activesupport (= 4.2.10) + rack (~> 1.6) rack-test (~> 0.6.2) - activemodel (4.0.9) - activesupport (= 4.0.9) - builder (~> 3.1.0) - activerecord (4.0.9) - activemodel (= 4.0.9) - activerecord-deprecated_finders (~> 1.0.2) - activesupport (= 4.0.9) - arel (~> 4.0.0) - activerecord-deprecated_finders (1.0.4) - activesupport (4.0.9) - i18n (~> 0.6, >= 0.6.9) - minitest (~> 4.2) - multi_json (~> 1.3) - thread_safe (~> 0.1) - tzinfo (~> 0.3.37) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (4.2.10) + activesupport (= 4.2.10) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (4.2.10) + activesupport (= 4.2.10) + globalid (>= 0.3.0) + activemodel (4.2.10) + activesupport (= 4.2.10) + builder (~> 3.1) + activerecord (4.2.10) + activemodel (= 4.2.10) + activesupport (= 4.2.10) + arel (~> 6.0) + activesupport (4.2.10) + i18n (~> 0.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) acts_as_tree (2.9.1) activerecord (>= 3.0.0) - arel (4.0.2) + arel (6.0.4) bcrypt (3.1.16) bcrypt-ruby (3.1.5) bcrypt (>= 3.1.3) - bootstrap3-kaminari-views (0.0.1) - kaminari - rails (~> 4.0.0) - builder (3.1.4) - capistrano (2.15.9) - highline - net-scp (>= 1.0.0) - net-sftp (>= 2.0.0) - net-ssh (>= 2.0.14) - net-ssh-gateway (>= 1.1.0) + builder (3.2.4) carrierwave (1.3.2) activemodel (>= 4.0.0) activesupport (>= 4.0.0) @@ -55,12 +56,15 @@ GEM coffee-script-source (1.12.2) commonjs (0.2.7) concurrent-ruby (1.1.8) + crass (1.0.6) erubis (2.7.0) execjs (2.8.1) formtastic (3.1.5) actionpack (>= 3.2.13) formtastic-bootstrap (3.1.1) formtastic (>= 3.0) + globalid (0.4.2) + activesupport (>= 4.2.0) haml (5.2.1) temple (>= 0.8.0) tilt @@ -70,7 +74,6 @@ GEM haml (>= 4.0.6, < 6.0) html2haml (>= 1.0.1) railties (>= 4.0.1) - highline (2.0.3) hike (1.2.3) html2haml (2.2.0) erubis (~> 2.7.0) @@ -81,12 +84,22 @@ GEM concurrent-ruby (~> 1.0) jbuilder (1.0.2) activesupport (>= 3.0.0) - jquery-rails (3.1.5) - railties (>= 3.0, < 5.0) + jquery-rails (4.4.0) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) thor (>= 0.14, < 2.0) - kaminari (0.17.0) - actionpack (>= 3.0.0) - activesupport (>= 3.0.0) + kaminari (1.2.1) + activesupport (>= 4.1.0) + kaminari-actionview (= 1.2.1) + kaminari-activerecord (= 1.2.1) + kaminari-core (= 1.2.1) + kaminari-actionview (1.2.1) + actionview + kaminari-core (= 1.2.1) + kaminari-activerecord (1.2.1) + activerecord + kaminari-core (= 1.2.1) + kaminari-core (1.2.1) kgio (2.11.3) less (2.6.0) commonjs (~> 0.2.7) @@ -95,38 +108,46 @@ GEM less (~> 2.6.0) sprockets (>= 2) libv8 (3.16.14.19) - mail (2.5.5) - mime-types (~> 1.16) - treetop (~> 1.4.8) - mime-types (1.25.1) + loofah (2.9.1) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + mime-types (3.3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2021.0225) + mini_mime (1.1.0) mini_portile2 (2.4.0) - minitest (4.7.5) + minitest (5.14.4) multi_json (1.15.0) mysql2 (0.4.10) - net-scp (3.0.0) - net-ssh (>= 2.6.5, < 7.0.0) - net-sftp (2.1.2) - net-ssh (>= 2.6.5) - net-ssh (2.7.0) - net-ssh-gateway (1.3.0) - net-ssh (>= 2.6.5) nokogiri (1.10.10) mini_portile2 (~> 2.4.0) - polyglot (0.3.5) - rack (1.5.5) + rack (1.6.13) rack-test (0.6.3) rack (>= 1.0) - rails (4.0.9) - actionmailer (= 4.0.9) - actionpack (= 4.0.9) - activerecord (= 4.0.9) - activesupport (= 4.0.9) + rails (4.2.10) + actionmailer (= 4.2.10) + actionpack (= 4.2.10) + actionview (= 4.2.10) + activejob (= 4.2.10) + activemodel (= 4.2.10) + activerecord (= 4.2.10) + activesupport (= 4.2.10) bundler (>= 1.3.0, < 2.0) - railties (= 4.0.9) - sprockets-rails (~> 2.0) - railties (4.0.9) - actionpack (= 4.0.9) - activesupport (= 4.0.9) + railties (= 4.2.10) + sprockets-rails + rails-deprecated_sanitizer (1.0.4) + activesupport (>= 4.2.0.alpha) + rails-dom-testing (1.0.9) + activesupport (>= 4.2.0, < 5.0) + nokogiri (~> 1.6) + rails-deprecated_sanitizer (>= 1.0.1) + rails-html-sanitizer (1.3.0) + loofah (~> 2.3) + railties (4.2.10) + actionpack (= 4.2.10) + activesupport (= 4.2.10) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) raindrops (0.19.1) @@ -136,8 +157,6 @@ GEM rmagick (4.2.2) ruby_parser (3.15.1) sexp_processor (~> 4.9) - rvm-capistrano (1.5.6) - capistrano (~> 2.15.4) sass (3.2.19) sass-rails (4.0.5) railties (>= 4.0.0, < 5.0) @@ -165,9 +184,6 @@ GEM thor (1.1.0) thread_safe (0.3.6) tilt (1.4.1) - treetop (1.4.15) - polyglot - polyglot (>= 0.3.1) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) @@ -176,7 +192,8 @@ GEM execjs (>= 2.2.2, >= 2.2) less-rails (>= 2.5.0) railties (>= 3.1) - tzinfo (0.3.60) + tzinfo (1.2.9) + thread_safe (~> 0.1) uglifier (4.2.0) execjs (>= 0.3.0, < 3) unicorn (6.0.0) @@ -189,8 +206,6 @@ PLATFORMS DEPENDENCIES acts_as_tree bcrypt-ruby (~> 3.1.2) - bootstrap3-kaminari-views - capistrano carrierwave coffee-rails (~> 4.0.0) formtastic @@ -200,11 +215,9 @@ DEPENDENCIES jquery-rails kaminari mysql2 (= 0.4.10) - net-ssh (~> 2.7.0) nokogiri - rails (= 4.0.9) + rails (= 4.2.10) rmagick - rvm-capistrano sass-rails (~> 4.0.3) sdoc sqlite3 diff --git a/app/models/article.rb b/app/models/article.rb index 903f40b..211d7f2 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -5,7 +5,7 @@ class Article < ActiveRecord::Base has_one :block, :as => :blockable has_many :comments, :as => :commentable belongs_to :category - has_many :enabled_comments,:conditions => {:enabled => true}, :source => :comments, :as => :commentable + has_many :enabled_comments, :source => :comments, :as => :commentable after_create :after_creation before_validation do @@ -30,7 +30,7 @@ class Article < ActiveRecord::Base end - scope :recents, where("enabled = ?",true ).order("published_at DESC") + scope :recents, lambda { where("enabled = ?",true ).order("published_at DESC") } scope :between, lambda { |start, stop| after(start).before(stop) diff --git a/app/models/block.rb b/app/models/block.rb index 19108ec..7a91ec8 100644 --- a/app/models/block.rb +++ b/app/models/block.rb @@ -19,7 +19,7 @@ class Block < ActiveRecord::Base belongs_to :blockable, :polymorphic => true - has_many :portlets, :order => :position, :dependent => :destroy + has_many :portlets,-> { order :position }, :dependent => :destroy accepts_nested_attributes_for :portlets diff --git a/app/models/gallery_content.rb b/app/models/gallery_content.rb index 480a977..d2e9696 100644 --- a/app/models/gallery_content.rb +++ b/app/models/gallery_content.rb @@ -1,6 +1,6 @@ # -*- encoding : utf-8 -*- class GalleryContent < ActiveRecord::Base - has_many :gallery_images, :order => :position + has_many :gallery_images,-> { order :position } has_one :portlet, :as => :content, :dependent => :destroy diff --git a/app/models/portfolio.rb b/app/models/portfolio.rb index c09b258..4ec02f7 100644 --- a/app/models/portfolio.rb +++ b/app/models/portfolio.rb @@ -1,6 +1,6 @@ class Portfolio < ActiveRecord::Base belongs_to :artwork - has_many :artworks, :order => "position", :dependent => :destroy + has_many :artworks,-> { order :position }, :dependent => :destroy before_validation do self.slug = self.title.to_slug diff --git a/app/models/table_content.rb b/app/models/table_content.rb index 439ea9e..747947e 100644 --- a/app/models/table_content.rb +++ b/app/models/table_content.rb @@ -1,7 +1,7 @@ # -*- encoding : utf-8 -*- class TableContent < ActiveRecord::Base has_one :portlet, :as => :content, :dependent => :destroy - has_many :table_rows, :include => :cel_tables, :order => :position + has_many :table_rows,-> { order :position } has_many :cel_tables, :through => :table_rows STYLES = [["avec bordures",1],["sans bordures",2]] diff --git a/app/models/table_row.rb b/app/models/table_row.rb index 5f3dd5c..59587eb 100644 --- a/app/models/table_row.rb +++ b/app/models/table_row.rb @@ -1,6 +1,6 @@ # -*- encoding : utf-8 -*- class TableRow < ActiveRecord::Base - has_many :cel_tables, :order => :position + has_many :cel_tables,-> { order :position } belongs_to :table_content attr_accessor :skip_before_update