Skip to content

Commit

Permalink
Silenced deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
snusnu committed Mar 16, 2010
1 parent 94a39c8 commit 97779a8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/dm-is-commentable/is/commentable.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def is_commentable(options = {})


options = { options = {
:commenter => { :name => :user_id, :type => Integer }, :commenter => { :name => :user_id, :type => Integer },
:body => { :type => DataMapper::Types::Text, :nullable => false }, :body => { :type => DataMapper::Types::Text, :required => true },
:rateable => false, :rateable => false,
:as => nil, :as => nil,
:model => "#{self}Comment" :model => "#{self}Comment"
Expand Down Expand Up @@ -85,14 +85,14 @@ def commenter_fk(name)
c_opts = options[:commenter] c_opts = options[:commenter]
c_name = c_opts.is_a?(Hash) ? (c_opts.delete(:name) || :user_id) : commenter_fk(c_opts) c_name = c_opts.is_a?(Hash) ? (c_opts.delete(:name) || :user_id) : commenter_fk(c_opts)
c_type = c_opts.is_a?(Hash) ? (c_opts.delete(:type) || Integer) : Integer c_type = c_opts.is_a?(Hash) ? (c_opts.delete(:type) || Integer) : Integer
c_property_opts = c_opts.is_a?(Hash) ? c_opts : { :nullable => false } c_property_opts = c_opts.is_a?(Hash) ? c_opts : { :required => true }
c_property_opts.merge!(:min => 0) if c_type == Integer # Match referenced column type c_property_opts.merge!(:min => 0) if c_type == Integer # Match referenced column type
c_association = c_name.to_s.gsub(/_id/, '').to_sym c_association = c_name.to_s.gsub(/_id/, '').to_sym


b_opts = options[:body] b_opts = options[:body]
b_name = b_opts.is_a?(Hash) ? (b_opts.delete(:name) || :body) : :body b_name = b_opts.is_a?(Hash) ? (b_opts.delete(:name) || :body) : :body
b_type = b_opts.is_a?(Hash) ? (b_opts.delete(:type) || DataMapper::Types::Text) : DataMapper::Types::Text b_type = b_opts.is_a?(Hash) ? (b_opts.delete(:type) || DataMapper::Types::Text) : DataMapper::Types::Text
b_property_opts = b_opts.is_a?(Hash) ? b_opts : { :nullable => false } b_property_opts = b_opts.is_a?(Hash) ? b_opts : { :required => true }


# block for enhance gets class_eval'ed in remixable scope # block for enhance gets class_eval'ed in remixable scope
commenting_rateable = self.commenting_rateable? commenting_rateable = self.commenting_rateable?
Expand Down

0 comments on commit 97779a8

Please sign in to comment.