Skip to content

Commit

Permalink
remove userstamp gem
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerry Gleason committed Sep 23, 2012
1 parent fe0de0a commit 0205a2f
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 20 deletions.
1 change: 0 additions & 1 deletion Gemfile
Expand Up @@ -10,7 +10,6 @@ gem 'paperclip', '~> 2.4'
gem 'rmagick', '~> 2.13'
gem "recaptcha", "~> 0.3"

gem 'userstamp' #, '~> 2.0'
gem 'xmlscan', '~> 0.3'
gem 'warden'

Expand Down
2 changes: 0 additions & 2 deletions Gemfile.lock
Expand Up @@ -202,7 +202,6 @@ GEM
uglifier (1.3.0)
execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2)
userstamp (2.0.1)
uuid (2.3.5)
macaddr (~> 1.0)
warden (1.2.1)
Expand Down Expand Up @@ -245,7 +244,6 @@ DEPENDENCIES
tinymce-rails (~> 3.4)
turn (~> 0.8.3)
uglifier
userstamp
uuid (~> 2.3)
warden
win32-process (~> 0.6)
Expand Down
11 changes: 3 additions & 8 deletions app/models/card.rb
Expand Up @@ -10,10 +10,6 @@ class Card < ActiveRecord::Base

cattr_accessor :cache

# userstamp methods
model_stamper # Card is both stamped and stamper
stampable :stamper_class_name => :card

has_many :revisions, :order => :id #, :foreign_key=>'card_id'

attr_accessor :comment, :comment_author, :selected_rev_id,
Expand All @@ -25,6 +21,9 @@ class Card < ActiveRecord::Base
attr_writer :update_read_rule_list
attr_reader :type_args, :broken_type

belongs_to :card, :class_name => 'Card', :foreign_key => :creator_id
belongs_to :card, :class_name => 'Card', :foreign_key => :updater_id

before_save :set_stamper, :base_before_save, :set_read_rule, :set_tracked_attributes
after_save :base_after_save, :update_ruled_cards, :update_queue, :expire_related

Expand Down Expand Up @@ -565,10 +564,6 @@ def after_save_hooks # don't move unless you know what you're doing, see above.
Wagn::Hook.call :after_save, self
end

#bail out when not recording userstamps (eg updating read rule)
#skip_callback :save, :after, :after_save_hooks, :save_attached_files,
# :if => lambda { !Card.record_userstamps }

# Because of the way it chains methods, 'tracks' needs to come after
# all the basic method definitions, and validations have to come after
# that because they depend on some of the tracking methods.
Expand Down
4 changes: 2 additions & 2 deletions app/models/card/revision.rb
Expand Up @@ -4,8 +4,8 @@ class Card::Revision < ActiveRecord::Base

cattr_accessor :cache

# userstamp methods
stampable :stamper_class_name => :card
belongs_to :card, :class_name => 'Card', :foreign_key => :creator_id

before_save :set_stamper

def set_stamper
Expand Down
2 changes: 1 addition & 1 deletion lib/old_modules/notification.rb
Expand Up @@ -6,7 +6,7 @@ def self.included(base)
end

def send_notifications
return false if Card.record_userstamp==false
return false if Card.record_timestamps==false
# userstamps and timestamps are turned off in cases like updating read_rules that are automated and
# generally not of enough interest to warrant notification

Expand Down
4 changes: 2 additions & 2 deletions lib/wagn/model/permissions.rb
Expand Up @@ -198,7 +198,7 @@ def set_read_rule
end

def update_read_rule
Card.record_timestamps = Card.record_userstamp = false
Card.record_timestamps = false

reset_patterns # why is this needed?
rcard, rclass = permission_rule_card :read
Expand All @@ -220,7 +220,7 @@ def update_read_rule
end

ensure
Card.record_timestamps = Card.record_userstamp = true
Card.record_timestamps = true
end

# fifo of cards that need read rules updated
Expand Down
5 changes: 1 addition & 4 deletions spec/lib/wagn/renderer/xml_spec.rb
Expand Up @@ -100,11 +100,8 @@

describe "css classes" do
it "are correct for open view" do
pending "with html"
c = Card.new :name => 'Aopen', :content => "{{A|open}}"
Wagn::Renderer::Xml.new(c)._render(:core).should be_html_with do
card( :class => "card-slot paragraph ALL TYPE-basic SELF-a") {}
end
Wagn::Renderer::Xml.new(c)._render(:core).should match /<card cardId="\d+" class="card-slot paragraph ALL TYPE-basic SELF-a view-open" home_view="open" name="A" style="" type_id="3">Alpha <cardlink class="known-card" card="\/Z">Z<\/cardlink><\/card>/
end
end

Expand Down

0 comments on commit 0205a2f

Please sign in to comment.