Skip to content

Commit

Permalink
deleget NullGroup’s methods to a new datagroup(Datagroup.new) object
Browse files Browse the repository at this point in the history
  • Loading branch information
manxingxing committed Nov 9, 2014
1 parent 5a74028 commit 7b9794b
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions app/models/null_datagroup.rb
Expand Up @@ -4,15 +4,10 @@ def present?; false; end
def empty?; true; end
def !; true; end

def categories; []; end

Datagroup.attribute_names.each do |f|
define_method f do
nil
end
end

def self.decrement_counter(counter_name, id); ; end
def self.increment_counter(counter_name, id); ; end

def method_missing(method_name, *args)
Datagroup.new.send method_name, *args
end
end

0 comments on commit 7b9794b

Please sign in to comment.