module SmoothOperator::Associations
Public Instance Methods
belongs_to(association, options = {})
click to toggle source
# File lib/smooth_operator/associations.rb, line 15 def belongs_to(association, options = {}) accepts_nested_objects(association, :belongs_to, options) end
has_many(association, options = {})
click to toggle source
# File lib/smooth_operator/associations.rb, line 7 def has_many(association, options = {}) accepts_nested_objects(association, :has_many, options) end
has_one(association, options = {})
click to toggle source
# File lib/smooth_operator/associations.rb, line 11 def has_one(association, options = {}) accepts_nested_objects(association, :has_one, options) end
rails_serialization()
click to toggle source
# File lib/smooth_operator/associations.rb, line 31 def rails_serialization get_option :rails_serialization, false end
reflect_on_all_associations(macro = nil)
click to toggle source
# File lib/smooth_operator/associations.rb, line 27 def reflect_on_all_associations(macro = nil) macro ? reflections.values.select { |reflection| reflection.macro == macro } : reflections.values end
reflect_on_association(association)
click to toggle source
# File lib/smooth_operator/associations.rb, line 23 def reflect_on_association(association) reflections[association] end
reflections()
click to toggle source
# File lib/smooth_operator/associations.rb, line 19 def reflections Helpers.get_instance_variable(self, :reflections, {}) end
refresh()
click to toggle source
# File lib/smooth_operator/associations/has_many_relation.rb, line 49 def refresh __setobj__ get_array end