voluntary 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +8 -2
- data/app/views/shared/resource/_actions.html.erb +1 -1
- data/config/locales/workflow/en.yml +5 -1
- data/lib/applicat/mvc/controller/resource.rb +1 -1
- data/lib/generators/voluntary/product_dummy/templates/config/mongoid.yml +0 -6
- data/lib/generators/voluntary/product_dummy/templates/dummy/config/initializers/secret_token.rb +12 -0
- data/lib/voluntary.rb +1 -0
- data/lib/voluntary/version.rb +1 -1
- metadata +5 -22
- data/lib/generators/voluntary/product_dummy/templates/app/models/ability.rb +0 -49
- data/lib/generators/voluntary/product_dummy/templates/app/models/app_config.rb +0 -32
data/README.rdoc
CHANGED
@@ -70,14 +70,20 @@ Run this in your console:
|
|
70
70
|
# Still needed?: Add development dependencies to dummy Gemfile, see voluntary_text_creation.
|
71
71
|
# bundle install
|
72
72
|
cd dummy
|
73
|
-
# change config/boot.rb to require bundler
|
73
|
+
# change config/boot.rb to require bundler like here: https://github.com/volontariat/voluntary_scholarship/blob/master/dummy/config/boot.rb
|
74
74
|
# change database names to #{product_name}_#{environment} and customize user credentials in config/database.yml
|
75
|
+
# add gitignore file from voluntary: https://github.com/volontariat/voluntary/blob/master/.gitignore
|
75
76
|
rake db:create:all && rails g voluntary:product_dummy # confirm all overwrite questions
|
76
77
|
# Add "gemspec path: File.expand_path(File.dirname(__FILE__) + '/../')" to the top of the dummy's Gemfile
|
77
78
|
bundle install # if it hangs at Fetching source index stop it and deactivate gems until it works and add them back one by one
|
79
|
+
cd ..
|
80
|
+
rails g migration add_product_name_product
|
81
|
+
# fill migration file with template: https://github.com/volontariat/voluntary_scholarship/blob/master/db/migrate/20140306201232_add_scholarship_product.rb
|
82
|
+
cd dummy
|
78
83
|
rake railties:install:migrations
|
79
|
-
# change database names to #{product_name}_#{environment} and customize user credentials in config/mongoid.yml
|
84
|
+
# change database names to #{product_name}_#{environment} and customize user credentials in dummy/config/mongoid.yml
|
80
85
|
rake db:migrate && rake db:test:clone_structure
|
86
|
+
# create a class for your new product under app/models/product/product_name.rb like: https://github.com/volontariat/voluntary_scholarship/blob/master/app/models/product/scholarship.rb
|
81
87
|
bundle exec rails s
|
82
88
|
|
83
89
|
= License
|
@@ -17,7 +17,7 @@
|
|
17
17
|
</li>
|
18
18
|
<% end %>
|
19
19
|
<% if can? :edit, resource %>
|
20
|
-
<li><%= link_to t('general.edit'), eval("edit_#{type.singularize}_path(resource)") %></li>
|
20
|
+
<li><%= link_to t('general.edit'), eval("edit_#{type.gsub('/', '_').singularize}_path(resource)") %></li>
|
21
21
|
<% end %>
|
22
22
|
<% if resource.respond_to? :state_events %>
|
23
23
|
<li class="divider"></li>
|
@@ -15,10 +15,6 @@ development:
|
|
15
15
|
# (default: false)
|
16
16
|
# safe: false
|
17
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
18
|
# Configure Mongoid specific options. (optional)
|
23
19
|
options:
|
24
20
|
# Configuration for whether or not to allow access to fields that do
|
@@ -65,7 +61,6 @@ test:
|
|
65
61
|
hosts:
|
66
62
|
- localhost:27017
|
67
63
|
options:
|
68
|
-
consistency: :strong
|
69
64
|
|
70
65
|
production:
|
71
66
|
sessions:
|
@@ -74,5 +69,4 @@ production:
|
|
74
69
|
hosts:
|
75
70
|
- localhost:27017
|
76
71
|
options:
|
77
|
-
consistency: :strong
|
78
72
|
|
data/lib/generators/voluntary/product_dummy/templates/dummy/config/initializers/secret_token.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key is used for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
|
6
|
+
# Make sure the secret is at least 30 characters and all random,
|
7
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
8
|
+
# You can use `rake secret` to generate a secure secret key.
|
9
|
+
|
10
|
+
# Make sure your secret_key_base is kept private
|
11
|
+
# if you're sharing your code publicly.
|
12
|
+
Dummy::Application.config.secret_key_base = '3e352f69d8d5eb22138c381d998aeb8923d0f4ea670916e02ca442134ba8dbc149b6c8001c724369e112778b30d1d68bd631399cad1cfc2f29bb8cccb499719c'
|
data/lib/voluntary.rb
CHANGED
data/lib/voluntary/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: voluntary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-01-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -1275,22 +1275,6 @@ dependencies:
|
|
1275
1275
|
- - ~>
|
1276
1276
|
- !ruby/object:Gem::Version
|
1277
1277
|
version: 0.3.3
|
1278
|
-
- !ruby/object:Gem::Dependency
|
1279
|
-
name: fuubar
|
1280
|
-
requirement: !ruby/object:Gem::Requirement
|
1281
|
-
none: false
|
1282
|
-
requirements:
|
1283
|
-
- - ~>
|
1284
|
-
- !ruby/object:Gem::Version
|
1285
|
-
version: 1.1.0
|
1286
|
-
type: :development
|
1287
|
-
prerelease: false
|
1288
|
-
version_requirements: !ruby/object:Gem::Requirement
|
1289
|
-
none: false
|
1290
|
-
requirements:
|
1291
|
-
- - ~>
|
1292
|
-
- !ruby/object:Gem::Version
|
1293
|
-
version: 1.1.0
|
1294
1278
|
- !ruby/object:Gem::Dependency
|
1295
1279
|
name: selenium-webdriver
|
1296
1280
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1782,8 +1766,6 @@ files:
|
|
1782
1766
|
- lib/generators/voluntary/product_dummy/product_dummy_generator.rb
|
1783
1767
|
- lib/generators/voluntary/product_dummy/templates/app/controllers/application_controller.rb
|
1784
1768
|
- lib/generators/voluntary/product_dummy/templates/app/controllers/home_controller.rb
|
1785
|
-
- lib/generators/voluntary/product_dummy/templates/app/models/ability.rb
|
1786
|
-
- lib/generators/voluntary/product_dummy/templates/app/models/app_config.rb
|
1787
1769
|
- lib/generators/voluntary/product_dummy/templates/app/views/home/index.html.erb
|
1788
1770
|
- lib/generators/voluntary/product_dummy/templates/app/views/layouts/application.html.erb
|
1789
1771
|
- lib/generators/voluntary/product_dummy/templates/config/application.yml
|
@@ -1794,6 +1776,7 @@ files:
|
|
1794
1776
|
- lib/generators/voluntary/product_dummy/templates/config/main_navigation.rb
|
1795
1777
|
- lib/generators/voluntary/product_dummy/templates/config/mongoid.yml
|
1796
1778
|
- lib/generators/voluntary/product_dummy/templates/config/routes.rb
|
1779
|
+
- lib/generators/voluntary/product_dummy/templates/dummy/config/initializers/secret_token.rb
|
1797
1780
|
- lib/generators/voluntary/product_dummy/templates/dummy/spec/factories.rb
|
1798
1781
|
- lib/generators/voluntary/product_dummy/templates/dummy/spec/spec_helper.rb
|
1799
1782
|
- lib/generators/voluntary/product_dummy/templates/features/step_definitions/area_behaviour_steps.rb
|
@@ -1869,7 +1852,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1869
1852
|
version: '0'
|
1870
1853
|
segments:
|
1871
1854
|
- 0
|
1872
|
-
hash:
|
1855
|
+
hash: 1000069296358120593
|
1873
1856
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1874
1857
|
none: false
|
1875
1858
|
requirements:
|
@@ -1878,7 +1861,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1878
1861
|
version: '0'
|
1879
1862
|
segments:
|
1880
1863
|
- 0
|
1881
|
-
hash:
|
1864
|
+
hash: 1000069296358120593
|
1882
1865
|
requirements: []
|
1883
1866
|
rubyforge_project:
|
1884
1867
|
rubygems_version: 1.8.23
|
@@ -1,49 +0,0 @@
|
|
1
|
-
class Ability
|
2
|
-
include CanCan::Ability
|
3
|
-
|
4
|
-
def initialize(user, options = {})
|
5
|
-
controller_namespace = options[:controller_namespace] || ""
|
6
|
-
project = options[:project] || nil
|
7
|
-
|
8
|
-
alias_action :index, :show, :autocomplete, :parents, :childs, :tree, to: :read
|
9
|
-
|
10
|
-
alias_action :new, :create, :edit, :update, :destroy, to: :restful_actions
|
11
|
-
alias_action [], to: :admin_actions
|
12
|
-
alias_action [], to: :moderation_actions
|
13
|
-
alias_action :assign, :reject, :hold_on, to: :supervisor_actions
|
14
|
-
|
15
|
-
alias_action :restful_actions, :admin_actions, to: :administrate
|
16
|
-
alias_action :restful_actions, :moderation_actions, to: :moderate
|
17
|
-
alias_action :read, :assign_actions, to: :supervisor
|
18
|
-
|
19
|
-
can :read, [
|
20
|
-
Area, Profession, Product, Project, Vacancy, Candidature, Story, Task, Result, Comment
|
21
|
-
]
|
22
|
-
can [:read, :check_name, :check_url, :check_email, :check_email_unblocked], User
|
23
|
-
can :show, Page
|
24
|
-
|
25
|
-
if user.present?
|
26
|
-
can :destroy, User, id: user.id
|
27
|
-
|
28
|
-
can [:new, :create], [Area, Profession, Project, Vacancy, Candidature, Comment]
|
29
|
-
can :assign, Task
|
30
|
-
can [:update, :cancel, :review], Task, user_id: user.id
|
31
|
-
|
32
|
-
{
|
33
|
-
user_id: [Product, Project, Candidature, Comment, ProjectUser, Result],
|
34
|
-
offeror_id: [Vacancy, Story, Task]
|
35
|
-
}.each do |attribute, classes|
|
36
|
-
can :restful_actions, classes, attribute => user.id
|
37
|
-
end
|
38
|
-
|
39
|
-
can Candidature::EVENTS, Candidature, offeror_id: user.id
|
40
|
-
can Vacancy::EVENTS, Vacancy, offeror_id: user.id
|
41
|
-
can Story::EVENTS, Story, offeror_id: user.id
|
42
|
-
can Task::EVENTS + [:update], Task, offeror_id: user.id
|
43
|
-
|
44
|
-
if user.name == 'Master'
|
45
|
-
can [:manage, :moderate, :administrate, :supervisor], :all
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# Copyright (c) 2010-2011, Diaspora Inc. This file is
|
2
|
-
# licensed under the Affero General Public License version 3 or later. See
|
3
|
-
# the COPYRIGHT file.
|
4
|
-
|
5
|
-
require 'uri'
|
6
|
-
|
7
|
-
class AppConfig < Settingslogic
|
8
|
-
def self.source_file_name
|
9
|
-
if ENV['application_yml'].present?
|
10
|
-
puts "using remote application.yml"
|
11
|
-
return ENV['application_yml']
|
12
|
-
end
|
13
|
-
config_file = Rails.root.join("config", "application.yml")
|
14
|
-
if !File.exists?(config_file) && (Rails.env == 'test' || Rails.env.include?("integration") || EnvironmentConfiguration.heroku?)
|
15
|
-
config_file = Rails.root.join("config", "application.yml.example")
|
16
|
-
end
|
17
|
-
config_file
|
18
|
-
end
|
19
|
-
|
20
|
-
def self.load!
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.setup!
|
24
|
-
end
|
25
|
-
|
26
|
-
source source_file_name
|
27
|
-
namespace Rails.env
|
28
|
-
|
29
|
-
def self.new_relic_app_name
|
30
|
-
self[:new_relic_app_name] || self[:pod_uri].host
|
31
|
-
end
|
32
|
-
end
|