Module: Selections
- Defined in:
- lib/selections.rb,
lib/selections/version.rb,
lib/selections/selectable.rb,
lib/selections/belongs_to_selection.rb,
lib/selections/form_builder_extensions.rb
Defined Under Namespace
Modules: BelongsToSelection, FormBuilderExtensions, Selectable
Constant Summary collapse
- VERSION =
'1.1.0'
Class Method Summary collapse
-
.model(&block) ⇒ Object
Given a block, will set how we find / detect the current model used for selections, without a block, will return the value.
Class Method Details
.model(&block) ⇒ Object
Given a block, will set how we find / detect the current model used for selections, without a block, will return the value. Note: Needed iff you are using a model other than Selection.
14 15 16 17 18 19 20 21 |
# File 'lib/selections.rb', line 14 def self.model(&block) if block @model = block else @model ||= lambda { Selection } @model.call end end |