Changeset 234

Show
Ignore:
Timestamp:
01/18/06 03:54:39 (3 years ago)
Author:
tomafro
Message:

Slightly refactored permission synchronisation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • user_engine/trunk/app/models/permission.rb

    r135 r234  
    6262      ApplicationController.all_controllers.collect do |controller| 
    6363        controller.new.action_method_names.each { |action| 
    64           if find_all_by_controller_and_action(controller.controller_path, action).empty? 
    65             self.new(:controller => controller.controller_path, :action => action).save           
    66           end 
     64          find_or_create_by_controller_and_action(controller.controller_path, action) 
    6765        } 
    6866      end