~ubuntu-branches/ubuntu/precise/libjifty-dbi-perl/precise

« back to all changes in this revision

Viewing changes to lib/Jifty/DBI/Schema.pm

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Yu
  • Date: 2011-03-01 20:29:12 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20110301202912-pvf5r3de3vqp40w0
Tags: 0.67-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
                             # looks like a type name but not found
74
74
                             return ($_[0] => 1) unless $typehandler;
75
75
                             return $typehandler->();
76
 
                         },
 
76
        },
77
77
        are         => '',
78
78
        as          => '',
79
79
        ajax        => 'ajax_',
208
208
    my $from = caller;
209
209
 
210
210
    my $new_code = sub {
211
 
        no warnings 'redefine';
212
 
        local *_ = sub { my $args = \@_; defer { _(@$args) } };
213
 
        $from->_init_columns;
214
 
 
215
 
        my @columns = &declare($code);
216
 
 
217
 
        # Unimport all our symbols from the calling package,
218
 
        # except for "lazy" and "defer".
219
 
        foreach my $sym (@EXPORT) {
220
 
            next if $sym eq 'lazy' or $sym eq 'defer';
221
 
 
222
 
            no strict 'refs';
223
 
            undef *{"$from\::$sym"}
224
 
                if \&{"$from\::$sym"} == \&$sym;
225
 
        }
226
 
 
227
 
        foreach my $column (@columns) {
228
 
            next if !ref($column);
229
 
            _init_column($column);
230
 
        }
 
211
        no warnings 'redefine';
 
212
        local *_ = sub { my $args = \@_; defer { _(@$args) } };
 
213
        $from->_init_columns;
 
214
 
 
215
        my @columns = &declare($code);
 
216
 
 
217
# Unimport all our symbols from the calling package,
 
218
            # except for "lazy" and "defer".
 
219
        foreach my $sym (@EXPORT) {
 
220
                next if $sym eq 'lazy' or $sym eq 'defer';
 
221
 
 
222
            no strict 'refs';
 
223
            undef *{"$from\::$sym"}
 
224
            if \&{"$from\::$sym"} == \&$sym;
 
225
        }
 
226
 
 
227
        foreach my $column (@columns) {
 
228
            next if !ref($column);
 
229
            _init_column($column);
 
230
        }
231
231
 
232
232
        $from->_init_methods_for_columns;
233
233
    };