fix issue #338
This commit is contained in:
parent
106cc6fc50
commit
7a595208aa
@ -3,8 +3,8 @@ module Locomotive
|
||||
|
||||
default :from => Locomotive.config.mailer_sender
|
||||
|
||||
def new_content_entry(account, entry)
|
||||
@account, @entry, @type = account, entry.to_presenter, entry.content_type
|
||||
def new_content_entry(entry, account)
|
||||
@account, @entry, @type = account, entry, entry.content_type
|
||||
|
||||
subject = t('locomotive.notifications.new_content_entry.subject', :type => @type.name, :locale => account.locale)
|
||||
|
||||
|
@ -146,7 +146,7 @@ module Locomotive
|
||||
return if !self.content_type.public_submission_enabled? || self.content_type.public_submission_accounts.blank?
|
||||
|
||||
self.site.accounts.each do |account|
|
||||
next unless self.content_type.public_submission_accounts.include?(account._id)
|
||||
next unless self.content_type.public_submission_accounts.map(&:to_s).include?(account._id.to_s)
|
||||
|
||||
Locomotive::Notifications.new_content_entry(account, self).deliver
|
||||
end
|
||||
|
@ -10,13 +10,20 @@
|
||||
%hr
|
||||
|
||||
%ul
|
||||
- @type.entries_custom_fields.each do |field|
|
||||
- value = @entry.value_for(field)
|
||||
- @type.ordered_entries_custom_fields.each do |field|
|
||||
- value = @entry.send(field.name)
|
||||
%li
|
||||
%strong= field.label
|
||||
-
|
||||
%i
|
||||
- if field.type == 'file'
|
||||
= link_to File.basename(value), value
|
||||
- else
|
||||
- case field.type.to_s
|
||||
- when 'string', 'text', 'boolean', 'date'
|
||||
= value
|
||||
- when 'file'
|
||||
= link_to File.basename(value.to_s), value.to_s
|
||||
- when 'select'
|
||||
= value
|
||||
- when 'belongs_to'
|
||||
= value.try(:_label)
|
||||
- when 'has_many', 'many_to_many'
|
||||
= value.map(&:_label).join(', ')
|
@ -202,7 +202,7 @@ describe Locomotive::ContentEntry do
|
||||
@account_2 = FactoryGirl.build('frenchy user', :id => fake_bson_id('2'))
|
||||
|
||||
@content_type.public_submission_enabled = true
|
||||
@content_type.public_submission_accounts = ['', @account_1._id, @account_2._id]
|
||||
@content_type.public_submission_accounts = ['', @account_1._id, @account_2._id.to_s]
|
||||
|
||||
site = FactoryGirl.build(:site)
|
||||
site.stubs(:accounts).returns([@account_1, @account_2])
|
||||
|
Loading…
Reference in New Issue
Block a user