magiclabs/alchemy-guides — pull request #25 by thomasjachmann (2014-06-12 14:03:27+00:00)
Title: Fix contact form validation example

With the old code, this was the error:

ArgumentError wrong number of arguments (0 for 1) in [gemdir]/ruby/2.1.0/bundler/gems/alchemy_cms-dbdce1d061a8/lib/alchemy/essence.rb:146:in `validate_format'
[gemdir]/ruby/2.1.0/bundler/gems/alchemy_cms-dbdce1d061a8/lib/alchemy/essence.rb:118:in `block in validate_ingredient'
[gemdir]/ruby/2.1.0/bundler/gems/alchemy_cms-dbdce1d061a8/lib/alchemy/essence.rb:114:in `each'
[gemdir]/ruby/2.1.0/bundler/gems/alchemy_cms-dbdce1d061a8/lib/alchemy/essence.rb:114:in `validate_ingredient'
[gemdir]/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:424:in `block in make_lambda'
[gemdir]/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:176:in `call'
[gemdir]/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:176:in `block in conditional'
[gemdir]/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:86:in `call'
[gemdir]/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:86:in `run_callbacks'
[gemdir]/ruby/2.1.0/gems/activemodel-4.1.1/lib/active_model/validations.rb:376:in `run_validations!'
[gemdir]/ruby/2.1.0/gems/activemodel-4.1.1/lib/active_model/validations/callbacks.rb:111:in `block in run_validations!'
[gemdir]/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:113:in `call'
[gemdir]/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:113:in `call'
[gemdir]/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
[gemdir]/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:166:in `call'
[gemdir]/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:166:in `block in halting'
[gemdir]/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:86:in `call'
[gemdir]/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:86:in `run_callbacks'
[gemdir]/ruby/2.1.0/gems/activemodel-4.1.1/lib/active_model/validations/callbacks.rb:111:in `run_validations!'
[gemdir]/ruby/2.1.0/gems/activemodel-4.1.1/lib/active_model/validations.rb:317:in `valid?'
[gemdir]/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/validations.rb:70:in `valid?'
[gemdir]/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/validations.rb:77:in `perform_validations'
[gemdir]/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/validations.rb:51:in `save'
[gemdir]/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/attribute_methods/dirty.rb:21:in `save'
[gemdir]/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/transactions.rb:268:in `block (2 levels) in save'
[gemdir]/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/transactions.rb:329:in `block in with_transaction_returning_status'
[gemdir]/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:209:in `transaction'
[gemdir]/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/transactions.rb:208:in `transaction'
[gemdir]/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/transactions.rb:326:in `with_transaction_returning_status'
[gemdir]/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/transactions.rb:268:in `block in save'
[gemdir]/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/transactions.rb:283:in `rollback_active_record_state!'
[gemdir]/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/transactions.rb:267:in `save'
[gemdir]/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/persistence.rb:232:in `block in update'
[gemdir]/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/transactions.rb:329:in `block in with_transaction_returning_status'
[gemdir]/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `block in transaction'
[gemdir]/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:219:in `within_new_transaction'
[gemdir]/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `transaction'
[gemdir]/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/transactions.rb:208:in `transaction'
[gemdir]/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/transactions.rb:326:in `with_transaction_returning_status'
[gemdir]/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/persistence.rb:230:in `update'
[gemdir]/ruby/2.1.0/bundler/gems/alchemy_cms-dbdce1d061a8/app/models/alchemy/content.rb:132:in `update_essence'
[gemdir]/ruby/2.1.0/bundler/gems/alchemy_cms-dbdce1d061a8/app/models/alchemy/element.rb:271:in `block in update_contents'
[gemdir]/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/relation/delegation.rb:46:in `each'
[gemdir]/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/relation/delegation.rb:46:in `each'
[gemdir]/ruby/2.1.0/bundler/gems/alchemy_cms-dbdce1d061a8/app/models/alchemy/element.rb:270:in `update_contents'
[gemdir]/ruby/2.1.0/bundler/gems/alchemy_cms-dbdce1d061a8/app/controllers/alchemy/admin/elements_controller.rb:68:in `update'
[gemdir]/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
[gemdir]/ruby/2.1.0/gems/actionpack-4.1.1/lib/abstract_controller/base.rb:189:in `process_action'
[gemdir]/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_controller/metal/rendering.rb:10:in `process_action'
[gemdir]/ruby/2.1.0/gems/actionpack-4.1.1/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
[gemdir]/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:113:in `call'