Displaying 2 results from an estimated 2 matches for "destination_typ".
Did you mean:
destination_type
2010 Feb 08
5
Why are double sided polymorphic relationships lacking in Rails?
http://stackoverflow.com/questions/2224994/why-are-double-sided-polymorphic-relationships-lacking-in-rails
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
2009 Dec 15
0
Problems reloading plugin extending AR model
...he
plugin):
http://github.com/dedomenon/madb_notifications/blob/master/lib/madb_notifications_lib.rb#L8
Entity.class_eval do
def user_subscribed_to_creation?(user_id)
NotificationSubscription.find(:first, :conditions => [
"source_filter = ? AND event = ? and source_type = ? and
destination_type = ? and destination = ?", {:entity_id =>
self.id}.to_yaml , "after_create", "Instance", "user", user_id.to_s
])
end
end
and this is then used in a view of the plugin, where @entity is an
instance of the model Entity:
http://github.com/dedomenon/madb_no...