popolo 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +20 -0
- data/README.md +41 -0
- data/Rakefile +16 -0
- data/app/assets/javascripts/popolo/application.js +13 -0
- data/app/assets/stylesheets/popolo/application.css +13 -0
- data/app/controllers/popolo/areas_controller.rb +48 -0
- data/app/controllers/popolo/organizations_controller.rb +48 -0
- data/app/controllers/popolo/people_controller.rb +12 -0
- data/app/controllers/popolo/posts_controller.rb +12 -0
- data/app/controllers/popolo_controller.rb +3 -0
- data/app/helpers/popolo_helper.rb +10 -0
- data/app/models/popolo/address.rb +27 -0
- data/app/models/popolo/area.rb +25 -0
- data/app/models/popolo/event.rb +46 -0
- data/app/models/popolo/identifier.rb +15 -0
- data/app/models/popolo/link.rb +16 -0
- data/app/models/popolo/membership.rb +25 -0
- data/app/models/popolo/organization.rb +32 -0
- data/app/models/popolo/other_name.rb +21 -0
- data/app/models/popolo/person.rb +49 -0
- data/app/models/popolo/post.rb +25 -0
- data/app/models/popolo/source.rb +29 -0
- data/app/views/popolo/areas/index.html.erb +1 -0
- data/app/views/popolo/areas/show.html.erb +1 -0
- data/app/views/popolo/areas_or_organizations/_index.html.erb +31 -0
- data/app/views/popolo/areas_or_organizations/_show.html.erb +30 -0
- data/app/views/popolo/organizations/index.html.erb +1 -0
- data/app/views/popolo/organizations/show.html.erb +1 -0
- data/app/views/popolo/people/index.html.erb +0 -0
- data/app/views/popolo/people/show.html.erb +0 -0
- data/app/views/popolo/posts/index.html.erb +0 -0
- data/app/views/popolo/posts/show.html.erb +0 -0
- data/config/routes.rb +15 -0
- data/lib/generators/popolo_generator.rb +36 -0
- data/lib/generators/templates/README +7 -0
- data/lib/popolo/engine.rb +7 -0
- data/lib/popolo/mixins/eventable.rb +15 -0
- data/lib/popolo/mixins/sluggable.rb +64 -0
- data/lib/popolo/version.rb +3 -0
- data/lib/popolo.rb +18 -0
- data/spec/controllers/popolo/areas_controller_spec.rb +59 -0
- data/spec/controllers/popolo/organizations_controller_spec.rb +59 -0
- data/spec/controllers/popolo/people_controller_spec.rb +30 -0
- data/spec/controllers/popolo/posts_controller_spec.rb +30 -0
- data/spec/controllers/popolo_controller_spec.rb +4 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/cat.rb +6 -0
- data/spec/dummy/app/models/dog.rb +10 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config/application.rb +62 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/mongoid.yml +68 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/log/development.log +6 -0
- data/spec/dummy/log/test.log +35513 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/factories.rb +25 -0
- data/spec/helpers/popolo_helper_spec.rb +4 -0
- data/spec/models/popolo/address_spec.rb +4 -0
- data/spec/models/popolo/area_spec.rb +4 -0
- data/spec/models/popolo/event_spec.rb +7 -0
- data/spec/models/popolo/identifier_spec.rb +5 -0
- data/spec/models/popolo/link_spec.rb +5 -0
- data/spec/models/popolo/membership_spec.rb +27 -0
- data/spec/models/popolo/organization_spec.rb +25 -0
- data/spec/models/popolo/other_name_spec.rb +25 -0
- data/spec/models/popolo/person_spec.rb +25 -0
- data/spec/models/popolo/post_spec.rb +5 -0
- data/spec/models/popolo/source_spec.rb +7 -0
- data/spec/popolo/mixins/sluggable_spec.rb +153 -0
- data/spec/popolo_spec.rb +4 -0
- data/spec/routing/popolo/areas_routing_spec.rb +29 -0
- data/spec/routing/popolo/organizations_routing_spec.rb +29 -0
- data/spec/routing/popolo/people_routing_spec.rb +21 -0
- data/spec/routing/popolo/posts_routing_spec.rb +21 -0
- data/spec/spec_helper.rb +81 -0
- metadata +416 -0
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
# Make sure the secret is at least 30 characters and all random,
|
6
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
+
Dummy::Application.config.secret_token = '60e574df86e3e907b71cc35d7f1ab16aaa54c4d4495bd927b9d2c2fed56b1efb23cb7150c01a43b7ecf9e2eb141050c666169f126f688a5deb077d2a1ed566d3'
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
|
4
|
+
|
5
|
+
# Use the database for sessions instead of the cookie-based default,
|
6
|
+
# which shouldn't be used to store highly confidential information
|
7
|
+
# (create the session table with "rails generate session_migration")
|
8
|
+
# Dummy::Application.config.session_store :active_record_store
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
#
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
+
# is enabled by default.
|
5
|
+
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
8
|
+
wrap_parameters format: [:json]
|
9
|
+
end
|
10
|
+
|
11
|
+
# Disable root element in JSON by default.
|
12
|
+
ActiveSupport.on_load(:active_record) do
|
13
|
+
self.include_root_in_json = false
|
14
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
development:
|
2
|
+
# Configure available database sessions. (required)
|
3
|
+
sessions:
|
4
|
+
# Defines the default session. (required)
|
5
|
+
default:
|
6
|
+
# Defines the name of the default database that Mongoid can connect to.
|
7
|
+
# (required).
|
8
|
+
database: popolo_development
|
9
|
+
# Provides the hosts the default session can connect to. Must be an array
|
10
|
+
# of host:port pairs. (required)
|
11
|
+
hosts:
|
12
|
+
- localhost:27017
|
13
|
+
options:
|
14
|
+
# Change whether the session persists in safe mode by default.
|
15
|
+
# (default: false)
|
16
|
+
# safe: false
|
17
|
+
|
18
|
+
# Change the default consistency model to :eventual or :strong.
|
19
|
+
# :eventual will send reads to secondaries, :strong sends everything
|
20
|
+
# to master. (default: :eventual)
|
21
|
+
consistency: :strong
|
22
|
+
# Configure Mongoid specific options. (optional)
|
23
|
+
options:
|
24
|
+
# Configuration for whether or not to allow access to fields that do
|
25
|
+
# not have a field definition on the model. (default: true)
|
26
|
+
# allow_dynamic_fields: true
|
27
|
+
|
28
|
+
# Enable the identity map, needed for eager loading. (default: false)
|
29
|
+
identity_map_enabled: true
|
30
|
+
|
31
|
+
# Includes the root model name in json serialization. (default: false)
|
32
|
+
# include_root_in_json: false
|
33
|
+
|
34
|
+
# Include the _type field in serializaion. (default: false)
|
35
|
+
# include_type_for_serialization: false
|
36
|
+
|
37
|
+
# Preload all models in development, needed when models use
|
38
|
+
# inheritance. (default: false)
|
39
|
+
# preload_models: false
|
40
|
+
|
41
|
+
# Protect id and type from mass assignment. (default: true)
|
42
|
+
# protect_sensitive_fields: true
|
43
|
+
|
44
|
+
# Raise an error when performing a #find and the document is not found.
|
45
|
+
# (default: true)
|
46
|
+
# raise_not_found_error: true
|
47
|
+
|
48
|
+
# Raise an error when defining a scope with the same name as an
|
49
|
+
# existing method. (default: false)
|
50
|
+
# scope_overwrite_exception: false
|
51
|
+
|
52
|
+
# Skip the database version check, used when connecting to a db without
|
53
|
+
# admin access. (default: false)
|
54
|
+
# skip_version_check: false
|
55
|
+
|
56
|
+
# User Active Support's time zone in conversions. (default: true)
|
57
|
+
# use_activesupport_time_zone: true
|
58
|
+
|
59
|
+
# Ensure all times are UTC in the app side. (default: false)
|
60
|
+
# use_utc: false
|
61
|
+
test:
|
62
|
+
sessions:
|
63
|
+
default:
|
64
|
+
database: popolo_test
|
65
|
+
hosts:
|
66
|
+
- localhost:27017
|
67
|
+
options:
|
68
|
+
consistency: :strong
|
@@ -0,0 +1,6 @@
|
|
1
|
+
MOPED: 127.0.0.1:27017 COMMAND database=admin command={:ismaster=>1} (1.4269ms)
|
2
|
+
MOPED: 127.0.0.1:27017 INSERT database=popolo_development collection=popolo_people documents=[{"_id"=>"50f305f223e2f6045a000001", "name"=>{"en"=>"John Doe"}, "slug"=>"john-doe", "updated_at"=>2013-01-13 19:07:30 UTC, "created_at"=>2013-01-13 19:07:30 UTC}] flags=[] (0.2322ms)
|
3
|
+
MOPED: 127.0.0.1:27017 COMMAND database=admin command={:ismaster=>1} (1.0641ms)
|
4
|
+
MOPED: 127.0.0.1:27017 QUERY database=popolo_development collection=popolo_people selector={"$query"=>{"deleted_at"=>nil}, "$orderby"=>{:_id=>1}} flags=[] limit=-1 skip=0 fields=nil (0.7071ms)
|
5
|
+
MOPED: 127.0.0.1:27017 COMMAND database=admin command={:ismaster=>1} (0.6180ms)
|
6
|
+
MOPED: 127.0.0.1:27017 QUERY database=popolo_development collection=popolo_people selector={"$query"=>{"deleted_at"=>nil}, "$orderby"=>{:_id=>1}} flags=[] limit=-1 skip=0 fields=nil (0.7722ms)
|