diff --git a/.gitignore b/.gitignore index 408d8cc2..6a6ec26f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ /.idea /.byebug_history -Gemfile.lock **/.DS_Store .DS_Store *~ diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 00000000..1d062714 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,426 @@ +PATH + remote: . + specs: + camaleon_cms (2.9.0) + addressable + aws-sdk-s3 (~> 1) + bcrypt + breadcrumbs_on_rails + cama_contact_form (~> 0.1.0) + cama_meta_tag + cancancan (>= 2.0, < 4) + dartsass-sprockets + draper (>= 4.0.2) + font-awesome-rails + ipaddress + jquery-rails + meta-tags (~> 2.0) + mini_magick + non-digest-assets (~> 2.0) + sprockets-rails (>= 3.5.1) + tinymce-rails (< 5) + will_paginate + will_paginate-bootstrap + +GEM + remote: https://rubygems.org/ + specs: + actioncable (8.0.1) + actionpack (= 8.0.1) + activesupport (= 8.0.1) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + zeitwerk (~> 2.6) + actionmailbox (8.0.1) + actionpack (= 8.0.1) + activejob (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) + mail (>= 2.8.0) + actionmailer (8.0.1) + actionpack (= 8.0.1) + actionview (= 8.0.1) + activejob (= 8.0.1) + activesupport (= 8.0.1) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (8.0.1) + actionview (= 8.0.1) + activesupport (= 8.0.1) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (8.0.1) + actionpack (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (8.0.1) + activesupport (= 8.0.1) + builder (~> 3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (8.0.1) + activesupport (= 8.0.1) + globalid (>= 0.3.6) + activemodel (8.0.1) + activesupport (= 8.0.1) + activemodel-serializers-xml (1.0.3) + activemodel (>= 5.0.0.a) + activesupport (>= 5.0.0.a) + builder (~> 3.1) + activerecord (8.0.1) + activemodel (= 8.0.1) + activesupport (= 8.0.1) + timeout (>= 0.4.0) + activestorage (8.0.1) + actionpack (= 8.0.1) + activejob (= 8.0.1) + activerecord (= 8.0.1) + activesupport (= 8.0.1) + marcel (~> 1.0) + activesupport (8.0.1) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + ast (2.4.2) + aws-eventstream (1.3.0) + aws-partitions (1.1035.0) + aws-sdk-core (3.215.0) + aws-eventstream (~> 1, >= 1.3.0) + aws-partitions (~> 1, >= 1.992.0) + aws-sigv4 (~> 1.9) + jmespath (~> 1, >= 1.6.1) + aws-sdk-kms (1.96.0) + aws-sdk-core (~> 3, >= 3.210.0) + aws-sigv4 (~> 1.5) + aws-sdk-s3 (1.177.0) + aws-sdk-core (~> 3, >= 3.210.0) + aws-sdk-kms (~> 1) + aws-sigv4 (~> 1.5) + aws-sigv4 (1.11.0) + aws-eventstream (~> 1, >= 1.0.2) + base64 (0.2.0) + bcrypt (3.1.20) + benchmark (0.4.0) + bigdecimal (3.1.9) + binding_of_caller (1.0.1) + debug_inspector (>= 1.2.0) + breadcrumbs_on_rails (4.1.0) + railties (>= 5.0) + builder (3.3.0) + byebug (11.1.3) + cama_contact_form (0.1.0) + rails + recaptcha (>= 5.0) + cama_meta_tag (1.7.2) + rails (>= 4.1.0) + cancancan (3.6.1) + capybara (3.40.0) + addressable + matrix + mini_mime (>= 0.1.3) + nokogiri (~> 1.11) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) + capybara-screenshot (1.0.26) + capybara (>= 1.0, < 4) + launchy + childprocess (5.1.0) + logger (~> 1.5) + coderay (1.1.3) + concurrent-ruby (1.3.4) + connection_pool (2.5.0) + crass (1.0.6) + dartsass-sprockets (3.2.0) + railties (>= 4.0.0) + sassc-embedded (~> 1.80.1) + sprockets (> 3.0) + sprockets-rails + tilt + date (3.4.1) + debug_inspector (1.2.0) + diff-lcs (1.5.1) + draper (4.0.2) + actionpack (>= 5.0) + activemodel (>= 5.0) + activemodel-serializers-xml (>= 1.0) + activesupport (>= 5.0) + request_store (>= 1.0) + ruby2_keywords + drb (2.2.1) + erubi (1.13.1) + factory_bot (6.5.0) + activesupport (>= 5.0.0) + factory_bot_rails (6.4.4) + factory_bot (~> 6.5) + railties (>= 5.0.0) + faker (3.5.1) + i18n (>= 1.8.11, < 2) + font-awesome-rails (4.7.0.9) + railties (>= 3.2, < 9.0) + globalid (1.2.1) + activesupport (>= 6.1) + google-protobuf (4.29.3-x86_64-darwin) + bigdecimal + rake (>= 13) + i18n (1.14.6) + concurrent-ruby (~> 1.0) + interception (0.5) + io-console (0.8.0) + ipaddress (0.8.3) + irb (1.14.3) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + jmespath (1.6.2) + jquery-rails (4.6.0) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + json (2.9.1) + language_server-protocol (3.17.0.3) + launchy (3.0.1) + addressable (~> 2.8) + childprocess (~> 5.0) + logger (1.6.5) + loofah (2.24.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.0.4) + matrix (0.4.2) + meta-tags (2.22.1) + actionpack (>= 6.0.0, < 8.1) + method_source (1.1.0) + mini_magick (5.0.1) + mini_mime (1.1.5) + minitest (5.25.4) + net-imap (0.5.5) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.5.0) + nio4r (2.7.4) + nokogiri (1.18.1-x86_64-darwin) + racc (~> 1.4) + non-digest-assets (2.5.0) + activesupport (>= 6.0, < 8.1) + sprockets (~> 4.0) + oj (3.16.9) + bigdecimal (>= 3.0) + ostruct (>= 0.2) + ostruct (0.6.1) + parallel (1.26.3) + parser (3.3.6.0) + ast (~> 2.4.1) + racc + pry (0.15.2) + coderay (~> 1.1) + method_source (~> 1.0) + pry-rescue (1.6.0) + interception (>= 0.5) + pry (>= 0.12.0) + pry-stack_explorer (0.6.1) + binding_of_caller (~> 1.0) + pry (~> 0.13) + psych (5.2.2) + date + stringio + public_suffix (6.0.1) + puma (6.5.0) + nio4r (~> 2.0) + racc (1.8.1) + rack (3.1.8) + rack-session (2.1.0) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.2.0) + rack (>= 1.3) + rack_session_access (0.2.0) + builder (>= 2.0.0) + rack (>= 1.0.0) + rackup (2.2.1) + rack (>= 3) + rails (8.0.1) + actioncable (= 8.0.1) + actionmailbox (= 8.0.1) + actionmailer (= 8.0.1) + actionpack (= 8.0.1) + actiontext (= 8.0.1) + actionview (= 8.0.1) + activejob (= 8.0.1) + activemodel (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) + bundler (>= 1.15.0) + railties (= 8.0.1) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (8.0.1) + actionpack (= 8.0.1) + activesupport (= 8.0.1) + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + rainbow (3.1.1) + rake (13.2.1) + rdoc (6.10.0) + psych (>= 4.0.0) + recaptcha (5.18.0) + regexp_parser (2.10.0) + reline (0.6.0) + io-console (~> 0.5) + request_store (1.7.0) + rack (>= 1.4) + rexml (3.4.0) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.2) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-instafail (1.0.0) + rspec + rspec-mocks (3.13.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-rails (7.1.0) + actionpack (>= 7.0) + activesupport (>= 7.0) + railties (>= 7.0) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.2) + rspec_junit_formatter (0.6.0) + rspec-core (>= 2, < 4, != 2.12.0) + rubocop (1.70.0) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.36.2, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.37.0) + parser (>= 3.3.1.0) + rubocop-rspec (3.3.0) + rubocop (~> 1.61) + ruby-progressbar (1.13.0) + ruby2_keywords (0.0.5) + rubyzip (2.4.1) + sass-embedded (1.83.1-x86_64-darwin) + google-protobuf (~> 4.29) + sassc-embedded (1.80.1) + sass-embedded (~> 1.80) + securerandom (0.4.1) + selenium-webdriver (4.27.0) + base64 (~> 0.2) + logger (~> 1.4) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) + sprockets (4.2.1) + concurrent-ruby (~> 1.0) + rack (>= 2.2.4, < 4) + sprockets-rails (3.5.2) + actionpack (>= 6.1) + activesupport (>= 6.1) + sprockets (>= 3.0.0) + sqlite3 (2.5.0-x86_64-darwin) + stringio (3.1.2) + thor (1.3.2) + tilt (2.5.0) + timeout (0.4.3) + tinymce-rails (4.9.11.1) + railties (>= 3.1.1) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (3.1.3) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) + uri (1.0.2) + useragent (0.16.11) + websocket (1.2.11) + websocket-driver (0.7.7) + base64 + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + will_paginate (4.0.1) + will_paginate-bootstrap (1.0.2) + will_paginate (>= 3.0.3) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.7.1) + +PLATFORMS + x86_64-darwin-23 + +DEPENDENCIES + byebug + camaleon_cms! + capybara + capybara-screenshot + factory_bot_rails + faker + non-digest-assets (= 2.5.0) + oj + pry-rescue + pry-stack_explorer + puma + rack_session_access + rails (~> 8.0.1) + rspec + rspec-instafail + rspec-rails + rspec_junit_formatter + rubocop + rubocop-rspec + selenium-webdriver + sprockets-rails (>= 3.5.2) + sqlite3 + +BUNDLED WITH + 2.6.2 diff --git a/app/models/camaleon_cms/post.rb b/app/models/camaleon_cms/post.rb index 41fe159c..54cf249b 100644 --- a/app/models/camaleon_cms/post.rb +++ b/app/models/camaleon_cms/post.rb @@ -83,7 +83,7 @@ def pending? # check if this is in draft status def draft? - status == 'draft' || status == 'draft_child' + %w[draft draft_child].include?(status) end def draft_child? diff --git a/app/models/camaleon_cms/post_type.rb b/app/models/camaleon_cms/post_type.rb index 00f569d5..187a0920 100644 --- a/app/models/camaleon_cms/post_type.rb +++ b/app/models/camaleon_cms/post_type.rb @@ -179,7 +179,7 @@ def set_default_site_user_roles # destroy all custom field groups assigned to this post type def destroy_field_groups - if !destroyed_by_association.present? && (slug == 'post' || slug == 'page') + if !destroyed_by_association.present? && %w[post page].include?(slug) errors.add(:base, 'This post type can not be deleted.') return false end