fix object de-authorize failed.
This commit is contained in:
parent
465d417c35
commit
869f3b6815
2
Gemfile
2
Gemfile
|
@ -53,7 +53,7 @@ gem 'mongoid-encryptor', :require => 'mongoid/encryptor'
|
|||
gem 'rb-readline','~> 0.4.2' if RUBY_PLATFORM.downcase.include?("linux")
|
||||
|
||||
|
||||
gem "impressionist", :git => 'git://github.com/charlotte-ruby/impressionist.git'
|
||||
gem "impressionist",'1.2.0'
|
||||
#gem 'contacts'
|
||||
#gem 'event-calendar', :require => 'event_calendar'#, :git => 'git://github.com/elevation/event_calendar.git'
|
||||
|
||||
|
|
|
@ -51,8 +51,9 @@ class PrototypeAuth
|
|||
end
|
||||
|
||||
def remove_operation(item,obj)
|
||||
if (self.send item).include? obj
|
||||
(self.send item).delete obj
|
||||
item = (item.to_s.singularize == item.to_s) ? "#{item.to_s}_id" : "#{item.to_s.singularize}_ids"
|
||||
if (self.send item).include? obj.id
|
||||
(self.send item).delete obj.id
|
||||
self.save!
|
||||
else
|
||||
false #should put error message for user not existed in list
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
defaults: &defaults
|
||||
host: localhost
|
||||
# slaves:
|
||||
# - host: slave1.local
|
||||
port: 27017
|
||||
# - host: slave2.local
|
||||
# port: 27019
|
||||
|
||||
development:
|
||||
<<: *defaults
|
||||
database: demo_site_development
|
||||
test:
|
||||
<<: *defaults
|
||||
database: test_site
|
||||
|
||||
# set these environment variables on your prod server
|
||||
production:
|
||||
# host: <%= ENV['MONGOID_HOST'] %>
|
||||
# port: <%= ENV['MONGOID_PORT'] %>
|
||||
# username: <%= ENV['MONGOID_USERNAME'] %>
|
||||
# password: <%= ENV['MONGOID_PASSWORD'] %>
|
||||
# database: <%= ENV['MONGOID_DATABASE'] %>
|
||||
<<: *defaults
|
||||
database: demo_site_production
|
Loading…
Reference in New Issue