Switch from simply_stored to simply_couch
- All models: SimplyStored::Couch → SimplyCouch::Model - Gemfile: simply_stored → simply_couch - devise_simply_stored → devise_simply_couch - Remove stale couch_potato require (not used)
This commit is contained in:
@@ -21,10 +21,10 @@ group :assets do
|
||||
gem 'momentjs-rails'
|
||||
end
|
||||
|
||||
gem 'simply_stored' , github: 'bterkuile/simply_stored', branch: 'master'
|
||||
gem 'simply_couch' , github: 'bterkuile/simply_couch', branch: 'master'
|
||||
#gem 'orm_adapter', github: 'bterkuile/orm_adapter'
|
||||
gem 'devise'
|
||||
gem 'devise_simply_stored', github: 'bterkuile/devise_simply_stored', branch: 'master'
|
||||
gem 'devise_simply_couch', github: 'bterkuile/devise_simply_couch', branch: 'master'
|
||||
gem 'slim-rails'
|
||||
gem 'paperclip', ['>= 3.4', '!= 4.3.0']
|
||||
gem 'email_validator'
|
||||
|
||||
@@ -22,7 +22,7 @@ To start using Cmtool as website CMS add it to your Gemfile. Since it depends
|
||||
on github gems and gem dependencies do not support those you have to
|
||||
explicitly add two dependencies to your Gemfile:
|
||||
gem 'couch_potato' , github: 'bterkuile/couch_potato'
|
||||
gem 'simply_stored' , github: 'bterkuile/simply_stored'
|
||||
gem 'simply_couch' , github: 'bterkuile/simply_couch'
|
||||
gem 'cmtool'
|
||||
|
||||
Make sure that the locales you want to work with are specified in
|
||||
@@ -94,7 +94,7 @@ end
|
||||
```
|
||||
|
||||
This is enough to start using Cmtool. But probably you want to add some
|
||||
goodies of your own. Remember that this is a SimplyStored model with almost
|
||||
goodies of your own. Remember that this is a SimplyCouch model with almost
|
||||
all the ActiveModel features.
|
||||
|
||||
### Page model
|
||||
|
||||
@@ -135,7 +135,7 @@ module Cmtool
|
||||
def edit_td(obj, options = {})
|
||||
path = options[:path] || case obj
|
||||
when Array then edit_polymorphic_path(obj)
|
||||
when SimplyStored::Couch then edit_polymorphic_path([options[:scope] || cmtool, obj])
|
||||
when SimplyCouch::Model then edit_polymorphic_path([options[:scope] || cmtool, obj])
|
||||
else obj
|
||||
end
|
||||
content_tag(
|
||||
@@ -148,7 +148,7 @@ module Cmtool
|
||||
def destroy_td(obj, options = {})
|
||||
path = options[:path] || case obj
|
||||
when Array then polymorphic_path(obj)
|
||||
when SimplyStored::Couch then polymorphic_path([options[:scope] || cmtool, obj])
|
||||
when SimplyCouch::Model then polymorphic_path([options[:scope] || cmtool, obj])
|
||||
else obj
|
||||
end
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module Cmtool
|
||||
class ContactForm
|
||||
include SimplyStored::Couch
|
||||
include SimplyCouch::Model
|
||||
property :gender
|
||||
property :name
|
||||
property :email
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module Cmtool
|
||||
class Directory
|
||||
include SimplyStored::Couch
|
||||
include SimplyCouch::Model
|
||||
|
||||
property :name
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module Cmtool
|
||||
class Faq
|
||||
include SimplyStored::Couch
|
||||
include SimplyCouch::Model
|
||||
|
||||
property :question
|
||||
property :answer
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
module Cmtool
|
||||
class Image
|
||||
include SimplyStored::Couch
|
||||
include SimplyCouch::Model
|
||||
include Paperclip::Glue
|
||||
# TODO: Replace Paperclip with SimplyStored::HasAttachment
|
||||
# 1. Change `include Paperclip::Glue` to `include SimplyStored::HasAttachment`
|
||||
# TODO: Replace Paperclip with SimplyCouch::HasAttachment
|
||||
# 1. Change `include Paperclip::Glue` to `include SimplyCouch::HasAttachment`
|
||||
# 2. Replace `has_attached_file :file, styles: {...}` with `has_attachment :file, styles: {...}`
|
||||
# 3. Replace `validates_attachment` with standard Rails validations
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module Cmtool
|
||||
class Keyword
|
||||
include SimplyStored::Couch
|
||||
include SimplyCouch::Model
|
||||
|
||||
property :name
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
module Cmtool
|
||||
class News
|
||||
include SimplyStored::Couch
|
||||
include SimplyCouch::Model
|
||||
include Paperclip::Glue
|
||||
# TODO: Replace Paperclip with SimplyStored::HasAttachment
|
||||
# 1. Change `include Paperclip::Glue` to `include SimplyStored::HasAttachment`
|
||||
# TODO: Replace Paperclip with SimplyCouch::HasAttachment
|
||||
# 1. Change `include Paperclip::Glue` to `include SimplyCouch::HasAttachment`
|
||||
# 2. Replace `has_attached_file :image, styles: {...}` with `has_attachment :image, styles: {...}`
|
||||
|
||||
property :title
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module Cmtool
|
||||
class NewsletterSubscription
|
||||
include SimplyStored::Couch
|
||||
include SimplyCouch::Model
|
||||
|
||||
# PROPERTIES
|
||||
property :email
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
module Cmtool
|
||||
class Quote
|
||||
include SimplyStored::Couch
|
||||
include SimplyCouch::Model
|
||||
include Paperclip::Glue
|
||||
# TODO: Replace Paperclip with SimplyStored::HasAttachment
|
||||
# 1. Change `include Paperclip::Glue` to `include SimplyStored::HasAttachment`
|
||||
# TODO: Replace Paperclip with SimplyCouch::HasAttachment
|
||||
# 1. Change `include Paperclip::Glue` to `include SimplyCouch::HasAttachment`
|
||||
# 2. Replace `has_attached_file :image, styles: {...}` with `has_attachment :image, styles: {...}`
|
||||
|
||||
property :owner
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module Cmtool
|
||||
class YmlFile
|
||||
include SimplyStored::Couch
|
||||
include SimplyCouch::Model
|
||||
|
||||
property :name
|
||||
property :body
|
||||
|
||||
+2
-2
@@ -10,8 +10,8 @@ require 'email_validator'
|
||||
# Paperclip replacement — stores file metadata as CouchDB properties,
|
||||
# handles thumbnail generation via MiniMagick.
|
||||
# Replace `include Paperclip::Glue` + `has_attached_file` with
|
||||
# `include SimplyStored::HasAttachment` + `has_attachment`
|
||||
# has_attachment now in simply_stored gem
|
||||
# `include SimplyCouch::HasAttachment` + `has_attachment`
|
||||
# has_attachment now in simply_couch gem
|
||||
|
||||
module Cmtool
|
||||
end
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
=begin
|
||||
require 'couch_potato'
|
||||
require 'simply_stored'
|
||||
require 'simply_couch'
|
||||
require 'email_validator'
|
||||
require 'devise'
|
||||
require 'devise_simply_stored'
|
||||
require 'devise_simply_couch'
|
||||
require 'sass-rails'
|
||||
require 'paperclip'
|
||||
require 'jquery-rails'
|
||||
@@ -19,7 +18,7 @@ module Cmtool
|
||||
# require 'slim-rails'
|
||||
# require 'paperclip'
|
||||
# require 'devise'
|
||||
# require 'devise_simply_stored'
|
||||
# require 'devise_simply_couch'
|
||||
# require 'jquery-rails'
|
||||
# # require 'tinymce-rails'
|
||||
#
|
||||
|
||||
@@ -2,7 +2,7 @@ module Cmtool
|
||||
module Includes
|
||||
module Page
|
||||
def self.included(klass)
|
||||
klass.send :include, SimplyStored::Couch
|
||||
klass.send :include, SimplyCouch::Model
|
||||
klass.send :include, InstanceMethods
|
||||
klass.send :extend, ClassMethods
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ module Cmtool
|
||||
module Includes
|
||||
module User
|
||||
def self.included(klass)
|
||||
klass.send :include, SimplyStored::Couch
|
||||
#klass.send :include, Devise::Orm::SimplyStored
|
||||
klass.send :include, SimplyCouch::Model
|
||||
#klass.send :include, Devise::Orm::SimplyCouch
|
||||
klass.send :include, InstanceMethods
|
||||
klass.send :extend, ClassMethods
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ Devise.setup do |config|
|
||||
# Load and configure the ORM. Supports :active_record (default) and
|
||||
# :mongoid (bson_ext recommended) by default. Other ORMs may be
|
||||
# available as additional gems.
|
||||
#require 'devise/orm/simply_stored'
|
||||
require 'orm_adapter/adapters/simply_stored'
|
||||
#require 'devise/orm/simply_couch'
|
||||
require 'orm_adapter/adapters/simply_couch'
|
||||
|
||||
# ==> Configuration for any authentication mechanism
|
||||
# Configure which keys are used when authenticating a user. The default is
|
||||
|
||||
Reference in New Issue
Block a user