The initialize_with_validation_reflection (alias method for initialize) is not called (not aliased?) when the default initializer for Column class is called. I have rails 2.3.5 and the latest AS with the latest validation_reflection plugin.
Thanks for support. On 17 Mar, 19:04, andrea <[email protected]> wrote: > Someone have tested ReflectValidation as Bridge ? > > Thanks > > On Mar 17, 4:04 pm, andrea <[email protected]> wrote: > > > > > Yes i have an up to date AS, my ib/bridges/validation_reflection/lib/ > > validation_reflection_bridge.rb is: > > > module ActiveScaffold > > module ValidationReflectionBridge > > def self.included(base) > > base.class_eval > > { alias_method_chain :initialize, :validation_reflection } > > end > > > def initialize_with_validation_reflection(name, > > active_record_class) > > initialize_without_validation_reflection(name, > > active_record_class) > > column_names = [name] > > column_names << @association.primary_key_name if @association > > self.required = column_names.any? do |column_name| > > > active_record_class.reflect_on_validations_for(column_name.to_sym).any? > > do |val| > > val.macro == :validates_presence_of or (val.macro > > == :validates_inclusion_of and not val.options[:allow_nil] and not > > val.options[:allow_blank]) > > end > > end > > end > > end > > end > > ActiveScaffold::DataStructures::Column.class_eval do > > include ActiveScaffold::ValidationReflectionBridge > > end > > > but not work. > > > Thanks for support. > > > On Mar 17, 2:00 pm, "Sergio Cambra .:: entreCables S.L. ::." > > > <[email protected]> wrote: > > > On Miércoles, 17 de Marzo de 2010 09:39:36 andrea escribió: > > > > > The alias method chain wich alias the initialize for active scaffold > > > > column with new initializer with validation reflection seems not > > > > work. > > > > Do you have an up to date AS? Do you have this line in > > > lib/bridges/validation_reflection/lib/validation_reflection_bridge.rb? > > > base.class_eval { alias_method_chain :initialize, :validation_reflection } > > > > It's working here. > > > > > On 16 Mar, 19:01, andrea <[email protected]> wrote: > > > > > With the latest AS (git://github.com/activescaffold/ > > > > > active_scaffold.git) and the latest validation reflection plugin > > > > > (git://github.com/redinger/validation_reflection.git), the required > > > > > column property is not automatically set to true, when i have > > > > > validations on model (validates_presence_of). > > > > > This seems associated to the git commit where validation reflection is > > > > > moved to bridge. > > > > > > Thanks for support. > > > > -- > > > Sergio Cambra .:: entreCables S.L. ::. > > > Mariana Pineda 23, 50.018 Zaragoza > > > T)902 021 404F)976 52 98 07E) [email protected] -- You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en.
