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