Permalink
Browse files

Added explicit has_many relationship with Item in model

  • Loading branch information...
1 parent 57b7ca8 commit 7857007a88e53d0fbcf713692ef29196d4746298 @hulihanapplications committed Jun 25, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 app/models/plugin_event.rb
  2. 0 init.rb
  3. 0 lib/opal_events.rb
@@ -4,7 +4,8 @@ class PluginEvent < ActiveRecord::Base
belongs_to :plugin
belongs_to :item
belongs_to :user
-
+ Item.send(:has_many, :plugin_events, :dependent => :destroy) if table_exists? # automatically create a has_many association for Item
+
attr_protected :is_approved
scope :approved, where(:is_approved => "1")
scope :happening_first, order("date ASC")
View
0 init.rb 100644 → 100755
No changes.
View
0 lib/opal_events.rb 100644 → 100755
No changes.

0 comments on commit 7857007

Please sign in to comment.