Module: Cms::Behaviors::Connecting::MacroMethods

Defined in:
lib/cms/behaviors/connecting.rb

Instance Method Summary collapse

Instance Method Details

#connectable?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/cms/behaviors/connecting.rb', line 12

def connectable?
  !!@is_connectable
end

#is_connectable(options = {}) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/cms/behaviors/connecting.rb', line 15

def is_connectable(options={})
  @is_connectable = true
  extend ClassMethods
  include InstanceMethods

  attr_accessor :connect_to_page_id, :connect_to_container,:connected_page
  attr_accessible :connect_to_page_id, :connect_to_container,:connected_page

  has_many :connectors, :as => :connectable, :class_name => 'Cms::Connector'

  attr_accessor :updated_by_page

  after_create :connect_to_page
  after_save :update_connected_pages, :unless=>:skip_callbacks


end