Class: ActiveRecord::Base
- Inherits:
-
Object
- Object
- ActiveRecord::Base
- Defined in:
- lib/validations.rb
Constant Summary collapse
- @@validations =
{}
Class Method Summary collapse
-
.new_validations ⇒ Object
Creates an object and returns all validations without persisting.
-
.schema_validations ⇒ Object
Returns the schema validations defined in the migration.
Class Method Details
.new_validations ⇒ Object
Creates an object and returns all validations without persisting
111 112 113 114 115 116 117 |
# File 'lib/validations.rb', line 111 def new_validations object = new # this triggers the validations so that they are captured schema = schema_validations object.instance_variable_set(:@validations, schema.merge(validations) ) unset_aliases object end |
.schema_validations ⇒ Object
Returns the schema validations defined in the migration
120 121 122 |
# File 'lib/validations.rb', line 120 def schema_validations FlexScaffold::Validations.new(name).get_schema_info end |