Permalink
Browse files

-Rename domain logic to service object

  • Loading branch information...
1 parent 4abb3fd commit 1a5907d6205c581f1c9fdf57a3508838f6d17964 @sergio1990 sergio1990 committed Feb 10, 2014
View
@@ -4,17 +4,17 @@ module AlterMvc
autoload :Model, 'alter_mvc/model'
autoload :BasicPresenter, 'alter_mvc/basic_presenter'
- autoload :BasicDomainLogic, 'alter_mvc/basic_domain_logic'
+ autoload :BasicServiceObject, 'alter_mvc/basic_service_object'
autoload :BasicQuery, 'alter_mvc/basic_query'
autoload :Constants, 'alter_mvc/constants'
autoload :BasicUseCase, 'alter_mvc/basic_use_case'
module Concerns
- autoload :BasicConcern, 'alter_mvc/concerns/basic_concern'
- autoload :DomainLogicable, 'alter_mvc/concerns/domain_logicable'
- autoload :Presentable, 'alter_mvc/concerns/presentable'
- autoload :Querable, 'alter_mvc/concerns/querable'
+ autoload :BasicConcern, 'alter_mvc/concerns/basic_concern'
+ autoload :ServiceObjectable, 'alter_mvc/concerns/service_objectable'
+ autoload :Presentable, 'alter_mvc/concerns/presentable'
+ autoload :Querable, 'alter_mvc/concerns/querable'
end
@@ -1,7 +1,7 @@
require 'delegate'
module AlterMvc
- class BasicDomainLogic < SimpleDelegator
+ class BasicServiceObject < SimpleDelegator
alias :model :__getobj__
@@ -11,7 +11,7 @@ def initialize(base = nil)
private
def self.default_base
- @_model_class ||= self.name.gsub("DomainLogic", "").constantize.unscoped
+ @_model_class ||= self.name.gsub("ServiceObject", "").constantize.unscoped
end
end
@@ -1,6 +1,6 @@
require 'active_support/core_ext/string'
-module AlterMvc::Concerns::DomainLogicable
+module AlterMvc::Concerns::ServiceObjectable
extend AlterMvc::Concerns::BasicConcern
build_concern :domain_logic
@@ -1,6 +1,6 @@
module AlterMvc
class Model < ActiveRecord::Base
- include AlterMvc::Concerns::DomainLogicable
+ include AlterMvc::Concerns::ServiceObjectable
include AlterMvc::Concerns::Presentable
include AlterMvc::Concerns::Querable
@@ -1,13 +0,0 @@
-require 'generators/alter_mvc'
-
-module AlterMvc
- module Generators
- class DomainLogicGenerator < Base
-
- def add_domain_logic
- template "domain_logic.rb", File.join('app/domain_logics/', "#{file_name.singularize}_domain_logic.rb")
- end
-
- end
- end
-end
@@ -1,2 +0,0 @@
-class <%= class_name %>DomainLogic < AlterMvc::BasicDomainLogic
-end
@@ -0,0 +1,13 @@
+require 'generators/alter_mvc'
+
+module AlterMvc
+ module Generators
+ class ServiceObjectGenerator < Base
+
+ def add_domain_logic
+ template "service_object.rb", File.join('app/service_objects/', "#{file_name.singularize}_service_object.rb")
+ end
+
+ end
+ end
+end
@@ -0,0 +1,2 @@
+class <%= class_name %>ServiceObject < AlterMvc::BasicServiceObject
+end

0 comments on commit 1a5907d

Please sign in to comment.