Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

Commit

Permalink
add deprecation warning for activity target
Browse files Browse the repository at this point in the history
  • Loading branch information
christospappas committed Feb 12, 2012
1 parent 907f648 commit 5320898
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/streama/definition_dsl.rb
Expand Up @@ -14,7 +14,12 @@ def initialize(name)
end

delegate :[], :to => :@attributes


def target(*args)
warn "[DEPRECATION] #target is deprecated. Please use #target_object instead."
@attributes[:target_object].store(args[0].is_a?(Symbol) ? args[0] : args[0].class.to_sym, args[1])
end

def self.data_methods(*args)
args.each do |method|
define_method method do |*args|
Expand Down
2 changes: 1 addition & 1 deletion lib/streama/version.rb
@@ -1,3 +1,3 @@
module Streama
VERSION = "0.3.3"
VERSION = "0.3.4"
end
6 changes: 6 additions & 0 deletions spec/lib/definition_dsl_spec.rb
Expand Up @@ -33,4 +33,10 @@
dsl.attributes[:target_object].should eq :company => { :cache=>[:id, :name] }
end

it "deprecates target method" do
dsl = definition_dsl
dsl.target(:company, :cache => [:id, :name])
dsl.attributes[:target_object].should eq :company => { :cache=>[:id, :name] }
end

end

0 comments on commit 5320898

Please sign in to comment.