comfortable_mexican_sofa 1.2.4 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +5 -3
- data/VERSION +1 -1
- data/app/controllers/cms_admin/sites_controller.rb +2 -1
- data/app/controllers/cms_admin/uploads_controller.rb +2 -0
- data/comfortable_mexican_sofa.gemspec +2 -2
- data/lib/tasks/comfortable_mexican_sofa.rake +12 -11
- data/test/integration/fixtures_test.rb +0 -1
- metadata +3 -3
data/README.md
CHANGED
@@ -144,13 +144,15 @@ You can put this module in /config/initializers/comfortable\_mexican\_sofa.rb an
|
|
144
144
|
|
145
145
|
Working with Fixtures
|
146
146
|
---------------------
|
147
|
-
Sofa allows you to build entire site using files instead of updating database via admin area. This significantly speeds up initial content population.
|
147
|
+
Sofa allows you to build entire site using files instead of updating database via admin area. This significantly speeds up initial content population. Go to the initializer and set this to enable fixtures in development environment: `config.enable_fixtures = Rails.env.development?`. You may also change the folder that is used to store fixtures.
|
148
148
|
|
149
|
-
If you run `rails g cms` you should find an example set of fixtures in [/db/cms\_fixtures](https://github.com/twg/comfortable-mexican-sofa/blob/master/db/cms_fixtures).
|
149
|
+
If you run `rails g cms` you should find an example set of fixtures in [/db/cms\_fixtures](https://github.com/twg/comfortable-mexican-sofa/blob/master/db/cms_fixtures).
|
150
150
|
|
151
151
|
When fixtures are enabled, database is updated with each request, but only if fixture file is newer than the database entry. Database is also purged of items that are not defined in fixtures. So be careful not to clear out your database by mistake.
|
152
152
|
|
153
|
-
|
153
|
+
To load fixtures into the database just run this rake task: `rake comfortable_mexican_sofa:fixtures:import FROM=example.local TO=example.com`. `from` indicates folder the fixtures are in and `to` is the Site hostname you have defined in the database.
|
154
|
+
|
155
|
+
If you need to dump database contents into fixture files run: `rake comfortable_mexican_sofa:fixtures:import FROM=example.com TO=example.local`. This will create example.local folder and dump all content from example.com Site.
|
154
156
|
|
155
157
|
Active Components
|
156
158
|
-----------------
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.5
|
@@ -1,6 +1,7 @@
|
|
1
1
|
class CmsAdmin::SitesController < CmsAdmin::BaseController
|
2
2
|
|
3
|
-
skip_before_filter
|
3
|
+
skip_before_filter :load_admin_cms_site,
|
4
|
+
:load_fixtures
|
4
5
|
|
5
6
|
before_filter :build_cms_site, :only => [:new, :create]
|
6
7
|
before_filter :load_cms_site, :only => [:edit, :update, :destroy]
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{comfortable_mexican_sofa}
|
8
|
-
s.version = "1.2.
|
8
|
+
s.version = "1.2.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Oleg Khabarov", "The Working Group Inc"]
|
12
|
-
s.date = %q{2011-05-
|
12
|
+
s.date = %q{2011-05-30}
|
13
13
|
s.description = %q{}
|
14
14
|
s.email = %q{oleg@theworkinggroup.ca}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -6,24 +6,25 @@ end
|
|
6
6
|
namespace :comfortable_mexican_sofa do
|
7
7
|
namespace :fixtures do
|
8
8
|
|
9
|
-
desc 'Import Fixture data into database (options:
|
9
|
+
desc 'Import Fixture data into database (options: FROM=example.local TO=example.com)'
|
10
10
|
task :import => :environment do |task, args|
|
11
|
-
|
12
|
-
|
13
|
-
abort "Site with hostname [#{hostname}] not found. Aborting." if !site
|
11
|
+
to = args[:to] || args[:from]
|
12
|
+
from = args[:from]
|
14
13
|
|
15
|
-
|
16
|
-
|
14
|
+
abort "Site with hostname [#{to}] not found. Aborting." if !Cms::Site.find_by_hostname(to)
|
15
|
+
puts "Importing from Folder [#{from}] to Site [#{to}] ..."
|
16
|
+
ComfortableMexicanSofa::Fixtures.import_all(to, from)
|
17
17
|
puts 'Done!'
|
18
18
|
end
|
19
19
|
|
20
|
-
desc 'Export database data into Fixtures (options:
|
20
|
+
desc 'Export database data into Fixtures (options: FROM=example.com TO=example.local)'
|
21
21
|
task :export => :environment do |task, args|
|
22
|
-
|
23
|
-
|
22
|
+
to = args[:to] || args[:from]
|
23
|
+
from = args[:from]
|
24
24
|
|
25
|
-
|
26
|
-
|
25
|
+
abort "Site with hostname [#{from}] not found. Aborting." if !Cms::Site.find_by_hostname(from)
|
26
|
+
puts "Exporting from Site [#{from}] to Folder [#{to}] ..."
|
27
|
+
ComfortableMexicanSofa::Fixtures.export_all(from, to)
|
27
28
|
puts 'Done!'
|
28
29
|
end
|
29
30
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: comfortable_mexican_sofa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.2.
|
5
|
+
version: 1.2.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Oleg Khabarov
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2011-05-
|
14
|
+
date: 2011-05-30 00:00:00 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|
@@ -325,7 +325,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
325
325
|
requirements:
|
326
326
|
- - ">="
|
327
327
|
- !ruby/object:Gem::Version
|
328
|
-
hash:
|
328
|
+
hash: 2921441635492529325
|
329
329
|
segments:
|
330
330
|
- 0
|
331
331
|
version: "0"
|