message_train 0.2.12 → 0.3.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49d00a8c45a733bafb03ea1452b489c670b51b47
4
- data.tar.gz: 980cbe82a8681b1ee9a7fa49179dceb0b4d7e0d9
3
+ metadata.gz: 7bb7f77562529d2b1188b842eb4ed71774d54061
4
+ data.tar.gz: abd3169166b791465703f7afc039fb9d50cc44c8
5
5
  SHA512:
6
- metadata.gz: 6611a814aedaa6049d8ca9535bf0a3f4e30b7f37c8a0f844def3c2d7949bc2f2523ef53a30f959ed19c9e840fcb9c14aded50923df66358a63926a322456461c
7
- data.tar.gz: 6e087ccaf573e3b6b5668ff1d26e78c0c7ce359e1ba2bb8fcaa0b930cf96f212d37e5ae4ec829f48a34ff43083f9ac60f4fa6db5925a038a91244addc9e99a87
6
+ metadata.gz: e2ac933194e6cac58dab162a980ab8d5789833d9503a3e3a5b9664ff63bf2e3a68d9a726061ee334a9043f5bd73c49916c2ed5000b7280587f502c1eaeb6b4f7
7
+ data.tar.gz: a94b66e5f57065064bc06bc34cb0e108b8f8e49629d84091516166d50b59c77a4c075a11757d852adf3edc3c150b1670e404be2569e7c446f048b08a80e3729c
data/README.rdoc CHANGED
@@ -124,6 +124,7 @@ Or in your initializer:
124
124
 
125
125
  [config.slug_columns] Usually populated by options on the `message_train` mixin for models, this contains a `Hash` of tables and their slug columns
126
126
  [config.name_columns] Usually populated by options on the `message_train` mixin for models, this contains a `Hash` of tables and their name columns
127
+ [config.user_model] Defaults to `'User'`
127
128
  [config.current_user_method] Defaults to `Devise`'s `current_user`
128
129
  [config.user_sign_in_path] Defaults to `Devise`'s `/users/sign_in`
129
130
  [config.user_route_authentication_method] Defaults to `Devise`'s `:user`
@@ -138,6 +139,11 @@ Or in your initializer:
138
139
 
139
140
  == Upgrading
140
141
 
142
+ === 0.3.0
143
+
144
+ A new config variable was added for the user model, which will be used to generate a new user if the user is anonymous.
145
+
146
+ === 0.2.0
141
147
  New columns were added with version 0.2.0, so when upgrading be sure to install the latest migrations:
142
148
 
143
149
  rake message_train:install:migrations
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.12
1
+ 0.3.0
@@ -28,8 +28,13 @@ module MessageTrainSupport
28
28
 
29
29
  protected
30
30
 
31
- def require_authentication
32
- redirect_to url_for(MessageTrain.configuration.user_sign_in_path), flash: { error: :you_must_sign_in_or_sign_up_to_continue.l }
31
+ # def require_authentication
32
+ # redirect_to url_for(MessageTrain.configuration.user_sign_in_path), flash: { error: :you_must_sign_in_or_sign_up_to_continue.l }
33
+ # end
34
+
35
+ def anonymous
36
+ @anonymous = true
37
+ MessageTrain.configuration.user_model.constantize.new
33
38
  end
34
39
 
35
40
  def set_locale
@@ -37,7 +42,9 @@ protected
37
42
  end
38
43
 
39
44
  def load_box_user
40
- @box_user = send(MessageTrain.configuration.current_user_method) || require_authentication
45
+ # # What we used to do
46
+ # @box_user = send(MessageTrain.configuration.current_user_method) || require_authentication
47
+ @box_user = send(MessageTrain.configuration.current_user_method) || anonymous
41
48
  end
42
49
 
43
50
  def load_division
@@ -1,6 +1,7 @@
1
1
  MessageTrain.configure do |config|
2
2
  # config.slug_columns[:users] = :slug
3
3
  # config.name_columns[:users] = :name
4
+ # config.user_model = 'User'
4
5
  # config.current_user_method = :current_user
5
6
  # config.user_sign_in_path = '/user/sign_in'
6
7
  # config.user_route_authentication_method = :user
@@ -14,6 +14,7 @@ module MessageTrain
14
14
  attr_accessor :slug_columns,
15
15
  :name_columns,
16
16
  :current_user_method,
17
+ :user_model,
17
18
  :user_sign_in_path,
18
19
  :user_route_authentication_method,
19
20
  :address_book_method,
@@ -29,6 +30,7 @@ module MessageTrain
29
30
  self.recipient_tables = {}
30
31
  self.slug_columns = { users: :slug }
31
32
  self.name_columns = { users: :name }
33
+ self.user_model = 'User'
32
34
  self.current_user_method = :current_user
33
35
  self.user_sign_in_path = '/users/sign_in'
34
36
  self.user_route_authentication_method = :user
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: message_train 0.2.12 ruby lib
5
+ # stub: message_train 0.3.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "message_train"
9
- s.version = "0.2.12"
9
+ s.version = "0.3.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Karen Lundgren"]
14
- s.date = "2016-01-18"
14
+ s.date = "2016-01-26"
15
15
  s.description = "Rails 4 Engine providing private/public messaging for any object, such as Users or Groups"
16
16
  s.email = "karen.e.lundgren@gmail.com"
17
17
  s.extra_rdoc_files = [
@@ -1,6 +1,7 @@
1
1
  MessageTrain.configure do |config|
2
2
  # config.slug_columns[:users] = :slug
3
3
  # config.name_columns[:users] = :name
4
+ # config.user_model = 'User'
4
5
  # config.current_user_method = :current_user
5
6
  # config.user_sign_in_path = '/user/sign_in'
6
7
  # config.user_route_authentication_method = :user
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: message_train
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.12
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karen Lundgren
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-18 00:00:00.000000000 Z
11
+ date: 2016-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails