Commit 23cf5d2b authored by Martin Markech's avatar Martin Markech
Browse files

upgrade to refinerycms 3.0

parent cdee2213
source 'http://rubygems.org'
source "https://rubygems.org"
gem "refinerycms-authentication-devise", '~> 1.0.4'
gemspec
gem 'refinerycms', '~> 2.0.1'
gem 'refinerycms', '~> 3.0.0'
group :development, :test do
gem 'refinerycms-testing', '~> 2.0.0'
gem 'guard-rspec', '~> 0.6.0'
platforms :jruby do
gem 'activerecord-jdbcsqlite3-adapter'
gem 'activerecord-jdbcmysql-adapter'
gem 'activerecord-jdbcpostgresql-adapter'
gem 'jruby-openssl'
end
gem 'refinerycms-testing', '~> 3.0.0'
end
unless defined?(JRUBY_VERSION)
gem 'sqlite3'
gem 'mysql2'
gem 'pg'
end
# Add the default visual editor, for now.
gem 'refinerycms-wymeditor', ['~> 1.0', '>= 1.0.6']
platforms :mswin, :mingw do
gem 'win32console'
gem 'rb-fchange', '~> 0.0.5'
gem 'rb-notifu', '~> 0.0.4'
end
group :test do
gem 'pry'
gem 'launchy'
gem 'poltergeist'
gem 'capybara-screenshot'
end
platforms :ruby do
gem 'spork', '~> 0.9.0.rc'
gem 'guard-spork'
# Database Configuration
unless ENV['TRAVIS']
gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
gem 'sqlite3', :platform => :ruby
end
unless ENV['TRAVIS']
require 'rbconfig'
if RbConfig::CONFIG['target_os'] =~ /darwin/i
gem 'rb-fsevent', '>= 0.3.9'
gem 'ruby_gntp'
end
if RbConfig::CONFIG['target_os'] =~ /linux/i
gem 'rb-inotify', '>= 0.5.1'
gem 'libnotify', '~> 0.1.3'
gem 'therubyracer', '~> 0.9.9'
end
end
end
platforms :jruby do
unless ENV['TRAVIS']
require 'rbconfig'
if RbConfig::CONFIG['target_os'] =~ /darwin/i
gem 'ruby_gntp'
end
if RbConfig::CONFIG['target_os'] =~ /linux/i
gem 'rb-inotify', '>= 0.5.1'
gem 'libnotify', '~> 0.1.3'
end
end
end
if !ENV['TRAVIS'] || ENV['DB'] == 'postgresql'
gem 'activerecord-jdbcpostgresql-adapter', :platform => :jruby
gem 'pg', :platform => :ruby
end
# Refinery/rails should pull in the proper versions of these
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
gem 'uglifier'
end
gem 'jquery-rails'
# Load local gems according to Refinery developer preference.
if File.exist? local_gemfile = File.expand_path('../.gemfile', __FILE__)
eval File.read(local_gemfile)
end
......@@ -11,6 +11,12 @@ module Refinery
@item.title = ::I18n.t('refinery.news.copy_of') + @item.title
end
protected
def item_params
params.require(:item).permit(:title, :body, :source, :publish_date, :expiration_date, :position, :image_id, :teaser)
end
end
end
end
......
......@@ -7,29 +7,27 @@ module Refinery
attr_accessor :locale # to hold temporarily
has_many :image_pages, :as => :item, :order => 'position ASC'
has_many :images, :through => :image_pages, :order => 'position ASC'
has_many :image_pages, :as => :item
has_many :images, :through => :image_pages
has_many_page_images
belongs_to :image, :class_name => '::Refinery::Image'
attr_accessible :title, :body, :source, :publish_date, :expiration_date, :position, :image_id, :teaser
class Translation
attr_accessible :locale
end
validates :title, :publish_date, :presence => true
friendly_id :title, :use => [:slugged]
friendly_id :title, :use => [:slugged, :finders]
acts_as_indexed :fields => [:title, :body, :teaser]
default_scope order('publish_date DESC')
default_scope -> { order('publish_date DESC') }
def to_param
"#{id}-#{slug}"
"#{id}"
end
def not_published? # has the published date not yet arrived?
......
......@@ -3,8 +3,7 @@
:object => @item,
:include_object_name => true %>
<%= render "locale_picker",
:current_locale => Thread.current[:globalize_locale] if defined?(::Refinery::I18n) %>
<%= render '/refinery/admin/locale_picker', :current_locale => Globalize.locale %>
<div class='field'>
<%= f.label :title %>
......
......@@ -10,7 +10,6 @@ module Refinery
plugin.pathname = root
plugin.name = "refinerycms_news"
plugin.menu_match = /refinery\/news(\/items)?$/
plugin.activity = { :class_name => 'Refinery::News::Item' }
plugin.url = proc { Refinery::Core::Engine.routes.url_helpers.news_admin_items_path }
end
end
......
......@@ -2,7 +2,7 @@
Gem::Specification.new do |s|
s.name = %q{refinerycms-news}
s.version = %q{2.0.1}
s.version = %q{3.0.0}
s.description = %q{A really straightforward open source Ruby on Rails news engine designed for integration with Refinery CMS.}
s.date = "#{Date.today.strftime("%Y-%m-%d")}"
s.summary = %q{Ruby on Rails news engine for Refinery CMS.}
......@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- spec/*`.split("\n")
s.add_dependency 'refinerycms-core', '~> 2.0.1'
s.add_dependency 'refinerycms-settings', '~> 2.0.0'
s.add_dependency 'friendly_id', '~> 4.0.1'
s.add_dependency 'refinerycms-core', '~> 3.0.0'
s.add_dependency 'refinerycms-settings', '~> 3.0.0'
s.add_dependency 'friendly_id', '~> 5.2.0'
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment