lib/avo/base_resource.rb in avo-3.0.0.pre14 vs lib/avo/base_resource.rb in avo-3.0.0.pre15

- old
+ new

@@ -10,11 +10,13 @@ include Avo::Concerns::ModelClassConstantized include Avo::Concerns::HasDescription # Avo::Current methods delegate :context, to: Avo::Current - delegate :current_user, to: Avo::Current + def curent_user + Avo::Current.user + end delegate :params, to: Avo::Current delegate :request, to: Avo::Current delegate :view_context, to: Avo::Current # view_context methods @@ -99,11 +101,11 @@ def find_scope authorization.apply_policy model_class end def authorization - Avo::Services::AuthorizationService.new Avo::Current.current_user, model_class, policy_class: authorization_policy + Avo::Services::AuthorizationService.new Avo::Current.user, model_class, policy_class: authorization_policy end def get_record_associations(record) record._reflections end @@ -402,10 +404,10 @@ record end def authorization(user: nil) - current_user = user || Avo::Current.current_user + current_user = user || Avo::Current.user Avo::Services::AuthorizationService.new(current_user, record || model_class, policy_class: authorization_policy) end def file_hash content_to_be_hashed = ""