Module: Octopus::SingularAssociation
- Defined in:
- lib/octopus/rails3.1/singular_association.rb
Class Method Summary collapse
Instance Method Summary collapse
- #build_with_octopus(*args) ⇒ Object
- #create_with_octopus(*args) ⇒ Object
- #create_with_octopus!(*args) ⇒ Object
- #reader_with_octopus(*args) ⇒ Object
- #writer_with_octopus(*args) ⇒ Object
Class Method Details
.included(base) ⇒ Object
2 3 4 5 6 7 8 9 10 |
# File 'lib/octopus/rails3.1/singular_association.rb', line 2 def self.included(base) base.instance_eval do alias_method_chain :reader, :octopus alias_method_chain :writer, :octopus alias_method_chain :create, :octopus alias_method_chain :create!, :octopus alias_method_chain :build, :octopus end end |
Instance Method Details
#build_with_octopus(*args) ⇒ Object
28 29 30 |
# File 'lib/octopus/rails3.1/singular_association.rb', line 28 def build_with_octopus(*args) owner.reload_connection_safe { build_without_octopus(*args) } end |
#create_with_octopus(*args) ⇒ Object
20 21 22 |
# File 'lib/octopus/rails3.1/singular_association.rb', line 20 def create_with_octopus(*args) owner.reload_connection_safe { create_without_octopus(*args) } end |
#create_with_octopus!(*args) ⇒ Object
24 25 26 |
# File 'lib/octopus/rails3.1/singular_association.rb', line 24 def create_with_octopus!(*args) owner.reload_connection_safe { create_without_octopus!(*args) } end |
#reader_with_octopus(*args) ⇒ Object
12 13 14 |
# File 'lib/octopus/rails3.1/singular_association.rb', line 12 def reader_with_octopus(*args) owner.reload_connection_safe { reader_without_octopus(*args) } end |
#writer_with_octopus(*args) ⇒ Object
16 17 18 |
# File 'lib/octopus/rails3.1/singular_association.rb', line 16 def writer_with_octopus(*args) owner.reload_connection_safe { writer_without_octopus(*args) } end |