alchemy_cms 3.1.0.beta3 → 3.1.0.beta4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/README.md +54 -58
- data/alchemy_cms.gemspec +25 -25
- data/app/controllers/alchemy/admin/base_controller.rb +5 -0
- data/app/controllers/alchemy/admin/dashboard_controller.rb +3 -5
- data/app/controllers/alchemy/admin/resources_controller.rb +1 -1
- data/app/controllers/alchemy/base_controller.rb +9 -9
- data/app/controllers/alchemy/pages_controller.rb +1 -1
- data/app/views/alchemy/{base → admin}/leave.html.erb +0 -0
- data/config/initializers/simple_form.rb +1 -1
- data/config/routes.rb +1 -1
- data/lib/alchemy/auth_accessors.rb +25 -4
- data/lib/alchemy/engine.rb +0 -3
- data/lib/alchemy/permissions.rb +1 -0
- data/lib/alchemy/resource.rb +10 -1
- data/lib/alchemy/upgrader/three_point_one.rb +13 -1
- data/lib/alchemy/version.rb +1 -1
- data/spec/controllers/admin/dashboard_controller_spec.rb +0 -1
- data/spec/controllers/admin/resources_controller_spec.rb +16 -0
- data/spec/features/admin/navigation_feature_spec.rb +13 -0
- data/spec/features/security_spec.rb +14 -2
- data/spec/libraries/auth_accessors_spec.rb +18 -4
- data/spec/libraries/permissions_spec.rb +4 -0
- data/spec/libraries/resource_spec.rb +6 -0
- data/spec/models/element_spec.rb +15 -5
- data/spec/spec_helper.rb +1 -0
- metadata +106 -104
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c7ef4a778e3a0130f1c0422d5a51d5d3c256f2f
|
4
|
+
data.tar.gz: 91ec8dc7bf118c1f1f315e81410d5edc7477d4ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44cd5e491679b63345d203a96d8695f4001583b27d53e78d2579fbca611b5d6cb8c6e86b9339e66436e54e0ff811f70fcf23021244e79e74429f0fff59109646
|
7
|
+
data.tar.gz: 0fcdb8fdbfc4077baa2f874e07b8de953ba43e5638ca0f38fdb348fda50ead3a0ecfeb5ddc0cf4b684f76ab3293ea57969c5a6c46ce0890b846c043851272c8b
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
[![Gem Version](https://badge.fury.io/rb/alchemy_cms.
|
2
|
-
[![Build Status](https://travis-ci.org/
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/alchemy_cms.svg)](http://badge.fury.io/rb/alchemy_cms)
|
2
|
+
[![Build Status](https://travis-ci.org/AlchemyCMS/alchemy_cms.svg?branch=master)](https://travis-ci.org/AlchemyCMS/alchemy_cms) [![Code Climate](https://codeclimate.com/github/AlchemyCMS/alchemy_cms.svg)](https://codeclimate.com/github/AlchemyCMS/alchemy_cms) [![Coverage Status](https://img.shields.io/coveralls/AlchemyCMS/alchemy_cms.svg)](https://coveralls.io/r/AlchemyCMS/alchemy_cms?branch=master)
|
3
3
|
|
4
|
-
**CAUTION: This master branch is a development branch that can contain bugs. For productive environments you should use the [current Ruby gem version](https://rubygems.org/gems/alchemy_cms/versions/3.0.0), or the [latest stable branch (3.0-stable)](https://github.com/
|
4
|
+
**CAUTION: This master branch is a development branch that can contain bugs. For productive environments you should use the [current Ruby gem version](https://rubygems.org/gems/alchemy_cms/versions/3.0.0), or the [latest stable branch (3.0-stable)](https://github.com/AlchemyCMS/alchemy_cms/tree/3.0-stable).**
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
|
7
|
+
## About
|
8
8
|
|
9
9
|
![Alchemy CMS](http://alchemy-cms.com/assets/alchemy_logo.svg)
|
10
10
|
|
@@ -12,8 +12,8 @@ Alchemy is a powerful, flexible and user centric Rails CMS.
|
|
12
12
|
|
13
13
|
Read more about Alchemy on the [website](http://alchemy-cms.com) and in the [guidelines](http://guides.alchemy-cms.com).
|
14
14
|
|
15
|
-
|
16
|
-
|
15
|
+
|
16
|
+
## Features
|
17
17
|
|
18
18
|
- Highly flexible templating that completely separates content from markup
|
19
19
|
- End-User centric graphical user interface
|
@@ -28,28 +28,27 @@ Features
|
|
28
28
|
- Flexible caching
|
29
29
|
- Hostable on any Server that supports Ruby on Rails, a SQL Database and ImageMagick
|
30
30
|
|
31
|
-
|
32
|
-
|
31
|
+
|
32
|
+
## Rails Version
|
33
33
|
|
34
34
|
**This version of Alchemy CMS runs with Rails 4 (including 4.1)**
|
35
35
|
|
36
|
-
**Rails 4.2 support is coming soon. Watch [this pull request](https://github.com/
|
36
|
+
**Rails 4.2 support is coming soon. Watch [this pull request](https://github.com/AlchemyCMS/alchemy_cms/pull/655).**
|
37
|
+
|
38
|
+
* For a Rails 3.2 compatible version use the [`2.8-stable` branch](https://github.com/AlchemyCMS/alchemy_cms/tree/2.8-stable).
|
39
|
+
* For a Rails 3.1 compatible version use the [`2.1-stable` branch](https://github.com/AlchemyCMS/alchemy_cms/tree/2.1-stable).
|
40
|
+
* For a Rails 3.0 compatible version use the [`2.0-stable` branch](https://github.com/AlchemyCMS/alchemy_cms/tree/2.0-stable).
|
41
|
+
* For a Rails 2.3 compatible version use the [`1.6-stable` branch](https://github.com/AlchemyCMS/alchemy_cms/tree/1.6-stable).
|
37
42
|
|
38
|
-
* For a Rails 3.2 compatible version use the [`2.8-stable` branch](https://github.com/magiclabs/alchemy_cms/tree/2.8-stable).
|
39
|
-
* For a Rails 3.1 compatible version use the [`2.1-stable` branch](https://github.com/magiclabs/alchemy_cms/tree/2.1-stable).
|
40
|
-
* For a Rails 3.0 compatible version use the [`2.0-stable` branch](https://github.com/magiclabs/alchemy_cms/tree/2.0-stable).
|
41
|
-
* For a Rails 2.3 compatible version use the [`1.6-stable` branch](https://github.com/magiclabs/alchemy_cms/tree/1.6-stable).
|
42
43
|
|
43
|
-
Ruby Version
|
44
|
-
------------
|
44
|
+
## Ruby Version
|
45
45
|
|
46
46
|
Alchemy runs with Ruby >= 1.9.3 (including Ruby 2.0 and 2.1).
|
47
47
|
|
48
|
-
For a Ruby 1.8.7 compatible version use the [`2.3-stable` branch](https://github.com/
|
48
|
+
For a Ruby 1.8.7 compatible version use the [`2.3-stable` branch](https://github.com/AlchemyCMS/alchemy_cms/tree/2.3-stable).
|
49
49
|
|
50
50
|
|
51
|
-
Installation
|
52
|
-
------------
|
51
|
+
## Installation
|
53
52
|
|
54
53
|
### Install as a standalone project
|
55
54
|
|
@@ -75,7 +74,7 @@ $ alchemy --help
|
|
75
74
|
Put this into your `Gemfile`:
|
76
75
|
|
77
76
|
```ruby
|
78
|
-
gem 'alchemy_cms', github: '
|
77
|
+
gem 'alchemy_cms', github: 'AlchemyCMS/alchemy_cms', branch: 'master'
|
79
78
|
```
|
80
79
|
|
81
80
|
**NOTE:** You normally want to use a stable branch, like `3.0-stable`.
|
@@ -97,14 +96,14 @@ $ bundle install
|
|
97
96
|
#### 3. Set the authentication user
|
98
97
|
|
99
98
|
Now you have to decide, if you want to use your own user model or if you want to use
|
100
|
-
the Devise based user model that Alchemy provides and was extracted [into its own gem](https://github.com/
|
99
|
+
the Devise based user model that Alchemy provides and was extracted [into its own gem](https://github.com/AlchemyCMS/alchemy-devise).
|
101
100
|
|
102
101
|
##### Use Alchemy user
|
103
102
|
|
104
103
|
If you don't have your own user class, you can use the Alchemy user model. Just add the following gem into your `Gemfile`:
|
105
104
|
|
106
105
|
```ruby
|
107
|
-
gem 'alchemy-devise', github: '
|
106
|
+
gem 'alchemy-devise', github: 'AlchemyCMS/alchemy-devise', branch: 'master'
|
108
107
|
```
|
109
108
|
|
110
109
|
**NOTE:** You normally want to use a stable branch, like `2.0-stable`.
|
@@ -125,6 +124,7 @@ The best practice is to use an initializer:
|
|
125
124
|
```ruby
|
126
125
|
# config/initializers/alchemy.rb
|
127
126
|
Alchemy.user_class_name = 'YourUserClass' # Defaults to 'User'
|
127
|
+
Alchemy.signup_path = '/your/signup/path' # Defaults to '/signup'
|
128
128
|
Alchemy.login_path = '/your/login/path' # Defaults to '/login'
|
129
129
|
Alchemy.logout_path = '/your/logout/path' # Defaults to '/logout'
|
130
130
|
```
|
@@ -133,7 +133,7 @@ The only thing Alchemy needs to know from your user class is the `alchemy_roles`
|
|
133
133
|
|
134
134
|
This method has to return an `Array` (or `ActiveRecord::Relation`) with at least one of the following roles: `member`, `author`, `editor`, `admin`.
|
135
135
|
|
136
|
-
Example
|
136
|
+
##### Example
|
137
137
|
|
138
138
|
```ruby
|
139
139
|
# app/models/user.rb
|
@@ -162,14 +162,17 @@ Now everything should be set up and you should be able to visit the Alchemy Dash
|
|
162
162
|
*) Use your custom path if you mounted Alchemy at something else then `'/'`
|
163
163
|
|
164
164
|
|
165
|
-
Customizing
|
166
|
-
-----------
|
165
|
+
## Customizing
|
167
166
|
|
168
167
|
Alchemy has very flexible ways to organize and manage content. Please be sure to read [the introduction guide](http://guides.alchemy-cms.com/edge/index.html) in order to understand the basic idea of how Alchemy works.
|
169
168
|
|
170
169
|
|
171
|
-
|
172
|
-
|
170
|
+
### Custom Controllers
|
171
|
+
|
172
|
+
Beginning with Alchemy 3.1 we do not patch the `ApplicationController` anymore. If you have controllers that loads Alchemy content or uses Alchemy helpers in the views (i.e. `render_navigation` or `render_elements`) you can either inherit from `Alchemy::BaseController` or you `include Alchemy::ControllerActions` in your controller (**that's the recommended way**).
|
173
|
+
|
174
|
+
|
175
|
+
## Upgrading
|
173
176
|
|
174
177
|
The Alchemy team takes upgrades very seriously and tries to make them as smooth as we can. Therefore we have build in upgrade tasks, that try to automate as much as possible.
|
175
178
|
|
@@ -187,12 +190,11 @@ Always be sure to keep an eye on the `config/alchemy/config.yml.defaults` file a
|
|
187
190
|
Also, `git diff` is your friend. You are using git to track changes of your projects, right?
|
188
191
|
|
189
192
|
|
190
|
-
Deployment
|
191
|
-
----------
|
193
|
+
## Deployment
|
192
194
|
|
193
195
|
Alchemy ships with Capistrano based deployment receipts which takes care of everything you need to deploy an Alchemy site.
|
194
196
|
|
195
|
-
|
197
|
+
### 1. Add Capistrano gem
|
196
198
|
|
197
199
|
First you need to add Capistrano to your `Gemfile`:
|
198
200
|
|
@@ -203,9 +205,9 @@ gem 'capistrano', '2.15.5', group: 'development'
|
|
203
205
|
|
204
206
|
**A note about Capistrano version:**
|
205
207
|
|
206
|
-
Alchemy's deploy script is currently **only compatible with Capistrano 2.x** ([See this pull request](https://github.com/
|
208
|
+
Alchemy's deploy script is currently **only compatible with Capistrano 2.x** ([See this pull request](https://github.com/AlchemyCMS/alchemy_cms/pull/616) if you want to help us upgrade to 3.x).
|
207
209
|
|
208
|
-
|
210
|
+
### 2. Generate the deploy file
|
209
211
|
|
210
212
|
To generate the deploy file you need to use this generator:
|
211
213
|
|
@@ -222,7 +224,7 @@ If you *have your own Capistrano receipts* you can require the Alchemy tasks in
|
|
222
224
|
require 'alchemy/capistrano'
|
223
225
|
```
|
224
226
|
|
225
|
-
|
227
|
+
### Synchronize your data
|
226
228
|
|
227
229
|
Alchemy Capistrano receipts offer much more then only deployment related tasks. We also have tasks to make your local development easier. To get a list of all receipts type:
|
228
230
|
|
@@ -230,7 +232,7 @@ Alchemy Capistrano receipts offer much more then only deployment related tasks.
|
|
230
232
|
$ bundle exec cap -T alchemy
|
231
233
|
```
|
232
234
|
|
233
|
-
|
235
|
+
#### Import data from server
|
234
236
|
|
235
237
|
```shell
|
236
238
|
$ bundle exec cap alchemy:import:all
|
@@ -238,7 +240,7 @@ $ bundle exec cap alchemy:import:all
|
|
238
240
|
|
239
241
|
This imports your servers data onto your local development machine. This is very handy if you want to clone the current server state.
|
240
242
|
|
241
|
-
|
243
|
+
#### Export data to server
|
242
244
|
|
243
245
|
That even works the other way around:
|
244
246
|
|
@@ -248,17 +250,16 @@ $ bundle exec cap alchemy:export:all
|
|
248
250
|
|
249
251
|
**NOTE:** This will **overwrite the database** on your server. But calm down my dear friend, Alchemy will ask you to perform a backup before overwriting it.
|
250
252
|
|
251
|
-
|
253
|
+
### Without Capistrano
|
252
254
|
|
253
255
|
If you don't use Capistrano you have to **make sure** that the `uploads`, `tmp/cache/assets`, `public/assets` and `public/pictures` folders get **shared between deployments**, otherwise you **will loose data**. No, not really, but you know, just keep them in sync.
|
254
256
|
|
255
|
-
Please take a look into Alchemys [Capistrano receipt](https://github.com/
|
257
|
+
Please take a look into Alchemys [Capistrano receipt](https://github.com/AlchemyCMS/alchemy_cms/blob/master/lib/alchemy/capistrano.rb) in order to see how you could achieve this.
|
256
258
|
|
257
259
|
|
258
|
-
Testing
|
259
|
-
-------
|
260
|
+
## Testing
|
260
261
|
|
261
|
-
If you want to contribute to Alchemy ([and we encourage you to do so](https://github.com/
|
262
|
+
If you want to contribute to Alchemy ([and we encourage you to do so](https://github.com/AlchemyCMS/alchemy_cms/blob/master/CONTRIBUTING.md)) we have a strong test suite that helps you to not break anything.
|
262
263
|
|
263
264
|
To prepare the tests of your Alchemy fork please make sure to run the preparation task:
|
264
265
|
|
@@ -269,7 +270,7 @@ $ bin/rake alchemy:spec:prepare
|
|
269
270
|
|
270
271
|
to set up the database for testing.
|
271
272
|
|
272
|
-
|
273
|
+
### Run your tests with:
|
273
274
|
|
274
275
|
```shell
|
275
276
|
$ bundle exec rspec
|
@@ -288,34 +289,31 @@ $ bundle exec rake
|
|
288
289
|
Alchemy specs are written **in RSpec 3**. Please **do not use deprecated RSpec 2.x syntax**. Thanks
|
289
290
|
|
290
291
|
|
291
|
-
Getting Help
|
292
|
-
------------
|
292
|
+
## Getting Help
|
293
293
|
|
294
294
|
* Read the guidelines: http://guides.alchemy-cms.com.
|
295
|
-
* Read the documentation: http://rubydoc.info/github/
|
296
|
-
* If you found a bug please use the [issue tracker on Github](https://github.com/
|
295
|
+
* Read the documentation: http://rubydoc.info/github/AlchemyCMS/alchemy_cms
|
296
|
+
* If you found a bug please use the [issue tracker on Github](https://github.com/AlchemyCMS/alchemy_cms/issues).
|
297
297
|
* For questions about general usage please use [Stack Overflow](http://stackoverflow.com/questions/tagged/alchemy-cms), [the User Group](http://groups.google.com/group/alchemy-cms) or the [IRC channel](irc://irc.freenode.net#alchemy_cms).
|
298
298
|
* New features should be discussed on our [Trello Board](https://trello.com/alchemycms).
|
299
299
|
|
300
|
-
**PLEASE** don't use the Github issues for feature requests. If you want to contribute to Alchemy please [read the contribution guidelines](https://github.com/
|
300
|
+
**PLEASE** don't use the Github issues for feature requests. If you want to contribute to Alchemy please [read the contribution guidelines](https://github.com/AlchemyCMS/alchemy_cms/blob/master/CONTRIBUTING.md) before doing so.
|
301
301
|
|
302
302
|
|
303
|
-
Resources
|
304
|
-
---------
|
303
|
+
## Resources
|
305
304
|
|
306
305
|
* Homepage: <http://alchemy-cms.com>
|
307
306
|
* Live-Demo: <http://demo.alchemy-cms.com> (user: demo, password: demo123)
|
308
|
-
* API Documentation: <http://rubydoc.info/github/
|
309
|
-
* Issue-Tracker: <https://github.com/
|
310
|
-
* Sourcecode: <https://github.com/
|
307
|
+
* API Documentation: <http://rubydoc.info/github/AlchemyCMS/alchemy_cms>
|
308
|
+
* Issue-Tracker: <https://github.com/AlchemyCMS/alchemy_cms/issues>
|
309
|
+
* Sourcecode: <https://github.com/AlchemyCMS/alchemy_cms>
|
311
310
|
* User Group: <http://groups.google.com/group/alchemy-cms>
|
312
311
|
* IRC Channel: <irc://irc.freenode.net#alchemy_cms>
|
313
312
|
* Discussion Board: <https://trello.com/alchemycms>
|
314
313
|
* Twitter: <https://twitter.com/alchemy_cms>
|
315
314
|
|
316
315
|
|
317
|
-
Authors
|
318
|
-
---------
|
316
|
+
## Authors
|
319
317
|
|
320
318
|
* Thomas von Deyen: <https://github.com/tvdeyen>
|
321
319
|
* Robin Böning: <https://github.com/robinboening>
|
@@ -324,16 +322,14 @@ Authors
|
|
324
322
|
* Carsten Fregin: <https://github.com/cfregin>
|
325
323
|
|
326
324
|
|
327
|
-
License
|
328
|
-
-------
|
325
|
+
## License
|
329
326
|
|
330
327
|
* BSD: <https://raw.github.com/magiclabs/alchemy_cms/master/LICENSE>
|
331
328
|
|
332
329
|
|
333
|
-
Spread the love
|
334
|
-
---------------
|
330
|
+
## Spread the love
|
335
331
|
|
336
|
-
If you like Alchemy, please help us to spread the word about Alchemy and star this repo [on GitHub](https://github.com/
|
332
|
+
If you like Alchemy, please help us to spread the word about Alchemy and star this repo [on GitHub](https://github.com/AlchemyCMS/alchemy_cms), upvote it [on The Ruby Toolbox](https://www.ruby-toolbox.com/projects/alchemy_cms), mention us [on Twitter](https://twitter.com/alchemy_cms) and vote for it [on Bitnami](https://bitnami.com/stack/alchemy).
|
337
333
|
|
338
334
|
That will help us to keep Alchemy awesome.
|
339
335
|
|
data/alchemy_cms.gemspec
CHANGED
@@ -19,35 +19,35 @@ Gem::Specification.new do |gem|
|
|
19
19
|
gem.executables = 'alchemy'
|
20
20
|
gem.require_paths = ['lib']
|
21
21
|
|
22
|
-
gem.add_runtime_dependency '
|
23
|
-
gem.add_runtime_dependency '
|
24
|
-
gem.add_runtime_dependency '
|
25
|
-
gem.add_runtime_dependency 'acts-as-taggable-on', '~> 3.1'
|
26
|
-
gem.add_runtime_dependency '
|
27
|
-
gem.add_runtime_dependency '
|
28
|
-
gem.add_runtime_dependency '
|
29
|
-
gem.add_runtime_dependency '
|
30
|
-
gem.add_runtime_dependency '
|
31
|
-
gem.add_runtime_dependency '
|
32
|
-
gem.add_runtime_dependency 'jquery-rails',
|
33
|
-
gem.add_runtime_dependency '
|
34
|
-
gem.add_runtime_dependency '
|
35
|
-
gem.add_runtime_dependency '
|
36
|
-
gem.add_runtime_dependency '
|
37
|
-
gem.add_runtime_dependency '
|
38
|
-
gem.add_runtime_dependency '
|
39
|
-
gem.add_runtime_dependency '
|
40
|
-
gem.add_runtime_dependency 'select2-rails', '>= 3.5.9.1', '< 4.0'
|
41
|
-
gem.add_runtime_dependency '
|
22
|
+
gem.add_runtime_dependency 'actionpack-page_caching', ['~> 1.0.0']
|
23
|
+
gem.add_runtime_dependency 'active_model_serializers', ['>= 0.8.1', '< 0.9.1']
|
24
|
+
gem.add_runtime_dependency 'acts_as_list', ['~> 0.3']
|
25
|
+
gem.add_runtime_dependency 'acts-as-taggable-on', ['~> 3.1']
|
26
|
+
gem.add_runtime_dependency 'awesome_nested_set', ['~> 3.0.0']
|
27
|
+
gem.add_runtime_dependency 'cancancan', ['~> 1.9']
|
28
|
+
gem.add_runtime_dependency 'coffee-rails', ['~> 4.0']
|
29
|
+
gem.add_runtime_dependency 'compass-rails', ['>= 1.1.2']
|
30
|
+
gem.add_runtime_dependency 'dragonfly', ['~> 1.0.1']
|
31
|
+
gem.add_runtime_dependency 'jquery-rails', ['~> 3.1.0']
|
32
|
+
gem.add_runtime_dependency 'jquery-ui-rails', ['~> 5.0.0']
|
33
|
+
gem.add_runtime_dependency 'kaminari', ['~> 0.15']
|
34
|
+
gem.add_runtime_dependency 'magiclabs-userstamp', ['~> 2.1.0']
|
35
|
+
gem.add_runtime_dependency 'non-stupid-digest-assets', ['~> 1.0.3']
|
36
|
+
gem.add_runtime_dependency 'rails', ['>= 4.0', '< 4.2']
|
37
|
+
gem.add_runtime_dependency 'request_store', ['~> 1.1.0']
|
38
|
+
gem.add_runtime_dependency 'sass-rails', ['~> 4.0.5']
|
39
|
+
gem.add_runtime_dependency 'sassy-buttons', ['~> 0.2.6']
|
40
|
+
gem.add_runtime_dependency 'select2-rails', ['>= 3.5.9.1', '< 4.0']
|
41
|
+
gem.add_runtime_dependency 'simple_form', ['~> 3.0']
|
42
42
|
gem.add_runtime_dependency 'spinner.rb'
|
43
|
-
gem.add_runtime_dependency '
|
44
|
-
gem.add_runtime_dependency '
|
45
|
-
gem.add_runtime_dependency '
|
46
|
-
gem.add_runtime_dependency '
|
43
|
+
gem.add_runtime_dependency 'sprockets', ['~> 2.11.3']
|
44
|
+
gem.add_runtime_dependency 'turbolinks', ['~> 2.5']
|
45
|
+
gem.add_runtime_dependency 'tvdeyen-handles_sortable_columns', ['~> 0.1.5']
|
46
|
+
gem.add_runtime_dependency 'uglifier', ['>= 1.3.0']
|
47
47
|
|
48
|
-
gem.add_development_dependency 'rspec-rails', '~> 3.0'
|
49
48
|
gem.add_development_dependency 'capybara'
|
50
49
|
gem.add_development_dependency 'factory_girl_rails'
|
50
|
+
gem.add_development_dependency 'rspec-rails', ['~> 3.0']
|
51
51
|
|
52
52
|
gem.post_install_message =<<-MSG
|
53
53
|
-------------------------------------------------------------
|
@@ -66,14 +66,14 @@ module Alchemy
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
-
# Query the RubyGems API for
|
69
|
+
# Query the RubyGems API for Alchemy versions.
|
70
70
|
def query_rubygems
|
71
71
|
make_api_request('https://rubygems.org/api/v1/versions/alchemy_cms.json')
|
72
72
|
end
|
73
73
|
|
74
|
-
# Query the GitHub API for
|
74
|
+
# Query the GitHub API for Alchemy tags.
|
75
75
|
def query_github
|
76
|
-
make_api_request('https://api.github.com/repos/
|
76
|
+
make_api_request('https://api.github.com/repos/AlchemyCMS/alchemy_cms/tags')
|
77
77
|
end
|
78
78
|
|
79
79
|
# Make a HTTP API request for given request url.
|
@@ -82,10 +82,8 @@ module Alchemy
|
|
82
82
|
request = Net::HTTP::Get.new(url.path)
|
83
83
|
connection = Net::HTTP.new(url.host, url.port)
|
84
84
|
connection.use_ssl = true
|
85
|
-
connection.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
86
85
|
connection.request(request)
|
87
86
|
end
|
88
|
-
|
89
87
|
end
|
90
88
|
end
|
91
89
|
end
|
@@ -149,7 +149,7 @@ module Alchemy
|
|
149
149
|
def query_items(items)
|
150
150
|
query = params[:query].downcase.split(' ').join('%')
|
151
151
|
query = ActiveRecord::Base.sanitize("%#{query}%")
|
152
|
-
items.where(search_query(query))
|
152
|
+
items.eager_load(resource_handler.model_association_names).where(search_query(query))
|
153
153
|
end
|
154
154
|
|
155
155
|
# Returns a search query string
|
@@ -2,6 +2,7 @@
|
|
2
2
|
#
|
3
3
|
module Alchemy
|
4
4
|
class BaseController < ApplicationController
|
5
|
+
include Alchemy::ControllerActions
|
5
6
|
include Alchemy::Modules
|
6
7
|
|
7
8
|
protect_from_forgery
|
@@ -17,10 +18,6 @@ module Alchemy
|
|
17
18
|
permission_denied(exception)
|
18
19
|
end
|
19
20
|
|
20
|
-
def leave
|
21
|
-
render layout: !request.xhr?
|
22
|
-
end
|
23
|
-
|
24
21
|
private
|
25
22
|
|
26
23
|
# Sets +I18n.locale+ to current Alchemy language.
|
@@ -77,20 +74,23 @@ module Alchemy
|
|
77
74
|
#
|
78
75
|
# === Usage
|
79
76
|
#
|
80
|
-
# #config.yml
|
77
|
+
# # config/alchemy/config.yml
|
78
|
+
# ...
|
81
79
|
# require_ssl: true
|
80
|
+
# ...
|
82
81
|
#
|
83
82
|
# === Note
|
84
83
|
#
|
85
|
-
# You have to create a ssl certificate
|
84
|
+
# You have to create a ssl certificate
|
85
|
+
# if you want to use the ssl protection.
|
86
86
|
#
|
87
87
|
def ssl_required?
|
88
|
-
|
88
|
+
!Rails.env.test? && configuration(:require_ssl)
|
89
89
|
end
|
90
90
|
|
91
|
-
# Redirects request to
|
91
|
+
# Redirects current request to https.
|
92
92
|
def enforce_ssl
|
93
|
-
redirect_to url_for(protocol: 'https')
|
93
|
+
redirect_to url_for(request.params.merge(protocol: 'https'))
|
94
94
|
end
|
95
95
|
|
96
96
|
protected
|