aboutsummaryrefslogtreecommitdiffstats
path: root/lib/page_extensions.rb
diff options
context:
space:
mode:
authorJames Thompson <james.b.thompson@gmail.com>2012-03-14 11:40:16 +0200
committerJames Thompson <james.b.thompson@gmail.com>2012-03-14 11:40:16 +0200
commit56d7747f54e86993415b76c92e101608e5ea44e2 (patch)
tree025b7b37f50c4c291e7e676286e7767c40adb1f9 /lib/page_extensions.rb
downloadrefinerycms-pc_banners-56d7747f54e86993415b76c92e101608e5ea44e2.tar.gz
refinerycms-pc_banners-56d7747f54e86993415b76c92e101608e5ea44e2.tar.bz2
refinerycms-pc_banners-56d7747f54e86993415b76c92e101608e5ea44e2.zip
initial commit
Diffstat (limited to 'lib/page_extensions.rb')
-rw-r--r--lib/page_extensions.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/page_extensions.rb b/lib/page_extensions.rb
new file mode 100644
index 0000000..973c177
--- /dev/null
+++ b/lib/page_extensions.rb
@@ -0,0 +1,17 @@
+module Refinery
+ module Banners
+ module Extensions
+ module Page
+ module ClassMethods
+ def add_banners_relationship
+ has_and_belongs_to_many :banners, :class_name => '::Refinery::Banners::Banner', :join_table => 'refinery_banners_pages'
+ end
+ end
+
+ def self.included(base)
+ base.extend(ClassMethods).add_banners_relationship
+ end
+ end
+ end
+ end
+end \ No newline at end of file