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